[GRASS-user] ERROR 1: TIFFOpen: No error Using GDAL data type <Byte>

Micha Silver micha at arava.co.il
Tue Apr 7 04:43:25 PDT 2015


I think you're somehow getting a newline character into the output path. 
See below.
Try using the native python os.path.join(...) to create an output 
variable and avoid any use of string concatenation within the 
run_command statement (including the input varialbe)

On 04/07/2015 12:00 PM, umberto.minora wrote:
> I am using "r.out.gdal" function within a Python script through the command
> console of grass7.
> I am calling it by doing:
>
> {{{
> from grass.script.core import run_command
>
> run_command("r.out.gdal",
> 				flags="c",
> 				type="Byte",
> 				input="prova"+ str(m+1),
> 				output=outFolder+ "\prova"+ str(m+1)+ ".tif",
> 				nodata=255)
> }}}
>
> I am getting this error:
>
> {{{
> ERROR 1: TIFFOpen:D:\UMBE\PhD\Nepal\khumbu_article\shadow
> _sun_hourly\prova_hourly_shadow\prova1.tif: No error
> Using GDAL data type <Byte>
> ERROR: Impossibile creare il dataset
> <D:\UMBE\PhD\Nepal\khumbu_article\shadow
> _sun_hourly\prova_hourly_shadow\prova1.tif> usando il driver <GTiff>
> Traceback (most recent call last):
>    File "D:\UMBE\PhD\Nepal\khumbu_article\shadow\r_sun_hourly
> \prova_r-sun-hourly.py", line 39, in <module>
>      nodata=255)
>    File "C:\OSGeo4W\apps\grass\grass-7.0.0\etc\python\grass\s
> cript\core.py", line 375, in run_command
>      return handle_errors(returncode, returncode, args,
> kwargs)
>    File "C:\OSGeo4W\apps\grass\grass-7.0.0\etc\python\grass\s
> cript\core.py", line 310, in handle_errors
>      returncode=returncode)
> grass.exceptions.CalledModuleError: Module run None
> ['r.out.gdal', '-c', 'output=D:\\UMBE\\PhD\\Nepal\\khumbu_ar
> ticle\\shadow\r_sun_hourly\\prova_hourly_shadow\\prova1.tif'
------------------^^^--------------------------------------------
Note the '\r' between shadow and _sun

> , 'nodata=255', 'type=Byte', 'input=prova1'] ended with
> error
> Process ended with non-zero return code 1. See errors in the
> (error) output.
> }}}
>
> Anyway, if I use the same call from the command line (not calling the Python
> script) I have my "prova1.tif" written correctly in the folder I chose. Why?
> Any guess?
>
>
>
> --
> View this message in context: http://osgeo-org.1560.x6.nabble.com/ERROR-1-TIFFOpen-No-error-Using-GDAL-data-type-Byte-tp5200187.html
> Sent from the Grass - Users mailing list archive at Nabble.com.
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user
>
> This mail was received via Mail-SeCure System.
>
>



More information about the grass-user mailing list