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>232 / 310SELECT ST_AsText(ST_Shift_Longitude(ST_GeomFromText(’LINESTRING(-118.58 38.38, -118.2038.45)’)))←↪st_astext----------LINESTRING(241.42 38.38,241.8 38.45)See AlsoST_GeomFromEWKT, ST_GeomFromText, ST_AsEWKT7.9.16 ST_SimplifyST_Simplify — Returns a "simplified" version of the given geometry using the Douglas-Peucker algorithm.Synopsisgeometry ST_Simplify(geometry geomA, float tolerance);DescriptionReturns a "simplified" version of the given geometry using the Douglas-Peucker algorithm. Will actually do something onlywith (multi)lines and (multi)polygons but you can safely call it with any kind of geometry. Since simplification occurs on aobject-by-object basis you can also feed a GeometryCollection to this function.NoteNote that returned geometry might loose its simplicity (see ST_IsSimple)NoteNote topology may not be preserved and may result in invalid geometries. Use (see ST_SimplifyPreserveTopology) topreserve topology.Performed by the GEOS module.Availability: 1.2.2ExamplesA circle simplified too much becomes a triangle, medium an octagon,SELECT ST_Npoints(the_geom) As np_before, ST_NPoints(ST_Simplify(the_geom,0.1)) As ←↪np01_notbadcircle, ST_NPoints(ST_Simplify(the_geom,0.5)) As np05_notquitecircle,ST_NPoints(ST_Simplify(the_geom,1)) As np1_octagon, ST_NPoints(ST_Simplify(the_geom,10)) As ←↪np10_triangle,(ST_Simplify(the_geom,100) is null) As np100_geometrygoesawayFROM (SELECT ST_Buffer(’POINT(1 3)’, 10,12) As the_geom) As foo;-resultnp_before | np01_notbadcircle | np05_notquitecircle | np1_octagon | np10_triangle | ←↪np100_geometrygoesaway-----------+-------------------+---------------------+-------------+---------------+-----------------49 | 33 | 17 | 9 | 4 | t

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

Saved successfully!

Ooh no, something went wrong!