[GRASS-user] r.watershed error

Markus Metz markus.metz.giswork at googlemail.com
Tue May 25 03:39:33 EDT 2010


Kurt Springs wrote:
> Thanks Markus,
>
> Let me make sure I understand.  For best results I need to set the resolution to 10m for the 1/3 arcsec.

That's not enough, the current computational region must be aligned to
the dem, otherwise you might have the same resolution, but the
computational grid can be shifted against the dm grid. Further on, if
the dem resolution is 1/3 arcsec, the resolution of the computational
region should be 1/3 arcsec as well, unless you have reprojected the
dem to a real projection.

> With the region set as it is (most of Northern New England) when I do this I run out of memory.  To over come this, I can set the region to just encompass just the NED13_01 subregion.  Would it look like g.region zoom=NED13_01 align=NED13_01?

g.region rast=NED13_01

does that too.

>
> Might this also solve another problem I am having with r.watershed.  When the various functions are run, I have the map, plus "stuff" in the NULL area out side the map region.

That is what I meant with that the extends of the computational region
must be within the extends of the dem, otherwise large areas with NULL
are loaded to memory, this only increases memory demands but nothing
is (should be) calculated for NULL cells.

Recommended reading:
http://grass.osgeo.org/grass64/manuals/html64_user/rasterintro.html
here the first part explaining the computational region

and the g.region manual
http://grass.osgeo.org/grass64/manuals/html64_user/rasterintro.html

HTH,

Markus

>
> Thanks for the help.
>
> Kurt
> On May 24, 2010, at 4:37 AM, Markus Metz wrote:
>
>> On Sun, May 23, 2010 at 8:10 PM, Kurt Springs <ferret_bard at mac.com> wrote:
>>> Problem was the resolution it starts working when I set it to 100m.  The dem
>>> is ~69 x 27 km.
>>
>> Apparently, the dem has a resolution of 1/3 arcsec (~10m), maybe
>> reprojected and resampled. With these extends, there would be about
>> 186 million cells in the input map which is not a lot. I have
>> successfully processed regions with ~250 million cells in memory and
>> ~500 million cells in segmented mode. Make sure the current
>> computational region matches the resolution of the input dem and the
>> extends of the current computational region do not exceed the extends
>> of the input map. Setting the computational region to a smaller area
>> within the dem coverage is fine, as long as g.region -p align=NED13_01
>> is used after adjusting the extends. A resolution of 100m throws away
>> a lot of the information present in the original dem.
>>
>>
>>> Thanks
>>> On May 23, 2010, at 12:00 PM, Rich Shepard wrote:
>>>
>>> On Sat, 22 May 2010, Kurt Springs wrote:
>>>
>>> ERROR: G_malloc: unable to allocate 18446744070980740804 bytes at ...
>>>
>>>                                       ^^^^^^^^^^^^^^^^^^^^
>>>
>>> Any idea what I'm doing wrong?
>>>
>>> Kurt,
>>>
>>>   Look at the amount of memory your file wants to be allocated: several
>>> Petabytes. How much area is covered by that DEM and at what resolution? Even
>>> with GRASS compiled for large file support your file is _way_ too large.
>>>
>>> Rich
>>>
>>> _______________________________________________
>>> grass-user mailing list
>>> grass-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/grass-user
>>>
>>>
>
>


More information about the grass-user mailing list