Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1 Manual
237 / 315
Synopsis
geometry ST_Shift_Longitude(geometry geomA);
Description
Reads every point/vertex in every component of every feature in a geometry, and if the longitude coordinate is <0, adds 360 to it.
The result would be a 0-360 version of the data to be plotted in a 180 centric map
Note
This is only useful for data in long lat e.g. 4326 (WGS 84 long lat)
Pre-1.3.4 bug prevented this from working for MULTIPOINT. 1.3.4+ works with MULTIPOINT as well.
This function supports 3d and will not drop the z-index.
Examples
--3d points
SELECT ST_AsEWKT(ST_Shift_Longitude(ST_GeomFromEWKT(SRID=4326;POINT(-118.58 38.38 10)))) As geomA,
ST_AsEWKT(ST_Shift_Longitude(ST_GeomFromEWKT(SRID=4326;POINT(241.42 38.38 10)))) As geomb
geomA
geomB
-------------------SRID=4326;POINT(241.42 38.38 10) SRID=4326;POINT(-118.58 38.38 10)
--regular line string
SELECT ST_AsText(ST_Shift_Longitude(ST_GeomFromText(LINESTRING(-118.58 38.38, -118.20
38.45))))
st_astext
---------LINESTRING(241.42 38.38,241.8 38.45)
See Also
ST_GeomFromEWKT, ST_GeomFromText, ST_AsEWKT
7.9.16 ST_Simplify
Name
ST_Simplify Returns a "simplified" version of the given geometry using the Douglas-Peuker algorithm.
Synopsis
geometry ST_Simplify(geometry geomA, float tolerance);
Description
Returns a "simplified" version of the given geometry using the Douglas-Peuker algorithm. Will actually do something only
with (multi)lines and (multi)polygons but you can safely call it with any kind of geometry. Since simplification occurs on a
object-by-object basis you can also feed a GeometryCollection to this function.
Note
Note that returned geometry might loose its simplicity (see ST_IsSimple)
Note
Note topology may not be preserved and may result in invalid geometries. Use (see ST_SimplifyPreserveTopology) to
preserve topology.
Examples
A circle simplified too much becomes a triangle, medium an octagon,
33 |
17 |
9 |
4 | t
See Also
ST_IsSimple, ST_SimplifyPreserveTopology
7.9.17 ST_SimplifyPreserveTopology
Name
ST_SimplifyPreserveTopology Returns a "simplified" version of the given geometry using the Douglas-Peuker algorithm. Will
avoid creating derived geometries (polygons in particular) that are invalid.
Synopsis
geometry ST_SimplifyPreserveTopology(geometry geomA, float tolerance);