[GRASS-user] v.label.sa out of memory on small vector map.

Tom Russo russo at bogodyn.org
Tue May 26 16:44:38 EDT 2009


I have just started playing with v.label.sa in GRASS 6.5-svn (last updated
yesterday).

I had success in getting it to process one fairly large map of US Forest Service
trail data, but had it run out of memory on a similar map from the same source
of road data.  Even trying to run it on a very small subset (40 lines) of the
road data in my area of interest gets an out-of-memory error as the size of
v.label.sa grows to more than 1GB.

Here's what I've done:

Download "Current Trails Inventory" and "Current Roads Inventory" from
http://www.fs.fed.us/r3/cibola/plan-revision/gis_data/data.shtml

These are Zipped shapefile sets.  I imported into a NAD83, UTM zone 13
region (EPSG:26913) using v.in.ogr without problem.  I imported Trail_Route.shp
as "trails2008" and Road_Route.shp as usfs_roads2008.

This works:

v.label.sa map=trails2008 column=TRL_NO labels=trails2008 font=VeraSe

It doesn't produce the lovliest of labels, but runs in small memory and in
reasonable time.

But this fails with a memory allocation error, after chewing a long time:
 v.label.sa map=usfs_roads2008 column=RTE_NO labels=roads2008 font=Vera

usfs_roads2008 contains 6203 lines, so I tried to restrict my consideration
to the area I actually want to make a paper map of.

> g.region -p
projection: 1 (UTM)
zone:       13
datum:      nad83
ellipsoid:  grs80
north:      3883362.61697134
south:      3877081.62443534
west:       373147.02714574
east:       380581.87668613
nsres:      2.4382735
ewres:      2.43845508
rows:       2576
cols:       3049
cells:      7854224


> v.in.region output=tmpreg

> v.select ainput=usfs_roads2008 binput=tmpreg output=trnngroads operator=overlap

> v.info trnngroads
 +----------------------------------------------------------------------------+
 | Layer:           trnngroads                                                |
 | Mapset:          PERMANENT                                                 |
 | Location:        NewMexico                                                 |
 | Database:        /users/russo/GIS                                          |
 | Title:                                                                     |
 | Map scale:       1:1                                                       |
 | Map format:      native                                                    |
 | Name of creator: russo                                                     |
 | Organization:                                                              |
 | Source date:     Tue May 26 10:30:59 2009                                  |
 |----------------------------------------------------------------------------|
 |   Type of Map:  vector (level: 2)                                          |
 |                                                                            |
 |   Number of points:       0               Number of areas:      0          |
 |   Number of lines:        40              Number of islands:    0          |
 |   Number of boundaries:   0               Number of faces:      0          |
 |   Number of centroids:    0               Number of kernels:    0          |
 |                                                                            |
 |   Map is 3D:              No                                               |
 |   Number of dblinks:      1                                                |
 |                                                                            |
 |         Projection: x,y (zone 0)                                           |
 |               N:       3940710.738    S:       3846467.585                 |
 |               E:        678499.548    W:        132270.347                 |
 |                                                                            |
 |   Digitization threshold: 0                                                |
 |   Comments:                                                                |
 |                                                                            |
 +----------------------------------------------------------------------------+

But v.label.sa still gets a memory allocation error on this:
Initialising labels... 100%
Generating label candidates: ... 100%
 51%

At this point, "top" shows v.label.sa starting to grow tremendously, rapidly 
getting to 200M, gradually growing to 1000M.

This only happens with this particular data set.   What could make v.label.sa
grow so much on a map with only 40 lines?

-- 
Tom Russo    KM5VY   SAR502   DM64ux          http://www.swcp.com/~russo/
Tijeras, NM  QRPL#1592 K2#398  SOC#236        http://kevan.org/brain.cgi?DDTNM
  In some cultures what I do would be considered normal. 
                                  -- Ineffective daily affirmation 


More information about the grass-user mailing list