[GRASS-user] FW: Temporal + export

Markus Neteler neteler at osgeo.org
Thu May 5 09:39:08 PDT 2016


Hi Matías,

On Thu, May 5, 2016 at 5:41 PM, Matías Alejandro Castillo Moine
<matialecastillo at hotmail.com> wrote:
> Hi everyone!
>
> I never used a list... I think I made a mistake when sent the message
> yesterday...

now it reached the list :)

> I was construct a strds in grass 7.0.3,

(Would it be possible for you to update to 7.0.4? Just to be sure that
the problem is yes/no solved?

> and I want to export it for use in R
> to do some statistics not included with tgrass.. But when I do the export
> operation, I receive this message:
>
> Usising the GUI:
> t.rast.export --overwrite --verbose input=LST2 at MOD11A2 output=C:\SIG\Base de
> datos area de estudio\Datasets_R\LSR_R compression=gzip

Hint: You are using white space in the path ("Base de datos area de
estudio\"). Maybe it doesn't matter but just to exclude this potential
issue, please try with a different path name.

...
>     new_cwd = tempfile.mkdtemp(dir=directory)
>   File "C:\OSGEO4~1\apps\Python27\lib\tempfile.py", line
> 329, in mkdtemp
>     _os.mkdir(file, 0700)
> WindowsError: [Error 3] El sistema no puede encontrar la
> ruta especificada: '/tmp\\tmppi2oh1'

This looks like a bug: it uses /tmp/ which does not exist on Windows.
The current code is:

/lib/python/temporal/stds_export.py, line 274
    # Create the temporary directory and jump into it
    new_cwd = tempfile.mkdtemp(dir=directory)
    os.chdir(new_cwd)

but AFAIK it should use this portable function:
lib/python/script/core.py:def tempdir():

@devs: opinions?


Concerning the other issue:

> In python (very difficult):
>
> input="LST2 at MOD11A2"
> output="LST_R.tar.gz"
> compression="gzip"
> directory="C:/SIG/Base de datos area de estudio/Datasets_R/"
> where=None
> format_="GTiff"
> type_="strds"
> tgis.export_stds(input, output, compression, directory, where, format_,
> type_)
>>>>Traceback (most recent call last):
>   File "<input>", line 1, in <module>
>   File
> "C:\OSGEO4~1\apps\grass\grass-7.0.3\etc\python\grass\temporal\stds_export.py",
> line 298, in export_stds
>     rows, tar, list_file, new_cwd, fs, format_)
>   File
> "C:\OSGEO4~1\apps\grass\grass-7.0.3\etc\python\grass\temporal\stds_export.py",
> line 74, in _export_raster_maps_as_gdal
>     nodata = max_val + 1
> TypeError: unsupported operand type(s) for +: 'NoneType' and 'int'

...here I have no suggestion. Anyone?

Markus


More information about the grass-user mailing list