Dear all,
I would like to know if there is any direct method (of a suggestion of an indirect method) to list raster layers with valid pixels (not null) in a defined computational region?
Thank you
Regards,
Antonio Rocha
On Friday 25 of October 2013 10:07:27 António Rocha wrote:
I would like to know if there is any direct method (of a suggestion of
an indirect method) to list raster layers with valid pixels (not null)
in a defined computational region?
You mean only raster maps that do not contain NULL cells at all, inside the
computational region?
Nikos
Hi Antonio,
here is a python script snipped. this might be slow if you have many rasters that have values in the current region, those that don't, wont take any time though.
import grass.script as grass
def inregion():
'''Return rasters in current mapset that have non-NULL values in current region'''
maps=grass.list_strings('rast')
mapsin =
for r in maps:
vin=grass.read_command('r.stats',input=r,flags='n').split()
if len(vin)>0: mapsin+=[r]
return mapsin
if __name__=='__main__':
print inregion()
Regards,
Michel
On 10/25/2013 11:07 AM, António Rocha wrote:
Dear all,
I would like to know if there is any direct method (of a suggestion of an indirect method) to list raster layers with valid pixels (not null) in a defined computational region?
Thank you
Regards,
Antonio Rocha
_______________________________________________
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
Hello Nikos
I would rephrase and say list of raster maps with at least a single not-NULL cell inside a computational region.
Regards,
Antonio
On 25-10-2013 11:26, Nikos Alexandris wrote:
On Friday 25 of October 2013 10:07:27 António Rocha wrote:
I would like to know if there is any direct method (of a suggestion of
an indirect method) to list raster layers with valid pixels (not null)
in a defined computational region?You mean only raster maps that do not contain NULL cells at all, inside the
computational region?Nikos