[GRASS-user] Islands and v.to.rast

Priit Voolaid priit.voolaid at mail.ee
Sat May 5 14:21:46 EDT 2007


Hello!

My goal is to convert a vector map into raster format. I have the data in MapInfo format, which comprises of area-objects. v.in.ogr works fine. Only thing, at the end of the process i get an warning that numerous areas “represent more (overlapping) features” and that “such areas are linked to more than 1 row in attribute table”.
This produces problems in format conversion stage with v.to.rast - small areas inside bigger ones (islands) will not be present with their respective category numbers in output raster map. The result looks much more generalized as the source data. I suggest this is due linking one vector object with two rows in attribute table. For example, output of guery tool from Map Display, taken inside an island:

GRASS 6.2.1 (l-est):~ > v.what -a map=v5433_point east_north=635834.39834,6432844.56432 distance=9.81308411215

East: 635834.39834
North: 6432844.56432
Map: v5433_point
Mapset: taimkate
Object type: Area
Sq Meters: 2003.990
Hectares: 0.200
Acres: 0.495
Sq Miles: 0.0008
Layer: 1
Category: 7316
driver: dbf
database: /home/priitv/data/grassdata/l-est/taimkate/dbf/
table: v5433_point
key column: cat
cat : 7316
kood : 9
nimi : laanesegamets
Layer: 1
Category: 11227
driver: dbf
database: /home/priitv/data/grassdata/l-est/taimkate/dbf/
table: v5433_point
key column: cat
cat : 11227
kood : 29
nimi : soo-segamets
Layer: 2
Category: 2

All the small islands within a bigger one have in raster output the same pixel category, the category of that big area they belong to.

Is there any way to work this problem around? Thanks!

Just in case i also add commands and their respective output for vector import and vector-to-raster conversion:

GRASS 6.2.1 (l-est):~ > v.in.ogr dsn=/home/priitv/data/vector/taimkatte_invI/5433.MIF output=v5433 type=boundary
Projection of input dataset and current location appear to match.
Proceeding with import...
Layer: 5433
Importing map 20509 features...
-----------------------------------------------------
Building topology ...
21593 primitives registered
Building areas: 100%
16167 areas built
15829 isles built
Attaching islands: 100%
Attaching centroids: 100%
Topology was built.
Number of nodes : 18503
Number of primitives: 21593
Number of points : 0
Number of lines : 0
Number of boundaries: 21593
Number of centroids : 0
Number of areas : 16167
Number of isles : 15829
Number of incorrect boundaries : 5636
Number of areas without centroid : 16167
-----------------------------------------------------
WARNING: Cleaning polygons, result is not guaranteed!
Building topology ...
Topology was built.
Number of nodes : 18503
Number of primitives: 21593
Number of points : 0
Number of lines : 0
Number of boundaries: 21593
Number of centroids : 0
Number of areas : -
Number of isles : -
-----------------------------------------------------
Break polygons:
Registering points ... 208280
All points (vertices): 459123
Registered points (unique coordinates): 208280
Points marked for break: 37894
Breaks: 109241
-----------------------------------------------------
Remove duplicates:
Duplicates: 51391
-----------------------------------------------------
Break boundaries:
Intersections: 2
-----------------------------------------------------
Remove duplicates:
Duplicates: 2
-----------------------------------------------------
Clean boundaries at nodes:
Modifications: 0
-----------------------------------------------------
Change boundary dangles to lines:
Removed dangles: 0 changed lines: 0
-----------------------------------------------------
Change boundary bridges to lines:
Removed bridges: 0 changed lines: 0
-----------------------------------------------------
Building topology ...
Building areas: 100%
22851 areas built
1029 isles built
Attaching islands: 100%
Topology was built.
Number of nodes : 37896
Number of primitives: 130838
Number of points : 0
Number of lines : 0
Number of boundaries: 130838
Number of centroids : 0
Number of areas : 22851
Number of isles : 1029
Number of areas without centroid : 22851
Layer: 5433
-----------------------------------------------------
-----------------------------------------------------
Building topology ...
80569 primitives registered
Building areas: 100%
22851 areas built
1029 isles built
Attaching islands: 100%
Attaching centroids: 100%
Topology was built.
Number of nodes : 58747
Number of primitives: 80569
Number of points : 0
Number of lines : 0
Number of boundaries: 59718
Number of centroids : 20851
Number of areas : 22851
Number of isles : 1029
Number of areas without centroid : 2000
-----------------------------------------------------
WARNING: 1331 areas represent more (overlapping) features, because polygons
overlap in input layer(s). Such areas are linked to more than 1
row in attribute table. The number of features for those areas is
stored as category in layer 2
21593 input polygons
total area: 9.988400e+07 (22851 areas)
overlapping area: 2.025544e+06 (1331 areas)
area without category: 2.859630e+06 (2000 areas)


GRASS 6.2.1 (l-est):~ > v.to.rast input=v5433 output=v5433 use=attr column=kood
Loading vector information ...
20509 records selected from table 0 mins 03 secs
Sorting areas by size ...
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
...
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
WARNING: Area without centroid (may be OK for island)
22851 areas 0 mins 32 secs
Processing areas ... 22851 areas 0 mins 01 sec
Processing lines ... 80569 lines 0 mins 00 secs
Writing raster map ... 0 mins 00 secs
Creating support files for raster map ... 0 mins 00 secs

Raster map done.
Total processing time: 0 mins 36 secs

Best regards,
Priit Voolaid


--- Everyday reklaam---
Odavlennuga Stockholmi alates 550 kr! www.flynordic.com


More information about the grass-user mailing list