12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>233 / 310See AlsoST_IsSimple, ST_SimplifyPreserveTopology7.9.17 ST_SimplifyPreserveTopologyST_SimplifyPreserveTopology — Returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm.Will avoid creating derived geometries (polygons in particular) that are invalid.Synopsisgeometry ST_SimplifyPreserveTopology(geometry geomA, float tolerance);DescriptionReturns a "simplified" version of the given geometry using the Douglas-Peucker algorithm. Will avoid creating derived geometries(polygons in particular) that are invalid. Will actually do something only with (multi)lines and (multi)polygons butyou can safely call it with any kind of geometry. Since simplification occurs on a object-by-object basis you can also feed aGeometryCollection to this function.Performed by the GEOS module.NoteRequires GEOS 3.0.0+Availability: 1.3.3ExamplesSame example as Simplify, but we see Preserve Topology prevents oversimplification. The circle can at most become a square.SELECT ST_Npoints(the_geom) As np_before, ST_NPoints(ST_SimplifyPreserveTopology(the_geom ←↪,0.1)) As np01_notbadcircle, ST_NPoints(ST_SimplifyPreserveTopology(the_geom,0.5)) As ←↪np05_notquitecircle,ST_NPoints(ST_SimplifyPreserveTopology(the_geom,1)) As np1_octagon, ST_NPoints( ←↪ST_SimplifyPreserveTopology(the_geom,10)) As np10_square,ST_NPoints(ST_SimplifyPreserveTopology(the_geom,100)) As np100_stillsquareFROM (SELECT ST_Buffer(’POINT(1 3)’, 10,12) As the_geom) As foo;--result--np_before | np01_notbadcircle | np05_notquitecircle | np1_octagon | np10_square | ←↪np100_stillsquare-----------+-------------------+---------------------+-------------+---------------+-----------------49 | 33 | 17 | 9 | 5 | ←↪5See AlsoST_Simplify

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!