[GRASS-dev] [GRASS GIS] #2574: r.surf.icw - not working with the last version of grass7

#2574: r.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
I updated my grass7 not thinking about compatibility issues. Several
scripts used by r.surf.icw have changed among which g.remove

For example line 322

{{{
grass.run_command('g.remove', flags = 'f', rast = cost_site_name, quiet =
True)
}}}

must be changed to.

{{{
  grass.run_command('g.remove', type='raster', flags = 'f', name =
cost_site_name, quiet = True)
}}}

Now the module works partially but I struggled to find the final solution
and I was wondering if someone who knows the code better can fix it.

I get the following errors after the successful creation of the :
temporary files (tmp_icw*):

{{{
Creating partial weights ...
Site 1 of 51, cat = 1, data value = 6.281
Site 2 of 51, cat = 2, data value = 6.378843
Site 3 of 51, cat = 3, data value = 6.324808
ERROR: Error reading raster data for row 281 of <MASK>
ERROR: Error reading raster data for row 2343 of <MASK>
ERROR: Error reading raster data for row 2109 of <MASK>
}}}

and at the end probably due to the former errors:

{{{
Calculating final values ...
Reading raster map <tmp_icw_25595_partial.00001> using weight 1.000000...
ERROR: Raster map <tmp_icw_25595_partial.00001> not found
ERROR: Problem running r.series
Cleanup..
}}}

This worked fine in grass 7 several months ago.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574&gt;
GRASS GIS <http://grass.osgeo.org>

#2574: r.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by bhlevca):

Sorry I meant v.surf.icw.

I tried to modify the subject but I could not figure out how.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#2574: r.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by bhlevca):

I found the problem I had a dangling raster map named MASK that was
screwing up.

I deleted that and now it works properly.

I am attaching my version and hopefully someone with access will update
svn

Thanks

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#2574: r.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by annakrat):

I just fixed the g.remove calls in r64399.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#2574: r.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by bhlevca):

I have a large number of points (~20000) and the script runs fine until it
reaches the point of summation of cost weights.

Then Python gives up because there are too many items in the arguments
list.
I am wondering if the script could be changed to work around Python's
limitation

Here is the error:

Removing anomalies at site positions ...
Applying radial decay ...
Finding sum of squares ...
Summation of cost weights ...
...
omitted lines
...
   File "/usr/lib64/python2.7/subprocess.py", line 1327, in
_execute_child
     raise child_exception
OSError: [Errno 7] Argument list too long

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#2574: v.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Addons | Version: svn-trunk
Keywords: v.surf.icw | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * keywords: => v.surf.icw
  * component: Default => Addons

Old description:

I updated my grass7 not thinking about compatibility issues. Several
scripts used by r.surf.icw have changed among which g.remove

For example line 322

{{{
grass.run_command('g.remove', flags = 'f', rast = cost_site_name, quiet =
True)
}}}

must be changed to.

{{{
grass.run_command('g.remove', type='raster', flags = 'f', name =
cost_site_name, quiet = True)
}}}

Now the module works partially but I struggled to find the final
solution and I was wondering if someone who knows the code better can fix
it.

I get the following errors after the successful creation of the :
temporary files (tmp_icw*):

{{{
Creating partial weights ...
Site 1 of 51, cat = 1, data value = 6.281
Site 2 of 51, cat = 2, data value = 6.378843
Site 3 of 51, cat = 3, data value = 6.324808
ERROR: Error reading raster data for row 281 of <MASK>
ERROR: Error reading raster data for row 2343 of <MASK>
ERROR: Error reading raster data for row 2109 of <MASK>
}}}

and at the end probably due to the former errors:

{{{
Calculating final values ...
Reading raster map <tmp_icw_25595_partial.00001> using weight 1.000000...
ERROR: Raster map <tmp_icw_25595_partial.00001> not found
ERROR: Problem running r.series
Cleanup..
}}}

This worked fine in grass 7 several months ago.

New description:

I updated my grass7 not thinking about compatibility issues. Several
scripts used by v.surf.icw have changed among which g.remove

For example line 322

{{{
grass.run_command('g.remove', flags = 'f', rast = cost_site_name, quiet =
True)
}}}

must be changed to.

{{{
  grass.run_command('g.remove', type='raster', flags = 'f', name =
cost_site_name, quiet = True)
}}}

Now the module works partially but I struggled to find the final solution
and I was wondering if someone who knows the code better can fix it.

I get the following errors after the successful creation of the :
temporary files (tmp_icw*):

{{{
Creating partial weights ...
Site 1 of 51, cat = 1, data value = 6.281
Site 2 of 51, cat = 2, data value = 6.378843
Site 3 of 51, cat = 3, data value = 6.324808
ERROR: Error reading raster data for row 281 of <MASK>
ERROR: Error reading raster data for row 2343 of <MASK>
ERROR: Error reading raster data for row 2109 of <MASK>
}}}

and at the end probably due to the former errors:

{{{
Calculating final values ...
Reading raster map <tmp_icw_25595_partial.00001> using weight 1.000000...
ERROR: Raster map <tmp_icw_25595_partial.00001> not found
ERROR: Problem running r.series
Cleanup..
}}}

This worked fine in grass 7 several months ago.

--

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#2574: v.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Addons | Version: svn-trunk
Keywords: v.surf.icw | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by lucadelu):

Replying to [comment:4 bhlevca]:
> I have a large number of points (~20000) and the script runs fine until
it reaches the point of summation of cost weights.
>
> Then Python gives up because there are too many items in the arguments
list.
> I am wondering if the script could be changed to work around Python's
limitation
>
> Here is the error:
>
> Removing anomalies at site positions ...
> Applying radial decay ...
> Finding sum of squares ...
> Summation of cost weights ...
> ...
> omitted lines
> ...
> File "/usr/lib64/python2.7/subprocess.py", line 1327, in
> _execute_child
> raise child_exception
> OSError: [Errno 7] Argument list too long

Could you please send us a command line to test it?

Possibly with north carolina dataset.

Thanks
Luca

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#2574: v.surf.icw - not working with the last version of grass7
-------------------------+--------------------------------------------------
Reporter: bhlevca | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Addons | Version: svn-trunk
Keywords: v.surf.icw | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by bhlevca):

Sorry I don't have the North Carolina dataset but I can explain the
command line I used below.

{{{
  v.surf.icw input=TorontoHarbourBathymetryWaterSimplifyedPoints
column=Contour output=TorontoHarbourBathyInterpRast
cost_map=TorontoHarbourWaterMaskCorrRast friction=3.5 --verbose workers=3
}}}

{{{
TorontoHarbourBathymetryWaterSimplifyedPoints has ~24000 points

}}}

{{{
The values attribute is Contour
}}}

{{{
The mask and the costmap is TorontoHarbourWaterMaskCorrRast just a plain
polygons converted into a raster.
}}}

The problem is that when putting all the temporary maps together on the
Python subprocess call it exceeds the maximum allowable size handled by
Python or by the OS and I was wondering if there is another way of
sequentially doing this.

see [http://www.in-ulm.de/~mascheck/various/argmax/\]

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2574#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>