[GRASS-user] GRASS Python Script- How to check if the imported file is a raster

antonio.rocha at deimos.com.pt antonio.rocha at deimos.com.pt
Thu Oct 14 08:11:00 EDT 2010


Greetings

I've built a python script to import a certain type of data (Globcover  
products) through r.in.gdal and gdalwarp. But for instance, in the  
other day I selected a non-raster file (txt) and:
- it checked that it exists (check_file= os.path.isfile(input)
but since gdalwarp and r.in.gdal does not recognize as a raster it  
gave an error but I want to "STOP" the process... any suggestion?

And by the way, how can I eliminate the text-outputs from gdalwarp

This is related also with what people have been discussing but I'm  
running python scripts in WinGRASS 6.4 (through OSGEO4W). And it seems  
to be working :)

Thanks
Antonio


More information about the grass-user mailing list