Database Reference
In-Depth Information
+---------------------------------------------------------
--+
13. Now, you can simplify the polygon geometries using the v.generalize
GRASS commandwithatolerance(threshold)of500meters.Ifyouareusing
the same dataset used in this recipe, you will end up with 47.191 vertices
from the original 346.914 vertices, composing 1.919 polygons (areas) from
the original 2.895 polygons:
GRASS 6.4.1 (postgis_cookbook):~ >
v.generalize input=states
output=states_generalized_from_grass
method=douglas threshold=500 -c
14. Export the results back to PostGIS using the v.out.ogr command (the
v.in.ogr counterpart), as follows:
GRASS 6.4.1 (postgis_cookbook):~ >
v.out.ogr
input=states_generalized_from_grass
type=area
dsn=PG:"dbname='postgis_cookbook'
user='me' password='mypassword'"
olayer=chp03.states_simplified_from_grass
format=PostgreSQL
15. Now,openaDesktopGIS andcheckfordifferencesbetweenthegeometry
simplification performed by the ST_SimplifyPreserveTopology
PostGISfunctionand GRASS .Thereshouldbenoholesoroverlapsatshared
polygon borders. In the following screenshot, the original layer boundaries
are in red, the boundaries built by ST_SimplifyPreserveTopology are
in blue, and those built by GRASS are in green:
Search WWH ::




Custom Search