GRASS GIS - Konzistence vektorových dat: Porovnání verzí
mBez shrnutí editace |
mBez shrnutí editace |
||
Řádek 139: | Řádek 139: | ||
-------------------------------------------------- | -------------------------------------------------- | ||
</pre> | </pre> | ||
Po vyčištění dat již funkce dissolve funguje. | |||
[[Image:V_dissolve_obce.png|thumb|400px|center|Spojení polygonů na základě zvoleného atributu]] | |||
{{GRASS}} | {{GRASS}} |
Verze z 14. 10. 2009, 16:35
Data poskytovaná v netopologických formátech (např. ESRI Shapefile) často obsahují řadu chyb a ve výsledku jsou nekonzistentní. V systémech, které na topologickou čistotu dat nekladou příliš důraz (jako je např. ESRI ArcGIS) se tyto chyby v datech neprojeví. GRASS jako striktně topologický GIS tyto chyby v datech neignoruje. Např. po importu vrstvy 'obce' z balíčku dat pro 3.cvičení předmětu 153GIS1 se chyby v datech projeví při aplikaci funkce 'dissolve' (sjednocení vektorových prvků). Např.
v.in.ogr dsn=obce.shp output=obce
Number of nodes: 30138 Number of primitives: 43577 Number of points: 0 Number of lines: 0 Number of boundaries: 33456 Number of centroids: 10121 Number of areas: 13448 Number of isles: 9 Number of areas without centroid: 3327 ----------------------------------------------------- WARNING: 3742 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 6361 input polygons Total area: 7.891444e+10 (13448 areas) Overlapping area: 4.078277e+02 (3742 areas) Area without category: 3.879863e+02 (3327 areas)
v.dissolve input=obce output=cr column=pomoc

Vektorová mapa obsahuje překrývající se polygony.
v.category input=obce option=report
Layer/table: 1/obce type count min max point 0 0 0 line 0 0 0 boundary 0 0 0 centroid 13863 1 6249 area 0 0 0 face 0 0 0 kernel 0 0 0 all 13863 1 6249 Layer: 2 type count min max point 0 0 0 line 0 0 0 boundary 0 0 0 centroid 3742 2 2 area 0 0 0 face 0 0 0 kernel 0 0 0 all 3742 2 2
v.category input=obce output=obce3 layer=3 option=add
v.category input=obce3 option=report
Layer/table: 1/obce3 type count min max point 0 0 0 line 0 0 0 boundary 0 0 0 centroid 13863 1 6249 area 0 0 0 face 0 0 0 kernel 0 0 0 all 13863 1 6249 Layer: 3 type count min max point 0 0 0 line 0 0 0 boundary 0 0 0 centroid 10121 1 10121 area 0 0 0 face 0 0 0 kernel 0 0 0 all 10121 1 10121 Layer: 2 type count min max point 0 0 0 line 0 0 0 boundary 0 0 0 centroid 3742 2 2 area 0 0 0 face 0 0 0 kernel 0 0 0 all 3742 2 2
v.db.addtable map=obce3 layer=3 columns="cat integer, area double precision"
v.db.connect map=obce3 -p
Vector map <obce3@landa> is connected by: layer <1> table <obce3> in database </home/martin/grassdata/gis1/landa/dbf/> through driver <dbf> with key <cat> layer <3> table <obce3_3> in database </home/martin/grassdata/gis1/landa/dbf/> through driver <dbf> with key <cat>
v.to.db map=obce3 option=area columns=area layer=3
d.vect map=obce3 type=area
d.vect map=obce3 type=area layer=3 where="area < 10" fcolor=red color=red

v.clean input=obce output=obceX type=area tool=rmarea thresh=10
-------------------------------------------------- Tool: Remove small areas 7087 areas of total size 795.814 removed --------------------------------------------------
Po vyčištění dat již funkce dissolve funguje.
