Opened 9 years ago

Closed 8 years ago

#1220 closed defect (wontfix)

Error when creating vector(areas) from raster

Reported by: toyzerocha1980 Owned by: grass-dev@…
Priority: major Milestone: 6.4.1
Component: Vector Version:
Keywords: wingrass, memory, r.to.vect Cc:
CPU: x86-32 Platform: MSWindows XP

Description

I'm trying to create a vector (areas) from a big LandUSe/LandCover map with a lot of small patterns so, I believe that I have a lot of polygons I'm using this expression: r.to.vect -v input=map output=test02 feature=area

And I get this error: Extracting areas... Building topology for vector map <test02>... Registering primitives...

820000ERROR: G_realloc: unable to allocate 9900000 bytes at cindex.c:108

A few days ago, with other image I have obtained almost tghe same error but a bit different: ERROR: G_realloc: unable to allocate 33760000 bytes at areas.c:678

My Region is defined as: projection: 99 (Transverse Mercator) zone: 0 datum: etrs89 ellipsoid: grs80 north: -4772.159565 south: -300404.804 west: -28364.80083451 east: 105242.8746 nsres: 30.00128318 ewres: 29.99723292 rows: 9854 cols: 4454 cells: 43889716

I'm going to try in Linux and I wil reply on this right next.

Change History (8)

comment:1 Changed 9 years ago by toyzerocha1980

Hi

Still in Windows: It has created a vector file and it seems ok (in extent)

But If I use v.what I get: v.what --q -a map=test03@National east_north=66367.029426,-51132.981541 distance=220.079183 Coor files of vector map <test03@National> is larger than it should be (99266507 bytes excess) ERROR: You must build topology on vector map <teste03@National> (Mon Nov 22 12:21:03 2010) Command finished (0 sec)

And I'm not able to add any column v.db.addcol and Vector does not have any topology...

comment:2 Changed 9 years ago by toyzerocha1980

Ok I have decided to create/build topology v.build map=test10@National error=error10 Coor files of vector map <teste10@National> is larger than it should be (99266507 bytes excess) Building topology for vector map <teste10>... Registering primitives... 1874449 primitives registered 5317522 vertices registered Building areas... 601738 areas built 117075 isles built Attaching islands... Attaching centroids... Number of nodes: 1389786 Number of primitives: 1874449 Number of points: 0 Number of lines: 0 Number of boundaries: 1272712 Number of centroids: 601737 Number of areas: 601738 Number of isles: 117075 Number of areas without centroid: 1 Building topology for vector map <error10>... Registering primitives... 1 primitives registered 5 vertices registered Building areas... 1 areas built 1 isles built Attaching islands... Attaching centroids... Number of nodes: 1 Number of primitives: 1 Number of points: 0 Number of lines: 0 Number of boundaries: 1 Number of centroids: 0 Number of areas: 1 Number of isles: 1 Number of areas without centroid: 1 (Mon Nov 22 13:54:01 2010) Command finished (1421 sec)

And when I try v.what I get: Coor files of vector map <teste10@National> is larger than it should be (99266507 bytes excess) Building spatial index... East: 70680.40267 North: -70979.942188 Map: teste10 Mapset: National Type: Area Sq Meters: 1083351106.914 Hectares: 108335.111 Acres: 267701.889 Sq Miles: 418.2842 Layer: 1 Category: 11 Driver: dbf Database: C:\DWEISdata/Portugal/National/dbf/ Table: teste10 Key column: cat Cannot open select cursor:<BR>'select * from teste10 where cat = 11'<BR>on database 'C:
DWEISdata/Portugal/National/dbf/' by driver 'dbf'<BR> DBMI-DBF driver error: Table 'teste10' doesn't exist. Error in db_open_select_cursor() Cannot open select cursor (Mon Nov 22 14:45:19 2010) Command finished (131 sec)

and the following in DOS commandline window DBMI-DBF driver error: Table "test10" doesn't exist

GRASS_INFO_ERROR(5452,1): Unable to describe table <test10> GRASS_INFO_END(5452,1)

comment:3 in reply to:  2 ; Changed 9 years ago by neteler

Replying to toyzerocha1980:

Ok I have decided to create/build topology

> v.build map=test10@National error=error10                                      
> Coor files of vector map <teste10@National> is larger than it should be (99266507 bytes excess)
> Building topology for vector map <teste10>...
> Registering primitives...
> 1874449 primitives registered
> 5317522 vertices registered
> Building areas...
> 601738 areas built
> 117075 isles built
...

perhaps you exceed the 2Gb limit here? GRASS 7 supports large file support (LFS).

comment:4 in reply to:  3 Changed 9 years ago by mmetz

Replying to neteler:

Replying to toyzerocha1980:

Ok I have decided to create/build topology

> > v.build map=test10@National error=error10                                      
> > Coor files of vector map <teste10@National> is larger than it should be (99266507 bytes excess)
> > Building topology for vector map <teste10>...
> > Registering primitives...
> > 1874449 primitives registered
> > 5317522 vertices registered
> > Building areas...
> > 601738 areas built
> > 117075 isles built
> ...

perhaps you exceed the 2Gb limit here? GRASS 7 supports large file support (LFS).

I don't think so. The coor file size warning is issued because the vector was not properly closed when creating it with r.to.vect and the coor file size was not written to the coor header. So far this warning can be ignored. Also, there is no LFS (yet) in wingrass, also not in 7.

601738 areas is a lot and you are likely to run out of memory with such a large vector on a 32 bit operating system, or a 64 bit operating system with insufficient system memory. I am planning to substantially reduce memory requirements for vector processing in grass 7 such that you could easily process 601738 areas with 32 bit wingrass, but that will still take some time.

Markus M

comment:5 Changed 9 years ago by toyzerocha1980

Hi

In this case, and since I'm converting a raster-to-Vector how can I know that I'm over 2Gb limit?

Ok, after some minor changes in r.to.vect (in areas_io.c), I was able to produce a vector file for my raster after almost 3 hours processing (in Win 7). When I try to display it, GRASS freezed and then collpsed. But this is no way to do this...

comment:6 Changed 9 years ago by martinl

Priority: blockermajor

comment:7 Changed 9 years ago by hellik

Keywords: wingrass added

comment:8 Changed 8 years ago by hamish

Keywords: memory r.to.vect added
Resolution: wontfix
Status: newclosed

closing the ticket as "wontfix" (aka can't fix), if you want to work with huge datasets the solutions seem to be installing more RAM and/or a more capable 64bit OS.

building topology in GRASS 6.4 is going to get memory hungry and with 32bit WinXP there's a hard RAM limit that we can't do much about.

you can try to use the r.to.vect -b flag to skip building topology, but that's mostly useful for point data, not areas.

you can also try running the module on a smaller raster region, then v.patch the results back together and dissolve out any seam boundary lines.

Hamish

Note: See TracTickets for help on using tickets.