Las siguientes funciones son las que probablemente necesite un usuario PortGIS . Existen otras funciones de soporte necesarias para los objetos PostGIS que no se usan por la mayoría de usuarios.
PostGIS ha comenzado una transición de la convención de nomenclatura existente, a una convención SQL-MM-céntrica. Como resultado, la mayoría de las funciones que conoces y adoras han sido renombradas usando el prefijo espacial estándar (ST). Funciones anteriores están todavía disponibles, aunque no se enumeran en este documento donde las funciones actualizadas son equivalentes. Las funciones no st_ no mencionadas en esta documentación están en desuso y se eliminarán en una versión futura de modo que DEJA DE UTILIZARLAS. |
Esta sección detalla los tipos de dato de PostgreSQL instalados por PostGIS. Note que describimos el comportamiento de la conversión de tipos en los casos en los que es muy importante, especialmente cuando se diseñe sis propias funciones.
Each data type describes its type casting behavior. A type cast converts values of one data type into another type. PostgreSQL allows defining casting behavior for custom types, along with the functions used to convert type values. Casts can have automatic behavior, which allows automatic conversion of a function argument to a type supported by the function.
Some casts have explicit behavior, which means the cast must be specified using the syntax CAST(myval As sometype)
or myval::sometype
. Explicit casting avoids the issue of ambiguous casts, which can occur when using an overloaded function which does not support a given type. For example, a function may accept a box2d or a box3d, but not a geometry. Since geometry has an automatic cast to both box types, this produces an "ambiguous function" error. To prevent the error use an explicit cast to the desired box type.
All data types can be cast to text
, so this does not need to be specified explicitly.
These functions assist in defining tables containing geometry columns.
geometry_dump
rows for the components of a geometry.
geometry_dump
filas para las coordenadas de una geometría.
geometry_dump
filas para los segmentos de una geometría.
geometry_dump
rows for the exterior and interior rings of a Polygon.
TRUE
si los puntos de inicio y final de una LINESTRING
son coincidentes. Para superficies poliedricas si son cerradas (volumetricas).
These functions create modified geometries by changing type, structure or vertices.
These functions test whether geometries are valid according to the OGC SFS standard. They also provide information about the nature and location of invalidity. There is also a function to create a valid geometry out of an invalid one.
valid_detail
row stating if a geometry is valid or if not a reason and a location.
These functions work with the Spatial Reference System of geometries as defined in the spatial_ref_sys
table.
These functions create geometry objects from various textual or binary formats.
LINESTRING
desde un WKB con el SRID dado
These functions convert geometry objects into various textual or binary formats.
TRUE
if A's 2D bounding box intersects B's 2D bounding box.
TRUE
if a geometry's (cached) 2D bounding box intersects a 2D float precision bounding box (BOX2DF).
TRUE
if a 2D float precision bounding box (BOX2DF) intersects a geometry's (cached) 2D bounding box.
TRUE
if two 2D float precision bounding boxes (BOX2DF) intersect each other.
TRUE
if A's n-D bounding box intersects B's n-D bounding box.
TRUE
if a geometry's (cached) n-D bounding box intersects a n-D float precision bounding box (GIDX).
TRUE
if a n-D float precision bounding box (GIDX) intersects a geometry's (cached) n-D bounding box.
TRUE
if two n-D float precision bounding boxes (GIDX) intersect each other.
TRUE
if A's bounding box overlaps or is to the left of B's.
TRUE
if A's bounding box overlaps or is below B's.
TRUE
if A' bounding box overlaps or is to the right of B's.
TRUE
if A's bounding box is strictly to the left of B's.
TRUE
if A's bounding box is strictly below B's.
TRUE
if the coordinates and coordinate order geometry/geography A are the same as the coordinates and coordinate order of geometry/geography B.
TRUE
if A's bounding box is strictly to the right of B's.
TRUE
if A's bounding box is contained by B's.
TRUE
if a geometry's 2D bounding box is contained into a 2D float precision bounding box (BOX2DF).
TRUE
if a 2D float precision bounding box (BOX2DF) is contained into a geometry's 2D bounding box.
TRUE
if a 2D float precision bounding box (BOX2DF) is contained into another 2D float precision bounding box.
TRUE
if A's bounding box overlaps or is above B's.
TRUE
if A's bounding box is strictly above B's.
TRUE
if A's bounding box contains B's.
TRUE
if a geometry's 2D bonding box contains a 2D float precision bounding box (GIDX).
TRUE
if a 2D float precision bounding box (BOX2DF) contains a geometry's 2D bonding box.
TRUE
if a 2D float precision bounding box (BOX2DF) contains another 2D float precision bounding box (BOX2DF).
TRUE
if A's bounding box is the same as B's.
These functions determine spatial relationships between geometries.
These functions compute measurements of distance, area and angles. There are also functions to compute geometry values determined by measurements.
ST_Length
ST_Perimeter
.
These functions compute results arising from the overlay of two geometries. These are also known as point-set theoretic boolean operations. Some related functions are also provided.
These functions compute geometric constructions, or alter geometry size or shape.
These functions operate on sets of polygonal geometry that form "implicit coverages". To form a valid coverage polygons must not overlap, and the vertices of adjacent edges must match exactly. Coverages are fast to process, and can be operated on with window functions, which retain the coverage topology inside the window partition while altering the edges.
Esta función modifica la posición y la forma de las geometrías usando transformación afín.
These functions implement clustering algorithms for sets of geometries.
These functions produce or operate on bounding boxes. They can also provide and accept geometry values, by using automatic or explicit casts.
See also Section 13.7, “PostGIS Box Functions”.
These functions support working with trajectories. A trajectory is a linear geometry with increasing measures (M value) on each coordinate. Spatio-temporal data can be modeled by using relative times (such as the epoch) as the measure values.
Esta función informa y actualiza versiones de PostGIS.
This section lists custom PostGIS Grand Unified Custom Variables (GUC). These can be set globally, by database, by session or by transaction. Best set at global or database level.
For more examples of usage refer to SQL SET and SQL ALTER SYSTEM
These functions are utilities for troubleshooting and repairing geometry data. They are only needed if the geometry data is corrupted in some way, which should never happen under normal circumstances.