[GRASS-dev] [GRASS GIS] #2892: t.rast.aggregate: error when input space time raster dataset store many rasters

GRASS GIS trac at osgeo.org
Wed Feb 3 02:23:15 PST 2016


#2892: t.rast.aggregate: error when input space time raster dataset store many
rasters
-------------------------------------------------+-------------------------
 Reporter:  tmsz                                 |      Owner:  grass-dev@…
     Type:  defect                               |     Status:  new
 Priority:  normal                               |  Milestone:  7.0.4
Component:  Temporal                             |    Version:  7.0.2
 Keywords:  wingrass, t.rast.aggregate,          |        CPU:  x86-64
  g.message                                      |
 Platform:  MSWindows 7                          |
-------------------------------------------------+-------------------------
 Steps to reproduce (follow example from Soren Gebbert presentation: The
 temporal GRASS GIS framework, page 53):[[BR]]

 * download the ECAD climate dataset from
 [http://eca.knmi.nl/download/ensembles/data/Grid_0.25deg_reg/] as several
 netCDF files (tg_0.25deg_reg_1950-1964_v12.0.nc.gz,
 tg_0.25deg_reg_1965-1979_v12.0.nc.gz,
 tg_0.25deg_reg_1965-1979_v12.0.nc.gz,
 tg_0.25deg_reg_1995-2015_v12.0.nc.gz) and import them with r.in.gdal in a
 Lat/Lon location.[[BR]]

 * import netCDF files
  * {{{r.in.gdal -oe input=tg_0.25deg_reg_1950-1964_v5.0.nc
 output=temperature_mean offset=0}}}[[BR]]
  * {{{r.in.gdal -oe input=tg_0.25deg_reg_1965-1979_v12.0.nc
 output=temperature_mean offset=5480}}}[[BR]]
  * {{{r.in.gdal -oe input=tg_0.25deg_reg_1980-1994_v12.0.nc
 output=temperature_mean offset=10959}}}[[BR]]
  * {{{r.in.gdal -oe input=tg_0.25deg_reg_1995-2015_v12.0.nc
 output=temperature_mean offset=16439}}}[[BR]]

   total count of temperature_mean rasters = 23925[[BR]]

  * {{{t.create type=strds output=temperature_mean_1950_2015_daily
 temporal=absolute title="European mean temperature 1950-2015"
 description="The European daily mean temperature"}}}[[BR]]

  * create text file with all temperature_mean rasters[[BR]]

 {{{
 #!div style="font-size: 100%"
    python code:
    {{{#!python
 import os
 map_list = os.path.join(os.path.expanduser('~'), 'map_list.txt')
 with open(map_list, 'w') as f:
     for i in range(23925):
         f.write('temperature_mean.{0}\n'.format(i + 1))
    }}}
 }}}

 * {{{t.register -i type=rast input=temperature_mean_1950_2015_daily
 file="path to the map_list.txt file" start=1950-01-01 increment="1
 days"}}}[[BR]]

 * {{{g.region -p rast=temperature_mean.1}}}[[BR]]

 * {{{t.rast.aggregate input=temperature_mean_1950_2015_daily
 method=average output=temperature_mean_1950_2015_monthly
 base=temperature_mean_monthly granularity="1 months"}}}[[BR]]

 Error message:
 {{{
 Traceback (most recent call last):
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2/scripts/t.rast.aggregate.py", line 215, in <module>
     main()
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2/scripts/t.rast.aggregate.py", line 185, in main
     nprocs))
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2\etc\python\grass\script\core.py", line 580, in info
     message(msg, flag='i')
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2\etc\python\grass\script\core.py", line 551, in message
     run_command("g.message", flags=flag, message=msg,
 errors='ignore')
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2\etc\python\grass\script\core.py", line 396, in
 run_command
     ps = start_command(*args, **kwargs)
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2\etc\python\grass\script\core.py", line 364, in
 start_command
     return Popen(args, **popts)
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2\etc\python\grass\script\core.py", line 67, in __init__
     subprocess.Popen.__init__(self, args, **kwargs)
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2\Python27\lib\subprocess.py", line 711, in __init__
     errread, errwrite)
   File "C:\Program Files (x86)\GRASS GIS
 7.0.2\Python27\lib\subprocess.py", line 953, in
 _execute_child
     startupinfo)
 WindowsError: [Error 206] The filename or extension is too
 long
 }}}

 Error appear in the core.py file, class Popen (row 67). I try debug
 subprocess.py file. Error realated with creating process (subprocess.py
 file, method _subprocess.CreateProcess, row 946) when g.message.exe
 command is callled (created process) with long message argument as args
 parameter in method _subprocess.CreateProcess (attached file with args
 argument). [[BR]]


 On Windows OS platform is command-line string limitation for total length
 of the following command line [https://support.microsoft.com/en-
 us/kb/830473].

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2892>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list