Database Reference
In-Depth Information
simplification operations)
CREATE TABLE states_2163 AS SELECT
ST_Transform(the_geom,
2163)::geometry(MultiPolygon, 2163) AS
the_geom, state FROM states;
-- now decompose the geometries from
multipolygons to polygons (2895) using
the ST_Dump function
CREATE TABLE polygons AS SELECT
(ST_Dump(the_geom)).geom AS the_geom FROM
states_2163;
-- now decompose from polygons (2895) to
rings (3150) using the ST_DumpRings
function
CREATE TABLE rings AS SELECT
(ST_DumpRings(the_geom)).geom AS the_geom
FROM polygons;
-- now decompose from rings (3150) to
linestrings (3150) using the ST_Boundary
function
CREATE TABLE ringlines AS
SELECT(ST_boundary(the_geom)) AS the_geom
FROM rings;
-- now merge all linestrings (3150) in a
single merged linestring (this way
duplicate linestrings at polygon borders
disappear)
CREATE TABLE mergedringlines AS SELECT
ST_Union(the_geom) AS the_geom FROM
ringlines;
-- finally simplify the linestring with a
tolerance of 150 meters
CREATE TABLE simplified_ringlines AS
SELECT
ST_SimplifyPreserveTopology(the_geom,
150) AS the_geom FROM mergedringlines;
-- now compose a polygons collection from
the linestring using the ST_Polygonize
Search WWH ::




Custom Search