CINXE.COM
Chapter 7. PostGIS Reference
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Chapter 7. PostGIS Reference</title> <link rel="stylesheet" type="text/css" href="../style.css"/> <meta name="generator" content="DocBook XSL Stylesheets V1.79.2"/> <link rel="prev" href="performance_tips.html" title="Chapter 6. Performance Tips"/> <link rel="next" href="box2d_type.html" title="box2d"/> </head> <body> <header> <div class="navheader"> <table style="width: 100%; "> <tr> <th style="text-align: center; " colspan="3">Chapter 7. PostGIS Reference</th> </tr> <tr> <td style="width: 20%; text-align: left; "><a accesskey="p" href="performance_tips.html">Prev</a> </td> <th style="width: 60%; text-align: center; "> </th> <td style="width: 20%; text-align: right; "> <a accesskey="n" href="box2d_type.html">Next</a></td> </tr> </table> </div> </header> <section class="chapter" id="reference"> <div class="titlepage"> <div> <div> <h1 class="title">Chapter 7. PostGIS Reference</h1> </div> </div> </div> <div class="toc"> <div class="toc-title">Table of Contents</div> <ul class="toc"> <li> <span class="section"> <a href="reference.html#PostGIS_Types">7.1. PostGIS Geometry/Geography/Box Data Types</a> </span> </li> <li> <span class="section"> <a href="reference.html#Management_Functions">7.2. Table Management Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#Geometry_Constructors">7.3. Geometry Constructors</a> </span> </li> <li> <span class="section"> <a href="reference.html#Geometry_Accessors">7.4. Geometry Accessors</a> </span> </li> <li> <span class="section"> <a href="reference.html#Geometry_Editors">7.5. Geometry Editors</a> </span> </li> <li> <span class="section"> <a href="reference.html#Geometry_Validation">7.6. Geometry Validation</a> </span> </li> <li> <span class="section"> <a href="reference.html#SRS_Functions">7.7. Spatial Reference System Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#Geometry_Inputs">7.8. Geometry Input</a> </span> </li> <li> <span class="section"> <a href="reference.html#Geometry_Outputs">7.9. Geometry Output</a> </span> </li> <li> <span class="section"> <a href="reference.html#Operators">7.10. Operators</a> </span> </li> <li> <span class="section"> <a href="reference.html#Spatial_Relationships">7.11. Spatial Relationships</a> </span> </li> <li> <span class="section"> <a href="reference.html#Measurement_Functions">7.12. Measurement Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#Overlay_Functions">7.13. Overlay Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#Geometry_Processing">7.14. Geometry Processing</a> </span> </li> <li> <span class="section"> <a href="reference.html#Coverage">7.15. Coverages</a> </span> </li> <li> <span class="section"> <a href="reference.html#Affine_Transformation">7.16. Affine Transformations</a> </span> </li> <li> <span class="section"> <a href="reference.html#Clustering_Functions">7.17. Clustering Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#BBox_Functions">7.18. Bounding Box Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#Linear_Referencing">7.19. Linear Referencing</a> </span> </li> <li> <span class="section"> <a href="reference.html#Temporal">7.20. Trajectory Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#Version_Functions">7.21. Version Functions</a> </span> </li> <li> <span class="section"> <a href="reference.html#PostGIS_GUC">7.22. Grand Unified Custom Variables (GUCs)</a> </span> </li> <li> <span class="section"> <a href="reference.html#Troubleshooting_Functions">7.23. Troubleshooting Functions</a> </span> </li> </ul> </div> <p>The functions given below are the ones which a user of PostGIS is likely to need. There are other functions which are required support functions to the PostGIS objects which are not of use to a general user.</p> <div class="note"> <table style="border: 0; "> <tr> <td style="text-align: center; vertical-align: top; width: 25px; " rowspan="2"> <img alt="[Note]" src="../images/note.png"/> </td> <th style="text-align: left; "/> </tr> <tr> <td style="text-align: left; vertical-align: top; "> <p>PostGIS has begun a transition from the existing naming convention to an SQL-MM-centric convention. As a result, most of the functions that you know and love have been renamed using the standard spatial type (ST) prefix. Previous functions are still available, though are not listed in this document where updated functions are equivalent. The non ST_ functions not listed in this documentation are deprecated and will be removed in a future release so STOP USING THEM.</p> </td> </tr> </table> </div> <section class="section" id="PostGIS_Types"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.1. PostGIS Geometry/Geography/Box Data Types</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>This section lists the custom PostgreSQL data types installed by PostGIS to represent spatial data. </p> <p>Each data type describes its type casting behavior. A <a class="link" href="https://www.postgresql.org/docs/current/sql-expressions.html#SQL-SYNTAX-TYPE-CASTS" target="_top">type cast</a> 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 <span class="bold"><strong>automatic</strong></span> behavior, which allows automatic conversion of a function argument to a type supported by the function.</p> <p> Some casts have <span class="bold"><strong>explicit</strong></span> behavior, which means the cast must be specified using the syntax <code class="varname">CAST(myval As sometype)</code> or <code class="varname">myval::sometype</code>. 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.</p> <p>All data types can be cast to <code class="varname">text</code>, so this does not need to be specified explicitly.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="box2d_type.html">box2d</a> </span> <span class="refpurpose"> — The type representing a 2-dimensional bounding box. </span> </li> <li> <span class="refentrytitle"> <a href="box3d_type.html">box3d</a> </span> <span class="refpurpose"> — The type representing a 3-dimensional bounding box. </span> </li> <li> <span class="refentrytitle"> <a href="geometry.html">geometry</a> </span> <span class="refpurpose"> — The type representing spatial features with planar coordinate systems.</span> </li> <li> <span class="refentrytitle"> <a href="geometry_dump.html">geometry_dump</a> </span> <span class="refpurpose"> — A composite type used to describe the parts of complex geometry.</span> </li> <li> <span class="refentrytitle"> <a href="geography.html">geography</a> </span> <span class="refpurpose"> — The type representing spatial features with geodetic (ellipsoidal) coordinate systems.</span> </li> </ul> </div> </section> <section class="section" id="Management_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.2. Table Management Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions assist in defining tables containing geometry columns. </p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="AddGeometryColumn.html">AddGeometryColumn</a> </span> <span class="refpurpose"> — Adds a geometry column to an existing table.</span> </li> <li> <span class="refentrytitle"> <a href="DropGeometryColumn.html">DropGeometryColumn</a> </span> <span class="refpurpose"> — Removes a geometry column from a spatial table.</span> </li> <li> <span class="refentrytitle"> <a href="DropGeometryTable.html">DropGeometryTable</a> </span> <span class="refpurpose"> — Drops a table and all its references in geometry_columns.</span> </li> <li> <span class="refentrytitle"> <a href="Find_SRID.html">Find_SRID</a> </span> <span class="refpurpose"> — Returns the SRID defined for a geometry column.</span> </li> <li> <span class="refentrytitle"> <a href="Populate_Geometry_Columns.html">Populate_Geometry_Columns</a> </span> <span class="refpurpose"> — Ensures geometry columns are defined with type modifiers or have appropriate spatial constraints.</span> </li> <li> <span class="refentrytitle"> <a href="UpdateGeometrySRID.html">UpdateGeometrySRID</a> </span> <span class="refpurpose"> — Updates the SRID of all features in a geometry column, and the table metadata. </span> </li> </ul> </div> </section> <section class="section" id="Geometry_Constructors"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.3. Geometry Constructors</h2> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_Collect.html">ST_Collect</a> </span> <span class="refpurpose"> — Creates a GeometryCollection or Multi* geometry from a set of geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineFromMultiPoint.html">ST_LineFromMultiPoint</a> </span> <span class="refpurpose"> — Creates a LineString from a MultiPoint geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MakeEnvelope.html">ST_MakeEnvelope</a> </span> <span class="refpurpose"> — Creates a rectangular Polygon from minimum and maximum coordinates.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MakeLine.html">ST_MakeLine</a> </span> <span class="refpurpose"> — Creates a LineString from Point, MultiPoint, or LineString geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MakePoint.html">ST_MakePoint</a> </span> <span class="refpurpose"> — Creates a 2D, 3DZ or 4D Point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MakePointM.html">ST_MakePointM</a> </span> <span class="refpurpose"> — Creates a Point from X, Y and M values.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MakePolygon.html">ST_MakePolygon</a> </span> <span class="refpurpose"> — Creates a Polygon from a shell and optional list of holes.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Point.html">ST_Point</a> </span> <span class="refpurpose"> — Creates a Point with X, Y and SRID values.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointZ.html">ST_PointZ</a> </span> <span class="refpurpose"> — Creates a Point with X, Y, Z and SRID values.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointM.html">ST_PointM</a> </span> <span class="refpurpose"> — Creates a Point with X, Y, M and SRID values.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointZM.html">ST_PointZM</a> </span> <span class="refpurpose"> — Creates a Point with X, Y, Z, M and SRID values.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Polygon.html">ST_Polygon</a> </span> <span class="refpurpose"> — Creates a Polygon from a LineString with a specified SRID.</span> </li> <li> <span class="refentrytitle"> <a href="ST_TileEnvelope.html">ST_TileEnvelope</a> </span> <span class="refpurpose"> — Creates a rectangular Polygon in Web Mercator (SRID:3857) using the XYZ tile system.</span> </li> <li> <span class="refentrytitle"> <a href="ST_HexagonGrid.html">ST_HexagonGrid</a> </span> <span class="refpurpose"> — Returns a set of hexagons and cell indices that completely cover the bounds of the geometry argument.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Hexagon.html">ST_Hexagon</a> </span> <span class="refpurpose"> — Returns a single hexagon, using the provided edge size and cell coordinate within the hexagon grid space.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SquareGrid.html">ST_SquareGrid</a> </span> <span class="refpurpose"> — Returns a set of grid squares and cell indices that completely cover the bounds of the geometry argument.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Square.html">ST_Square</a> </span> <span class="refpurpose"> — Returns a single square, using the provided edge size and cell coordinate within the square grid space.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Letters.html">ST_Letters</a> </span> <span class="refpurpose"> — Returns the input letters rendered as geometry with a default start position at the origin and default text height of 100.</span> </li> </ul> </div> </section> <section class="section" id="Geometry_Accessors"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.4. Geometry Accessors</h2> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="GeometryType.html">GeometryType</a> </span> <span class="refpurpose"> — Returns the type of a geometry as text.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Boundary.html">ST_Boundary</a> </span> <span class="refpurpose"> — Returns the boundary of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_BoundingDiagonal.html">ST_BoundingDiagonal</a> </span> <span class="refpurpose"> — Returns the diagonal of a geometry's bounding box.</span> </li> <li> <span class="refentrytitle"> <a href="ST_CoordDim.html">ST_CoordDim</a> </span> <span class="refpurpose"> — Return the coordinate dimension of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Dimension.html">ST_Dimension</a> </span> <span class="refpurpose"> — Returns the topological dimension of a geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Dump.html">ST_Dump</a> </span> <span class="refpurpose"> — Returns a set of <code class="varname">geometry_dump</code> rows for the components of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_DumpPoints.html">ST_DumpPoints</a> </span> <span class="refpurpose"> — Returns a set of <code class="varname">geometry_dump</code> rows for the coordinates in a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_DumpSegments.html">ST_DumpSegments</a> </span> <span class="refpurpose"> — Returns a set of <code class="varname">geometry_dump</code> rows for the segments in a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_DumpRings.html">ST_DumpRings</a> </span> <span class="refpurpose"> — Returns a set of <code class="varname">geometry_dump</code> rows for the exterior and interior rings of a Polygon.</span> </li> <li> <span class="refentrytitle"> <a href="ST_EndPoint.html">ST_EndPoint</a> </span> <span class="refpurpose"> — Returns the last point of a LineString or CircularLineString.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Envelope.html">ST_Envelope</a> </span> <span class="refpurpose"> — Returns a geometry representing the bounding box of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ExteriorRing.html">ST_ExteriorRing</a> </span> <span class="refpurpose"> — Returns a LineString representing the exterior ring of a Polygon. </span> </li> <li> <span class="refentrytitle"> <a href="ST_GeometryN.html">ST_GeometryN</a> </span> <span class="refpurpose"> — Return an element of a geometry collection.</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeometryType.html">ST_GeometryType</a> </span> <span class="refpurpose"> — Returns the SQL-MM type of a geometry as text.</span> </li> <li> <span class="refentrytitle"> <a href="ST_HasArc.html">ST_HasArc</a> </span> <span class="refpurpose"> — Tests if a geometry contains a circular arc</span> </li> <li> <span class="refentrytitle"> <a href="ST_InteriorRingN.html">ST_InteriorRingN</a> </span> <span class="refpurpose"> — Returns the Nth interior ring (hole) of a Polygon.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NumCurves.html">ST_NumCurves</a> </span> <span class="refpurpose"> — Return the number of component curves in a CompoundCurve.</span> </li> <li> <span class="refentrytitle"> <a href="ST_CurveN.html">ST_CurveN</a> </span> <span class="refpurpose"> — Returns the Nth component curve geometry of a CompoundCurve.</span> </li> <li> <span class="refentrytitle"> <a href="ST_IsClosed.html">ST_IsClosed</a> </span> <span class="refpurpose"> — Tests if a LineStrings's start and end points are coincident. For a PolyhedralSurface tests if it is closed (volumetric). </span> </li> <li> <span class="refentrytitle"> <a href="ST_IsCollection.html">ST_IsCollection</a> </span> <span class="refpurpose"> — Tests if a geometry is a geometry collection type.</span> </li> <li> <span class="refentrytitle"> <a href="ST_IsEmpty.html">ST_IsEmpty</a> </span> <span class="refpurpose"> — Tests if a geometry is empty.</span> </li> <li> <span class="refentrytitle"> <a href="ST_IsPolygonCCW.html"> ST_IsPolygonCCW </a> </span> <span class="refpurpose"> — Tests if Polygons have exterior rings oriented counter-clockwise and interior rings oriented clockwise. </span> </li> <li> <span class="refentrytitle"> <a href="ST_IsPolygonCW.html"> ST_IsPolygonCW </a> </span> <span class="refpurpose"> — Tests if Polygons have exterior rings oriented clockwise and interior rings oriented counter-clockwise. </span> </li> <li> <span class="refentrytitle"> <a href="ST_IsRing.html">ST_IsRing</a> </span> <span class="refpurpose"> — Tests if a LineString is closed and simple.</span> </li> <li> <span class="refentrytitle"> <a href="ST_IsSimple.html">ST_IsSimple</a> </span> <span class="refpurpose"> — Tests if a geometry has no points of self-intersection or self-tangency.</span> </li> <li> <span class="refentrytitle"> <a href="ST_M.html">ST_M</a> </span> <span class="refpurpose"> — Returns the M coordinate of a Point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MemSize.html">ST_MemSize</a> </span> <span class="refpurpose"> — Returns the amount of memory space a geometry takes.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NDims.html">ST_NDims</a> </span> <span class="refpurpose"> — Returns the coordinate dimension of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NPoints.html">ST_NPoints</a> </span> <span class="refpurpose"> — Returns the number of points (vertices) in a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NRings.html">ST_NRings</a> </span> <span class="refpurpose"> — Returns the number of rings in a polygonal geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NumGeometries.html">ST_NumGeometries</a> </span> <span class="refpurpose"> — Returns the number of elements in a geometry collection.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NumInteriorRings.html">ST_NumInteriorRings</a> </span> <span class="refpurpose"> — Returns the number of interior rings (holes) of a Polygon.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NumInteriorRing.html">ST_NumInteriorRing</a> </span> <span class="refpurpose"> — Returns the number of interior rings (holes) of a Polygon. Aias for ST_NumInteriorRings</span> </li> <li> <span class="refentrytitle"> <a href="ST_NumPatches.html">ST_NumPatches</a> </span> <span class="refpurpose"> — Return the number of faces on a Polyhedral Surface. Will return null for non-polyhedral geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_NumPoints.html">ST_NumPoints</a> </span> <span class="refpurpose"> — Returns the number of points in a LineString or CircularString.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PatchN.html">ST_PatchN</a> </span> <span class="refpurpose"> — Returns the Nth geometry (face) of a PolyhedralSurface.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointN.html">ST_PointN</a> </span> <span class="refpurpose"> — Returns the Nth point in the first LineString or circular LineString in a geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Points.html">ST_Points</a> </span> <span class="refpurpose"> — Returns a MultiPoint containing the coordinates of a geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_StartPoint.html">ST_StartPoint</a> </span> <span class="refpurpose"> — Returns the first point of a LineString.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Summary.html">ST_Summary</a> </span> <span class="refpurpose"> — Returns a text summary of the contents of a geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_X.html">ST_X</a> </span> <span class="refpurpose"> — Returns the X coordinate of a Point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Y.html">ST_Y</a> </span> <span class="refpurpose"> — Returns the Y coordinate of a Point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Z.html">ST_Z</a> </span> <span class="refpurpose"> — Returns the Z coordinate of a Point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Zmflag.html">ST_Zmflag</a> </span> <span class="refpurpose"> — Returns a code indicating the ZM coordinate dimension of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_HasZ.html">ST_HasZ</a> </span> <span class="refpurpose"> — Checks if a geometry has a Z dimension.</span> </li> <li> <span class="refentrytitle"> <a href="ST_HasM.html">ST_HasM</a> </span> <span class="refpurpose"> — Checks if a geometry has an M (measure) dimension.</span> </li> </ul> </div> </section> <section class="section" id="Geometry_Editors"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.5. Geometry Editors</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions create modified geometries by changing type, structure or vertices. </p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_AddPoint.html">ST_AddPoint</a> </span> <span class="refpurpose"> — Add a point to a LineString.</span> </li> <li> <span class="refentrytitle"> <a href="ST_CollectionExtract.html">ST_CollectionExtract</a> </span> <span class="refpurpose"> — Given a geometry collection, returns a multi-geometry containing only elements of a specified type. </span> </li> <li> <span class="refentrytitle"> <a href="ST_CollectionHomogenize.html">ST_CollectionHomogenize</a> </span> <span class="refpurpose"> — Returns the simplest representation of a geometry collection. </span> </li> <li> <span class="refentrytitle"> <a href="ST_CurveToLine.html">ST_CurveToLine</a> </span> <span class="refpurpose"> — Converts a geometry containing curves to a linear geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Scroll.html">ST_Scroll</a> </span> <span class="refpurpose"> — Change start point of a closed LineString.</span> </li> <li> <span class="refentrytitle"> <a href="ST_FlipCoordinates.html">ST_FlipCoordinates</a> </span> <span class="refpurpose"> — Returns a version of a geometry with X and Y axis flipped. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Force2D.html">ST_Force2D</a> </span> <span class="refpurpose"> — Force the geometries into a "2-dimensional mode".</span> </li> <li> <span class="refentrytitle"> <a href="ST_Force_3D.html">ST_Force3D</a> </span> <span class="refpurpose"> — Force the geometries into XYZ mode. This is an alias for ST_Force3DZ.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Force_3DZ.html">ST_Force3DZ</a> </span> <span class="refpurpose"> — Force the geometries into XYZ mode.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Force_3DM.html">ST_Force3DM</a> </span> <span class="refpurpose"> — Force the geometries into XYM mode.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Force_4D.html">ST_Force4D</a> </span> <span class="refpurpose"> — Force the geometries into XYZM mode. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Force_Collection.html">ST_ForceCollection</a> </span> <span class="refpurpose"> — Convert the geometry into a GEOMETRYCOLLECTION.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ForceCurve.html">ST_ForceCurve</a> </span> <span class="refpurpose"> — Upcast a geometry into its curved type, if applicable.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ForcePolygonCCW.html"> ST_ForcePolygonCCW </a> </span> <span class="refpurpose"> — Orients all exterior rings counter-clockwise and all interior rings clockwise. </span> </li> <li> <span class="refentrytitle"> <a href="ST_ForcePolygonCW.html"> ST_ForcePolygonCW </a> </span> <span class="refpurpose"> — Orients all exterior rings clockwise and all interior rings counter-clockwise. </span> </li> <li> <span class="refentrytitle"> <a href="ST_ForceSFS.html">ST_ForceSFS</a> </span> <span class="refpurpose"> — Force the geometries to use SFS 1.1 geometry types only.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ForceRHR.html">ST_ForceRHR</a> </span> <span class="refpurpose"> — Force the orientation of the vertices in a polygon to follow the Right-Hand-Rule.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineExtend.html">ST_LineExtend</a> </span> <span class="refpurpose"> — Returns a line extended forwards and backwards by specified distances.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineToCurve.html">ST_LineToCurve</a> </span> <span class="refpurpose"> — Converts a linear geometry to a curved geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Multi.html">ST_Multi</a> </span> <span class="refpurpose"> — Return the geometry as a MULTI* geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Normalize.html">ST_Normalize</a> </span> <span class="refpurpose"> — Return the geometry in its canonical form.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Project.html">ST_Project</a> </span> <span class="refpurpose"> — Returns a point projected from a start point by a distance and bearing (azimuth).</span> </li> <li> <span class="refentrytitle"> <a href="ST_QuantizeCoordinates.html"> ST_QuantizeCoordinates </a> </span> <span class="refpurpose"> — Sets least significant bits of coordinates to zero </span> </li> <li> <span class="refentrytitle"> <a href="ST_RemovePoint.html">ST_RemovePoint</a> </span> <span class="refpurpose"> — Remove a point from a linestring.</span> </li> <li> <span class="refentrytitle"> <a href="ST_RemoveRepeatedPoints.html">ST_RemoveRepeatedPoints</a> </span> <span class="refpurpose"> — Returns a version of a geometry with duplicate points removed.</span> </li> <li> <span class="refentrytitle"> <a href="ST_RemoveIrrelevantPointsForView.html">ST_RemoveIrrelevantPointsForView</a> </span> <span class="refpurpose"> — Removes points that are irrelevant for rendering a specific rectangluar view of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_RemoveSmallParts.html">ST_RemoveSmallParts</a> </span> <span class="refpurpose"> — Removes small parts (polygon rings or linestrings) of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Reverse.html">ST_Reverse</a> </span> <span class="refpurpose"> — Return the geometry with vertex order reversed.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Segmentize.html">ST_Segmentize</a> </span> <span class="refpurpose"> — Returns a modified geometry/geography having no segment longer than a given distance.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SetPoint.html">ST_SetPoint</a> </span> <span class="refpurpose"> — Replace point of a linestring with a given point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ShiftLongitude.html">ST_ShiftLongitude</a> </span> <span class="refpurpose"> — Shifts the longitude coordinates of a geometry between -180..180 and 0..360.</span> </li> <li> <span class="refentrytitle"> <a href="ST_WrapX.html">ST_WrapX</a> </span> <span class="refpurpose"> — Wrap a geometry around an X value.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SnapToGrid.html">ST_SnapToGrid</a> </span> <span class="refpurpose"> — Snap all points of the input geometry to a regular grid. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Snap.html">ST_Snap</a> </span> <span class="refpurpose"> — Snap segments and vertices of input geometry to vertices of a reference geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_SwapOrdinates.html">ST_SwapOrdinates</a> </span> <span class="refpurpose"> — Returns a version of the given geometry with given ordinate values swapped. </span> </li> </ul> </div> </section> <section class="section" id="Geometry_Validation"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.6. Geometry Validation</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>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. </p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_IsValid.html">ST_IsValid</a> </span> <span class="refpurpose"> — Tests if a geometry is well-formed in 2D. </span> </li> <li> <span class="refentrytitle"> <a href="ST_IsValidDetail.html">ST_IsValidDetail</a> </span> <span class="refpurpose"> — Returns a <code class="varname">valid_detail</code> row stating if a geometry is valid or if not a reason and a location.</span> </li> <li> <span class="refentrytitle"> <a href="ST_IsValidReason.html">ST_IsValidReason</a> </span> <span class="refpurpose"> — Returns text stating if a geometry is valid, or a reason for invalidity.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MakeValid.html">ST_MakeValid</a> </span> <span class="refpurpose"> — Attempts to make an invalid geometry valid without losing vertices.</span> </li> </ul> </div> </section> <section class="section" id="SRS_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.7. Spatial Reference System Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions work with the Spatial Reference System of geometries as defined in the <code class="varname">spatial_ref_sys</code> table.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_InverseTransformPipeline.html">ST_InverseTransformPipeline</a> </span> <span class="refpurpose"> — Return a new geometry with coordinates transformed to a different spatial reference system using the inverse of a defined coordinate transformation pipeline.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SetSRID.html">ST_SetSRID</a> </span> <span class="refpurpose"> — Set the SRID on a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SRID.html">ST_SRID</a> </span> <span class="refpurpose"> — Returns the spatial reference identifier for a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Transform.html">ST_Transform</a> </span> <span class="refpurpose"> — Return a new geometry with coordinates transformed to a different spatial reference system.</span> </li> <li> <span class="refentrytitle"> <a href="ST_TransformPipeline.html">ST_TransformPipeline</a> </span> <span class="refpurpose"> — Return a new geometry with coordinates transformed to a different spatial reference system using a defined coordinate transformation pipeline.</span> </li> <li> <span class="refentrytitle"> <a href="postgis_srs_codes.html">postgis_srs_codes</a> </span> <span class="refpurpose"> — Return the list of SRS codes associated with the given authority.</span> </li> <li> <span class="refentrytitle"> <a href="postgis_srs.html">postgis_srs</a> </span> <span class="refpurpose"> — Return a metadata record for the requested authority and srid.</span> </li> <li> <span class="refentrytitle"> <a href="postgis_srs_all.html">postgis_srs_all</a> </span> <span class="refpurpose"> — Return metadata records for every spatial reference system in the underlying Proj database.</span> </li> <li> <span class="refentrytitle"> <a href="postgis_srs_search.html">postgis_srs_search</a> </span> <span class="refpurpose"> — Return metadata records for projected coordinate systems that have areas of usage that fully contain the bounds parameter.</span> </li> </ul> </div> </section> <section class="section" id="Geometry_Inputs"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.8. Geometry Input</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions create geometry objects from various textual or binary formats.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="section"> <a href="reference.html#idm8787">7.8.1. Well-Known Text (WKT)</a> </span> </li> <li> <span class="section"> <a href="reference.html#idm9419">7.8.2. Well-Known Binary (WKB)</a> </span> </li> <li> <span class="section"> <a href="reference.html#idm9739">7.8.3. Other Formats</a> </span> </li> </ul> </div> <section class="section" id="idm8787"> <div class="titlepage"> <div> <div> <h3 class="title">7.8.1. Well-Known Text (WKT)</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_BdPolyFromText.html">ST_BdPolyFromText</a> </span> <span class="refpurpose"> — Construct a Polygon given an arbitrary collection of closed linestrings as a MultiLineString Well-Known text representation.</span> </li> <li> <span class="refentrytitle"> <a href="ST_BdMPolyFromText.html">ST_BdMPolyFromText</a> </span> <span class="refpurpose"> — Construct a MultiPolygon given an arbitrary collection of closed linestrings as a MultiLineString text representation Well-Known text representation.</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeogFromText.html">ST_GeogFromText</a> </span> <span class="refpurpose"> — Return a specified geography value from Well-Known Text representation or extended (WKT). </span> </li> <li> <span class="refentrytitle"> <a href="ST_GeographyFromText.html">ST_GeographyFromText</a> </span> <span class="refpurpose"> — Return a specified geography value from Well-Known Text representation or extended (WKT). </span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomCollFromText.html">ST_GeomCollFromText</a> </span> <span class="refpurpose"> — Makes a collection Geometry from collection WKT with the given SRID. If SRID is not given, it defaults to 0.</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromEWKT.html">ST_GeomFromEWKT</a> </span> <span class="refpurpose"> — Return a specified ST_Geometry value from Extended Well-Known Text representation (EWKT).</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromMARC21.html">ST_GeomFromMARC21</a> </span> <span class="refpurpose"> — Takes MARC21/XML geographic data as input and returns a PostGIS geometry object. </span> </li> <li> <span class="refentrytitle"> <a href="ST_GeometryFromText.html">ST_GeometryFromText</a> </span> <span class="refpurpose"> — Return a specified ST_Geometry value from Well-Known Text representation (WKT). This is an alias name for ST_GeomFromText</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromText.html">ST_GeomFromText</a> </span> <span class="refpurpose"> — Return a specified ST_Geometry value from Well-Known Text representation (WKT).</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineFromText.html">ST_LineFromText</a> </span> <span class="refpurpose"> — Makes a Geometry from WKT representation with the given SRID. If SRID is not given, it defaults to 0.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MLineFromText.html">ST_MLineFromText</a> </span> <span class="refpurpose"> — Return a specified ST_MultiLineString value from WKT representation.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MPointFromText.html">ST_MPointFromText</a> </span> <span class="refpurpose"> — Makes a Geometry from WKT with the given SRID. If SRID is not given, it defaults to 0.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MPolyFromText.html">ST_MPolyFromText</a> </span> <span class="refpurpose"> — Makes a MultiPolygon Geometry from WKT with the given SRID. If SRID is not given, it defaults to 0.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointFromText.html">ST_PointFromText</a> </span> <span class="refpurpose"> — Makes a point Geometry from WKT with the given SRID. If SRID is not given, it defaults to unknown.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PolygonFromText.html">ST_PolygonFromText</a> </span> <span class="refpurpose"> — Makes a Geometry from WKT with the given SRID. If SRID is not given, it defaults to 0.</span> </li> <li> <span class="refentrytitle"> <a href="ST_WKTToSQL.html">ST_WKTToSQL</a> </span> <span class="refpurpose"> — Return a specified ST_Geometry value from Well-Known Text representation (WKT). This is an alias name for ST_GeomFromText</span> </li> </ul> </div> </section> <section class="section" id="idm9419"> <div class="titlepage"> <div> <div> <h3 class="title">7.8.2. Well-Known Binary (WKB)</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_GeogFromWKB.html">ST_GeogFromWKB</a> </span> <span class="refpurpose"> — Creates a geography instance from a Well-Known Binary geometry representation (WKB) or extended Well Known Binary (EWKB).</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromEWKB.html">ST_GeomFromEWKB</a> </span> <span class="refpurpose"> — Return a specified ST_Geometry value from Extended Well-Known Binary representation (EWKB).</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromWKB.html">ST_GeomFromWKB</a> </span> <span class="refpurpose"> — Creates a geometry instance from a Well-Known Binary geometry representation (WKB) and optional SRID.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineFromWKB.html">ST_LineFromWKB</a> </span> <span class="refpurpose"> — Makes a <code class="varname">LINESTRING</code> from WKB with the given SRID</span> </li> <li> <span class="refentrytitle"> <a href="ST_LinestringFromWKB.html">ST_LinestringFromWKB</a> </span> <span class="refpurpose"> — Makes a geometry from WKB with the given SRID.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointFromWKB.html">ST_PointFromWKB</a> </span> <span class="refpurpose"> — Makes a geometry from WKB with the given SRID</span> </li> <li> <span class="refentrytitle"> <a href="ST_WKBToSQL.html">ST_WKBToSQL</a> </span> <span class="refpurpose"> — Return a specified ST_Geometry value from Well-Known Binary representation (WKB). This is an alias name for ST_GeomFromWKB that takes no srid</span> </li> </ul> </div> </section> <section class="section" id="idm9739"> <div class="titlepage"> <div> <div> <h3 class="title">7.8.3. Other Formats</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_Box2dFromGeoHash.html">ST_Box2dFromGeoHash</a> </span> <span class="refpurpose"> — Return a BOX2D from a GeoHash string.</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromGeoHash.html">ST_GeomFromGeoHash</a> </span> <span class="refpurpose"> — Return a geometry from a GeoHash string.</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromGML.html">ST_GeomFromGML</a> </span> <span class="refpurpose"> — Takes as input GML representation of geometry and outputs a PostGIS geometry object</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromGeoJSON.html">ST_GeomFromGeoJSON</a> </span> <span class="refpurpose"> — Takes as input a geojson representation of a geometry and outputs a PostGIS geometry object</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromKML.html">ST_GeomFromKML</a> </span> <span class="refpurpose"> — Takes as input KML representation of geometry and outputs a PostGIS geometry object</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeomFromTWKB.html">ST_GeomFromTWKB</a> </span> <span class="refpurpose"> — Creates a geometry instance from a TWKB ("Tiny Well-Known Binary") geometry representation.</span> </li> <li> <span class="refentrytitle"> <a href="ST_GMLToSQL.html">ST_GMLToSQL</a> </span> <span class="refpurpose"> — Return a specified ST_Geometry value from GML representation. This is an alias name for ST_GeomFromGML</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineFromEncodedPolyline.html">ST_LineFromEncodedPolyline</a> </span> <span class="refpurpose"> — Creates a LineString from an Encoded Polyline.</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointFromGeoHash.html">ST_PointFromGeoHash</a> </span> <span class="refpurpose"> — Return a point from a GeoHash string.</span> </li> <li> <span class="refentrytitle"> <a href="ST_FromFlatGeobufToTable.html">ST_FromFlatGeobufToTable</a> </span> <span class="refpurpose"> — Creates a table based on the structure of FlatGeobuf data.</span> </li> <li> <span class="refentrytitle"> <a href="ST_FromFlatGeobuf.html">ST_FromFlatGeobuf</a> </span> <span class="refpurpose"> — Reads FlatGeobuf data.</span> </li> </ul> </div> </section> </section> <section class="section" id="Geometry_Outputs"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.9. Geometry Output</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions convert geometry objects into various textual or binary formats.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="section"> <a href="reference.html#idm10138">7.9.1. Well-Known Text (WKT)</a> </span> </li> <li> <span class="section"> <a href="reference.html#idm10306">7.9.2. Well-Known Binary (WKB)</a> </span> </li> <li> <span class="section"> <a href="reference.html#idm10496">7.9.3. Other Formats</a> </span> </li> </ul> </div> <section class="section" id="idm10138"> <div class="titlepage"> <div> <div> <h3 class="title">7.9.1. Well-Known Text (WKT)</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_AsEWKT.html">ST_AsEWKT</a> </span> <span class="refpurpose"> — Return the Well-Known Text (WKT) representation of the geometry with SRID meta data.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsText.html">ST_AsText</a> </span> <span class="refpurpose"> — Return the Well-Known Text (WKT) representation of the geometry/geography without SRID metadata.</span> </li> </ul> </div> </section> <section class="section" id="idm10306"> <div class="titlepage"> <div> <div> <h3 class="title">7.9.2. Well-Known Binary (WKB)</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_AsBinary.html">ST_AsBinary</a> </span> <span class="refpurpose"> — Return the OGC/ISO Well-Known Binary (WKB) representation of the geometry/geography without SRID meta data.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsEWKB.html">ST_AsEWKB</a> </span> <span class="refpurpose"> — Return the Extended Well-Known Binary (EWKB) representation of the geometry with SRID meta data.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsHEXEWKB.html">ST_AsHEXEWKB</a> </span> <span class="refpurpose"> — Returns a Geometry in HEXEWKB format (as text) using either little-endian (NDR) or big-endian (XDR) encoding.</span> </li> </ul> </div> </section> <section class="section" id="idm10496"> <div class="titlepage"> <div> <div> <h3 class="title">7.9.3. Other Formats</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_AsEncodedPolyline.html">ST_AsEncodedPolyline</a> </span> <span class="refpurpose"> — Returns an Encoded Polyline from a LineString geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsFlatGeobuf.html">ST_AsFlatGeobuf</a> </span> <span class="refpurpose"> — Return a FlatGeobuf representation of a set of rows.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsGeobuf.html">ST_AsGeobuf</a> </span> <span class="refpurpose"> — Return a Geobuf representation of a set of rows.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsGeoJSON.html">ST_AsGeoJSON</a> </span> <span class="refpurpose"> — Return a geometry or feature in GeoJSON format.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsGML.html">ST_AsGML</a> </span> <span class="refpurpose"> — Return the geometry as a GML version 2 or 3 element.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsKML.html">ST_AsKML</a> </span> <span class="refpurpose"> — Return the geometry as a KML element.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsLatLonText.html">ST_AsLatLonText</a> </span> <span class="refpurpose"> — Return the Degrees, Minutes, Seconds representation of the given point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsMARC21.html">ST_AsMARC21</a> </span> <span class="refpurpose"> — Returns geometry as a MARC21/XML record with a geographic datafield (034).</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsMVTGeom.html">ST_AsMVTGeom</a> </span> <span class="refpurpose"> — Transforms a geometry into the coordinate space of a MVT tile.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsMVT.html">ST_AsMVT</a> </span> <span class="refpurpose"> — Aggregate function returning a MVT representation of a set of rows.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsSVG.html">ST_AsSVG</a> </span> <span class="refpurpose"> — Returns SVG path data for a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsTWKB.html">ST_AsTWKB</a> </span> <span class="refpurpose"> — Returns the geometry as TWKB, aka "Tiny Well-Known Binary"</span> </li> <li> <span class="refentrytitle"> <a href="ST_AsX3D.html">ST_AsX3D</a> </span> <span class="refpurpose"> — Returns a Geometry in X3D xml node element format: ISO-IEC-19776-1.2-X3DEncodings-XML</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeoHash.html">ST_GeoHash</a> </span> <span class="refpurpose"> — Return a GeoHash representation of the geometry.</span> </li> </ul> </div> </section> </section> <section class="section" id="Operators"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.10. Operators</h2> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="section"> <a href="reference.html#operators-bbox">7.10.1. Bounding Box Operators</a> </span> </li> <li> <span class="section"> <a href="reference.html#operators-distance">7.10.2. Distance Operators</a> </span> </li> </ul> </div> <section class="section" id="operators-bbox"> <div class="titlepage"> <div> <div> <h3 class="title">7.10.1. Bounding Box Operators</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="geometry_overlaps.html">&&</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's 2D bounding box intersects B's 2D bounding box.</span> </li> <li> <span class="refentrytitle"> <a href="overlaps_geometry_box2df.html">&&(geometry,box2df)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a geometry's (cached) 2D bounding box intersects a 2D float precision bounding box (BOX2DF).</span> </li> <li> <span class="refentrytitle"> <a href="overlaps_box2df_geometry.html">&&(box2df,geometry)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a 2D float precision bounding box (BOX2DF) intersects a geometry's (cached) 2D bounding box.</span> </li> <li> <span class="refentrytitle"> <a href="overlaps_box2df_box2df.html">&&(box2df,box2df)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if two 2D float precision bounding boxes (BOX2DF) intersect each other.</span> </li> <li> <span class="refentrytitle"> <a href="geometry_overlaps_nd.html">&&&</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's n-D bounding box intersects B's n-D bounding box.</span> </li> <li> <span class="refentrytitle"> <a href="overlaps_nd_geometry_gidx.html">&&&(geometry,gidx)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a geometry's (cached) n-D bounding box intersects a n-D float precision bounding box (GIDX).</span> </li> <li> <span class="refentrytitle"> <a href="overlaps_nd_gidx_geometry.html">&&&(gidx,geometry)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a n-D float precision bounding box (GIDX) intersects a geometry's (cached) n-D bounding box.</span> </li> <li> <span class="refentrytitle"> <a href="overlaps_nd_gidx_gidx.html">&&&(gidx,gidx)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if two n-D float precision bounding boxes (GIDX) intersect each other.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Overleft.html">&<</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box overlaps or is to the left of B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Overbelow.html">&<|</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box overlaps or is below B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Overright.html">&></a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A' bounding box overlaps or is to the right of B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Left.html"><<</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box is strictly to the left of B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Below.html"><<|</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box is strictly below B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_EQ.html">=</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if the coordinates and coordinate order geometry/geography A are the same as the coordinates and coordinate order of geometry/geography B.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Right.html">>></a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box is strictly to the right of B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Contained.html">@</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box is contained by B's.</span> </li> <li> <span class="refentrytitle"> <a href="is_contained_geometry_box2df.html">@(geometry,box2df)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a geometry's 2D bounding box is contained into a 2D float precision bounding box (BOX2DF).</span> </li> <li> <span class="refentrytitle"> <a href="is_contained_box2df_geometry.html">@(box2df,geometry)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a 2D float precision bounding box (BOX2DF) is contained into a geometry's 2D bounding box.</span> </li> <li> <span class="refentrytitle"> <a href="is_contained_box2df_box2df.html">@(box2df,box2df)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a 2D float precision bounding box (BOX2DF) is contained into another 2D float precision bounding box.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Overabove.html">|&></a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box overlaps or is above B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Above.html">|>></a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box is strictly above B's.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Contain.html">~</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box contains B's.</span> </li> <li> <span class="refentrytitle"> <a href="contains_geometry_box2df.html">~(geometry,box2df)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a geometry's 2D bonding box contains a 2D float precision bounding box (GIDX).</span> </li> <li> <span class="refentrytitle"> <a href="contains_box2df_geometry.html">~(box2df,geometry)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a 2D float precision bounding box (BOX2DF) contains a geometry's 2D bonding box.</span> </li> <li> <span class="refentrytitle"> <a href="contains_box2df_box2df.html">~(box2df,box2df)</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if a 2D float precision bounding box (BOX2DF) contains another 2D float precision bounding box (BOX2DF).</span> </li> <li> <span class="refentrytitle"> <a href="ST_Geometry_Same.html">~=</a> </span> <span class="refpurpose"> — Returns <code class="varname">TRUE</code> if A's bounding box is the same as B's.</span> </li> </ul> </div> </section> <section class="section" id="operators-distance"> <div class="titlepage"> <div> <div> <h3 class="title">7.10.2. Distance Operators</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="geometry_distance_knn.html"><-></a> </span> <span class="refpurpose"> — Returns the 2D distance between A and B. </span> </li> <li> <span class="refentrytitle"> <a href="geometry_distance_cpa.html">|=|</a> </span> <span class="refpurpose"> — Returns the distance between A and B trajectories at their closest point of approach. </span> </li> <li> <span class="refentrytitle"> <a href="geometry_distance_box.html"><#></a> </span> <span class="refpurpose"> — Returns the 2D distance between A and B bounding boxes. </span> </li> <li> <span class="refentrytitle"> <a href="geometry_distance_centroid_nd.html"><<->></a> </span> <span class="refpurpose"> — Returns the n-D distance between the A and B geometries or bounding boxes </span> </li> </ul> </div> </section> </section> <section class="section" id="Spatial_Relationships"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.11. Spatial Relationships</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions determine spatial relationships between geometries.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="section"> <a href="reference.html#idm12750">7.11.1. Topological Relationships</a> </span> </li> <li> <span class="section"> <a href="reference.html#idm14028">7.11.2. Distance Relationships</a> </span> </li> </ul> </div> <section class="section" id="idm12750"> <div class="titlepage"> <div> <div> <h3 class="title">7.11.1. Topological Relationships</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_3DIntersects.html">ST_3DIntersects</a> </span> <span class="refpurpose"> — Tests if two geometries spatially intersect in 3D - only for points, linestrings, polygons, polyhedral surface (area) </span> </li> <li> <span class="refentrytitle"> <a href="ST_Contains.html">ST_Contains</a> </span> <span class="refpurpose"> — Tests if every point of B lies in A, and their interiors have a point in common</span> </li> <li> <span class="refentrytitle"> <a href="ST_ContainsProperly.html">ST_ContainsProperly</a> </span> <span class="refpurpose"> — Tests if every point of B lies in the interior of A</span> </li> <li> <span class="refentrytitle"> <a href="ST_CoveredBy.html">ST_CoveredBy</a> </span> <span class="refpurpose"> — Tests if every point of A lies in B</span> </li> <li> <span class="refentrytitle"> <a href="ST_Covers.html">ST_Covers</a> </span> <span class="refpurpose"> — Tests if every point of B lies in A</span> </li> <li> <span class="refentrytitle"> <a href="ST_Crosses.html">ST_Crosses</a> </span> <span class="refpurpose"> — Tests if two geometries have some, but not all, interior points in common</span> </li> <li> <span class="refentrytitle"> <a href="ST_Disjoint.html">ST_Disjoint</a> </span> <span class="refpurpose"> — Tests if two geometries have no points in common </span> </li> <li> <span class="refentrytitle"> <a href="ST_Equals.html">ST_Equals</a> </span> <span class="refpurpose"> — Tests if two geometries include the same set of points</span> </li> <li> <span class="refentrytitle"> <a href="ST_Intersects.html">ST_Intersects</a> </span> <span class="refpurpose"> — Tests if two geometries intersect (they have at least one point in common)</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineCrossingDirection.html">ST_LineCrossingDirection</a> </span> <span class="refpurpose"> — Returns a number indicating the crossing behavior of two LineStrings</span> </li> <li> <span class="refentrytitle"> <a href="ST_OrderingEquals.html">ST_OrderingEquals</a> </span> <span class="refpurpose"> — Tests if two geometries represent the same geometry and have points in the same directional order</span> </li> <li> <span class="refentrytitle"> <a href="ST_Overlaps.html">ST_Overlaps</a> </span> <span class="refpurpose"> — Tests if two geometries have the same dimension and intersect, but each has at least one point not in the other</span> </li> <li> <span class="refentrytitle"> <a href="ST_Relate.html">ST_Relate</a> </span> <span class="refpurpose"> — Tests if two geometries have a topological relationship matching an Intersection Matrix pattern, or computes their Intersection Matrix </span> </li> <li> <span class="refentrytitle"> <a href="ST_RelateMatch.html">ST_RelateMatch</a> </span> <span class="refpurpose"> — Tests if a DE-9IM Intersection Matrix matches an Intersection Matrix pattern </span> </li> <li> <span class="refentrytitle"> <a href="ST_Touches.html">ST_Touches</a> </span> <span class="refpurpose"> — Tests if two geometries have at least one point in common, but their interiors do not intersect</span> </li> <li> <span class="refentrytitle"> <a href="ST_Within.html">ST_Within</a> </span> <span class="refpurpose"> — Tests if every point of A lies in B, and their interiors have a point in common</span> </li> </ul> </div> </section> <section class="section" id="idm14028"> <div class="titlepage"> <div> <div> <h3 class="title">7.11.2. Distance Relationships</h3> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_3DDWithin.html">ST_3DDWithin</a> </span> <span class="refpurpose"> — Tests if two 3D geometries are within a given 3D distance</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DDFullyWithin.html">ST_3DDFullyWithin</a> </span> <span class="refpurpose"> — Tests if two 3D geometries are entirely within a given 3D distance</span> </li> <li> <span class="refentrytitle"> <a href="ST_DFullyWithin.html">ST_DFullyWithin</a> </span> <span class="refpurpose"> — Tests if a geometry is entirely inside a distance of another</span> </li> <li> <span class="refentrytitle"> <a href="ST_DWithin.html">ST_DWithin</a> </span> <span class="refpurpose"> — Tests if two geometries are within a given distance</span> </li> <li> <span class="refentrytitle"> <a href="ST_PointInsideCircle.html">ST_PointInsideCircle</a> </span> <span class="refpurpose"> — Tests if a point geometry is inside a circle defined by a center and radius</span> </li> </ul> </div> </section> </section> <section class="section" id="Measurement_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.12. Measurement Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions compute measurements of distance, area and angles. There are also functions to compute geometry values determined by measurements.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_Area.html">ST_Area</a> </span> <span class="refpurpose"> — Returns the area of a polygonal geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Azimuth.html">ST_Azimuth</a> </span> <span class="refpurpose"> — Returns the north-based azimuth of a line between two points.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Angle.html">ST_Angle</a> </span> <span class="refpurpose"> — Returns the angle between two vectors defined by 3 or 4 points, or 2 lines.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ClosestPoint.html">ST_ClosestPoint</a> </span> <span class="refpurpose"> — Returns the 2D point on g1 that is closest to g2. This is the first point of the shortest line from one geometry to the other.</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DClosestPoint.html">ST_3DClosestPoint</a> </span> <span class="refpurpose"> — Returns the 3D point on g1 that is closest to g2. This is the first point of the 3D shortest line. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Distance.html">ST_Distance</a> </span> <span class="refpurpose"> — Returns the distance between two geometry or geography values.</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DDistance.html">ST_3DDistance</a> </span> <span class="refpurpose"> — Returns the 3D cartesian minimum distance (based on spatial ref) between two geometries in projected units. </span> </li> <li> <span class="refentrytitle"> <a href="ST_DistanceSphere.html">ST_DistanceSphere</a> </span> <span class="refpurpose"> — Returns minimum distance in meters between two lon/lat geometries using a spherical earth model. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Distance_Spheroid.html">ST_DistanceSpheroid</a> </span> <span class="refpurpose"> — Returns the minimum distance between two lon/lat geometries using a spheroidal earth model.</span> </li> <li> <span class="refentrytitle"> <a href="ST_FrechetDistance.html">ST_FrechetDistance</a> </span> <span class="refpurpose"> — Returns the Fréchet distance between two geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_HausdorffDistance.html">ST_HausdorffDistance</a> </span> <span class="refpurpose"> — Returns the Hausdorff distance between two geometries. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Length.html">ST_Length</a> </span> <span class="refpurpose"> — Returns the 2D length of a linear geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Length2D.html">ST_Length2D</a> </span> <span class="refpurpose"> — Returns the 2D length of a linear geometry. Alias for <code class="varname">ST_Length</code></span> </li> <li> <span class="refentrytitle"> <a href="ST_3DLength.html">ST_3DLength</a> </span> <span class="refpurpose"> — Returns the 3D length of a linear geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Length_Spheroid.html">ST_LengthSpheroid</a> </span> <span class="refpurpose"> — Returns the 2D or 3D length/perimeter of a lon/lat geometry on a spheroid.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LongestLine.html">ST_LongestLine</a> </span> <span class="refpurpose"> — Returns the 2D longest line between two geometries. </span> </li> <li> <span class="refentrytitle"> <a href="ST_3DLongestLine.html">ST_3DLongestLine</a> </span> <span class="refpurpose"> — Returns the 3D longest line between two geometries</span> </li> <li> <span class="refentrytitle"> <a href="ST_MaxDistance.html">ST_MaxDistance</a> </span> <span class="refpurpose"> — Returns the 2D largest distance between two geometries in projected units.</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DMaxDistance.html">ST_3DMaxDistance</a> </span> <span class="refpurpose"> — Returns the 3D cartesian maximum distance (based on spatial ref) between two geometries in projected units. </span> </li> <li> <span class="refentrytitle"> <a href="ST_MinimumClearance.html">ST_MinimumClearance</a> </span> <span class="refpurpose"> — Returns the minimum clearance of a geometry, a measure of a geometry's robustness.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MinimumClearanceLine.html">ST_MinimumClearanceLine</a> </span> <span class="refpurpose"> — Returns the two-point LineString spanning a geometry's minimum clearance.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Perimeter.html">ST_Perimeter</a> </span> <span class="refpurpose"> — Returns the length of the boundary of a polygonal geometry or geography.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Perimeter2D.html">ST_Perimeter2D</a> </span> <span class="refpurpose"> — Returns the 2D perimeter of a polygonal geometry. Alias for <code class="varname">ST_Perimeter</code>.</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DPerimeter.html">ST_3DPerimeter</a> </span> <span class="refpurpose"> — Returns the 3D perimeter of a polygonal geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ShortestLine.html">ST_ShortestLine</a> </span> <span class="refpurpose"> — Returns the 2D shortest line between two geometries</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DShortestLine.html">ST_3DShortestLine</a> </span> <span class="refpurpose"> — Returns the 3D shortest line between two geometries</span> </li> </ul> </div> </section> <section class="section" id="Overlay_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.13. Overlay Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>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. </p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_ClipByBox2D.html">ST_ClipByBox2D</a> </span> <span class="refpurpose"> — Computes the portion of a geometry falling within a rectangle.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Difference.html">ST_Difference</a> </span> <span class="refpurpose"> — Computes a geometry representing the part of geometry A that does not intersect geometry B.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Intersection.html">ST_Intersection</a> </span> <span class="refpurpose"> — Computes a geometry representing the shared portion of geometries A and B. </span> </li> <li> <span class="refentrytitle"> <a href="ST_MemUnion.html">ST_MemUnion</a> </span> <span class="refpurpose"> — Aggregate function which unions geometries in a memory-efficent but slower way</span> </li> <li> <span class="refentrytitle"> <a href="ST_Node.html">ST_Node</a> </span> <span class="refpurpose"> — Nodes a collection of lines. </span> </li> <li> <span class="refentrytitle"> <a href="ST_Split.html">ST_Split</a> </span> <span class="refpurpose"> — Returns a collection of geometries created by splitting a geometry by another geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Subdivide.html">ST_Subdivide</a> </span> <span class="refpurpose"> — Computes a rectilinear subdivision of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SymDifference.html">ST_SymDifference</a> </span> <span class="refpurpose"> — Computes a geometry representing the portions of geometries A and B that do not intersect.</span> </li> <li> <span class="refentrytitle"> <a href="ST_UnaryUnion.html">ST_UnaryUnion</a> </span> <span class="refpurpose"> — Computes the union of the components of a single geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Union.html">ST_Union</a> </span> <span class="refpurpose"> — Computes a geometry representing the point-set union of the input geometries.</span> </li> </ul> </div> </section> <section class="section" id="Geometry_Processing"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.14. Geometry Processing</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions compute geometric constructions, or alter geometry size or shape. </p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_Buffer.html">ST_Buffer</a> </span> <span class="refpurpose"> — Computes a geometry covering all points within a given distance from a geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_BuildArea.html">ST_BuildArea</a> </span> <span class="refpurpose"> — Creates a polygonal geometry formed by the linework of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Centroid.html">ST_Centroid</a> </span> <span class="refpurpose"> — Returns the geometric center of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ChaikinSmoothing.html">ST_ChaikinSmoothing</a> </span> <span class="refpurpose"> — Returns a smoothed version of a geometry, using the Chaikin algorithm</span> </li> <li> <span class="refentrytitle"> <a href="ST_ConcaveHull.html">ST_ConcaveHull</a> </span> <span class="refpurpose"> — Computes a possibly concave geometry that contains all input geometry vertices</span> </li> <li> <span class="refentrytitle"> <a href="ST_ConvexHull.html">ST_ConvexHull</a> </span> <span class="refpurpose"> — Computes the convex hull of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_DelaunayTriangles.html">ST_DelaunayTriangles</a> </span> <span class="refpurpose"> — Returns the Delaunay triangulation of the vertices of a geometry. </span> </li> <li> <span class="refentrytitle"> <a href="ST_FilterByM.html">ST_FilterByM</a> </span> <span class="refpurpose"> — Removes vertices based on their M value</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeneratePoints.html">ST_GeneratePoints</a> </span> <span class="refpurpose"> — Generates a multipoint of random points contained in a Polygon or MultiPolygon.</span> </li> <li> <span class="refentrytitle"> <a href="ST_GeometricMedian.html"> ST_GeometricMedian </a> </span> <span class="refpurpose"> — Returns the geometric median of a MultiPoint. </span> </li> <li> <span class="refentrytitle"> <a href="ST_LineMerge.html">ST_LineMerge</a> </span> <span class="refpurpose"> — Return the lines formed by sewing together a MultiLineString.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MaximumInscribedCircle.html">ST_MaximumInscribedCircle</a> </span> <span class="refpurpose"> — Computes the largest circle contained within a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LargestEmptyCircle.html">ST_LargestEmptyCircle</a> </span> <span class="refpurpose"> — Computes the largest circle not overlapping a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MinimumBoundingCircle.html">ST_MinimumBoundingCircle</a> </span> <span class="refpurpose"> — Returns the smallest circle polygon that contains a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MinimumBoundingRadius.html">ST_MinimumBoundingRadius</a> </span> <span class="refpurpose"> — Returns the center point and radius of the smallest circle that contains a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_OrientedEnvelope.html">ST_OrientedEnvelope</a> </span> <span class="refpurpose"> — Returns a minimum-area rectangle containing a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_OffsetCurve.html">ST_OffsetCurve</a> </span> <span class="refpurpose"> — Returns an offset line at a given distance and side from an input line. </span> </li> <li> <span class="refentrytitle"> <a href="ST_PointOnSurface.html">ST_PointOnSurface</a> </span> <span class="refpurpose"> — Computes a point guaranteed to lie in a polygon, or on a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Polygonize.html">ST_Polygonize</a> </span> <span class="refpurpose"> — Computes a collection of polygons formed from the linework of a set of geometries. </span> </li> <li> <span class="refentrytitle"> <a href="ST_ReducePrecision.html">ST_ReducePrecision</a> </span> <span class="refpurpose"> — Returns a valid geometry with points rounded to a grid tolerance.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SharedPaths.html">ST_SharedPaths</a> </span> <span class="refpurpose"> — Returns a collection containing paths shared by the two input linestrings/multilinestrings.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Simplify.html">ST_Simplify</a> </span> <span class="refpurpose"> — Returns a simplified representation of a geometry, using the Douglas-Peucker algorithm.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SimplifyPreserveTopology.html">ST_SimplifyPreserveTopology</a> </span> <span class="refpurpose"> — Returns a simplified and valid representation of a geometry, using the Douglas-Peucker algorithm.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SimplifyPolygonHull.html">ST_SimplifyPolygonHull</a> </span> <span class="refpurpose"> — Computes a simplifed topology-preserving outer or inner hull of a polygonal geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_SimplifyVW.html">ST_SimplifyVW</a> </span> <span class="refpurpose"> — Returns a simplified representation of a geometry, using the Visvalingam-Whyatt algorithm</span> </li> <li> <span class="refentrytitle"> <a href="ST_SetEffectiveArea.html">ST_SetEffectiveArea</a> </span> <span class="refpurpose"> — Sets the effective area for each vertex, using the Visvalingam-Whyatt algorithm. </span> </li> <li> <span class="refentrytitle"> <a href="ST_TriangulatePolygon.html">ST_TriangulatePolygon</a> </span> <span class="refpurpose"> — Computes the constrained Delaunay triangulation of polygons</span> </li> <li> <span class="refentrytitle"> <a href="ST_VoronoiLines.html">ST_VoronoiLines</a> </span> <span class="refpurpose"> — Returns the boundaries of the Voronoi diagram of the vertices of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_VoronoiPolygons.html">ST_VoronoiPolygons</a> </span> <span class="refpurpose"> — Returns the cells of the Voronoi diagram of the vertices of a geometry.</span> </li> </ul> </div> </section> <section class="section" id="Coverage"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.15. Coverages</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>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.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_CoverageInvalidEdges.html">ST_CoverageInvalidEdges</a> </span> <span class="refpurpose"> — Window function that finds locations where polygons fail to form a valid coverage.</span> </li> <li> <span class="refentrytitle"> <a href="ST_CoverageSimplify.html">ST_CoverageSimplify</a> </span> <span class="refpurpose"> — Window function that simplifies the edges of a polygonal coverage.</span> </li> <li> <span class="refentrytitle"> <a href="ST_CoverageUnion.html">ST_CoverageUnion</a> </span> <span class="refpurpose"> — Computes the union of a set of polygons forming a coverage by removing shared edges.</span> </li> </ul> </div> </section> <section class="section" id="Affine_Transformation"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.16. Affine Transformations</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions change the position and shape of geometries using <a class="link" href="https://en.wikipedia.org/wiki/Affine_transformation" target="_top">affine transformations</a>.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_Affine.html">ST_Affine</a> </span> <span class="refpurpose"> — Apply a 3D affine transformation to a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Rotate.html">ST_Rotate</a> </span> <span class="refpurpose"> — Rotates a geometry about an origin point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_RotateX.html">ST_RotateX</a> </span> <span class="refpurpose"> — Rotates a geometry about the X axis.</span> </li> <li> <span class="refentrytitle"> <a href="ST_RotateY.html">ST_RotateY</a> </span> <span class="refpurpose"> — Rotates a geometry about the Y axis.</span> </li> <li> <span class="refentrytitle"> <a href="ST_RotateZ.html">ST_RotateZ</a> </span> <span class="refpurpose"> — Rotates a geometry about the Z axis.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Scale.html">ST_Scale</a> </span> <span class="refpurpose"> — Scales a geometry by given factors.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Translate.html">ST_Translate</a> </span> <span class="refpurpose"> — Translates a geometry by given offsets.</span> </li> <li> <span class="refentrytitle"> <a href="ST_TransScale.html">ST_TransScale</a> </span> <span class="refpurpose"> — Translates and scales a geometry by given offsets and factors.</span> </li> </ul> </div> </section> <section class="section" id="Clustering_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.17. Clustering Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions implement clustering algorithms for sets of geometries.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_ClusterDBSCAN.html">ST_ClusterDBSCAN</a> </span> <span class="refpurpose"> — Window function that returns a cluster id for each input geometry using the DBSCAN algorithm.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ClusterIntersecting.html">ST_ClusterIntersecting</a> </span> <span class="refpurpose"> — Aggregate function that clusters input geometries into connected sets.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ClusterIntersectingWin.html">ST_ClusterIntersectingWin</a> </span> <span class="refpurpose"> — Window function that returns a cluster id for each input geometry, clustering input geometries into connected sets.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ClusterKMeans.html">ST_ClusterKMeans</a> </span> <span class="refpurpose"> — Window function that returns a cluster id for each input geometry using the K-means algorithm.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ClusterWithin.html">ST_ClusterWithin</a> </span> <span class="refpurpose"> — Aggregate function that clusters geometries by separation distance.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ClusterWithinWin.html">ST_ClusterWithinWin</a> </span> <span class="refpurpose"> — Window function that returns a cluster id for each input geometry, clustering using separation distance.</span> </li> </ul> </div> </section> <section class="section" id="BBox_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.18. Bounding Box Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions produce or operate on bounding boxes. They can also provide and accept geometry values, by using automatic or explicit casts. </p> <p>See also <a class="xref" href="PostGIS_Special_Functions_Index.html#PostGIS_BoxFunctions" title="13.7. PostGIS Box Functions">Section 13.7, “PostGIS Box Functions”</a>.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="Box2D.html">Box2D</a> </span> <span class="refpurpose"> — Returns a BOX2D representing the 2D extent of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="Box3D.html">Box3D</a> </span> <span class="refpurpose"> — Returns a BOX3D representing the 3D extent of a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_EstimatedExtent.html">ST_EstimatedExtent</a> </span> <span class="refpurpose"> — Returns the estimated extent of a spatial table.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Expand.html">ST_Expand</a> </span> <span class="refpurpose"> — Returns a bounding box expanded from another bounding box or a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_Extent.html">ST_Extent</a> </span> <span class="refpurpose"> — Aggregate function that returns the bounding box of geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DExtent.html">ST_3DExtent</a> </span> <span class="refpurpose"> — Aggregate function that returns the 3D bounding box of geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_MakeBox2D.html">ST_MakeBox2D</a> </span> <span class="refpurpose"> — Creates a BOX2D defined by two 2D point geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DMakeBox.html">ST_3DMakeBox</a> </span> <span class="refpurpose"> — Creates a BOX3D defined by two 3D point geometries.</span> </li> <li> <span class="refentrytitle"> <a href="ST_XMax.html">ST_XMax</a> </span> <span class="refpurpose"> — Returns the X maxima of a 2D or 3D bounding box or a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_XMin.html">ST_XMin</a> </span> <span class="refpurpose"> — Returns the X minima of a 2D or 3D bounding box or a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_YMax.html">ST_YMax</a> </span> <span class="refpurpose"> — Returns the Y maxima of a 2D or 3D bounding box or a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_YMin.html">ST_YMin</a> </span> <span class="refpurpose"> — Returns the Y minima of a 2D or 3D bounding box or a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ZMax.html">ST_ZMax</a> </span> <span class="refpurpose"> — Returns the Z maxima of a 2D or 3D bounding box or a geometry.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ZMin.html">ST_ZMin</a> </span> <span class="refpurpose"> — Returns the Z minima of a 2D or 3D bounding box or a geometry.</span> </li> </ul> </div> </section> <section class="section" id="Linear_Referencing"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.19. Linear Referencing</h2> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_LineInterpolatePoint.html">ST_LineInterpolatePoint</a> </span> <span class="refpurpose"> — Returns a point interpolated along a line at a fractional location.</span> </li> <li> <span class="refentrytitle"> <a href="ST_3DLineInterpolatePoint.html">ST_3DLineInterpolatePoint</a> </span> <span class="refpurpose"> — Returns a point interpolated along a 3D line at a fractional location.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineInterpolatePoints.html">ST_LineInterpolatePoints</a> </span> <span class="refpurpose"> — Returns points interpolated along a line at a fractional interval. </span> </li> <li> <span class="refentrytitle"> <a href="ST_LineLocatePoint.html">ST_LineLocatePoint</a> </span> <span class="refpurpose"> — Returns the fractional location of the closest point on a line to a point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LineSubstring.html">ST_LineSubstring</a> </span> <span class="refpurpose"> — Returns the part of a line between two fractional locations.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LocateAlong.html">ST_LocateAlong</a> </span> <span class="refpurpose"> — Returns the point(s) on a geometry that match a measure value.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LocateBetween.html">ST_LocateBetween</a> </span> <span class="refpurpose"> — Returns the portions of a geometry that match a measure range.</span> </li> <li> <span class="refentrytitle"> <a href="ST_LocateBetweenElevations.html">ST_LocateBetweenElevations</a> </span> <span class="refpurpose"> — Returns the portions of a geometry that lie in an elevation (Z) range.</span> </li> <li> <span class="refentrytitle"> <a href="ST_InterpolatePoint.html">ST_InterpolatePoint</a> </span> <span class="refpurpose"> — Returns the interpolated measure of a geometry closest to a point.</span> </li> <li> <span class="refentrytitle"> <a href="ST_AddMeasure.html">ST_AddMeasure</a> </span> <span class="refpurpose"> — Interpolates measures along a linear geometry.</span> </li> </ul> </div> </section> <section class="section" id="Temporal"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.20. Trajectory Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>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. </p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="ST_IsValidTrajectory.html">ST_IsValidTrajectory</a> </span> <span class="refpurpose"> — Tests if the geometry is a valid trajectory.</span> </li> <li> <span class="refentrytitle"> <a href="ST_ClosestPointOfApproach.html">ST_ClosestPointOfApproach</a> </span> <span class="refpurpose"> — Returns a measure at the closest point of approach of two trajectories. </span> </li> <li> <span class="refentrytitle"> <a href="ST_DistanceCPA.html">ST_DistanceCPA</a> </span> <span class="refpurpose"> — Returns the distance between the closest point of approach of two trajectories. </span> </li> <li> <span class="refentrytitle"> <a href="ST_CPAWithin.html">ST_CPAWithin</a> </span> <span class="refpurpose"> — Tests if the closest point of approach of two trajectories is within the specified distance. </span> </li> </ul> </div> </section> <section class="section" id="Version_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.21. Version Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>These functions report and upgrade PostGIS versions. </p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="PostGIS_Extensions_Upgrade.html">PostGIS_Extensions_Upgrade</a> </span> <span class="refpurpose"> — Packages and upgrades PostGIS extensions (e.g. postgis_raster, postgis_topology, postgis_sfcgal) to given or latest version. </span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Full_Version.html">PostGIS_Full_Version</a> </span> <span class="refpurpose"> — Reports full PostGIS version and build configuration infos.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_GEOS_Version.html">PostGIS_GEOS_Version</a> </span> <span class="refpurpose"> — Returns the version number of the GEOS library.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_GEOS_Compiled_Version.html">PostGIS_GEOS_Compiled_Version</a> </span> <span class="refpurpose"> — Returns the version number of the GEOS library against which PostGIS was built.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Liblwgeom_Version.html">PostGIS_Liblwgeom_Version</a> </span> <span class="refpurpose"> — Returns the version number of the liblwgeom library. This should match the version of PostGIS.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_LibXML_Version.html">PostGIS_LibXML_Version</a> </span> <span class="refpurpose"> — Returns the version number of the libxml2 library.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_LibJSON_Version.html">PostGIS_LibJSON_Version</a> </span> <span class="refpurpose"> — Returns the version number of the libjson-c library.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Lib_Build_Date.html">PostGIS_Lib_Build_Date</a> </span> <span class="refpurpose"> — Returns build date of the PostGIS library.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Lib_Version.html">PostGIS_Lib_Version</a> </span> <span class="refpurpose"> — Returns the version number of the PostGIS library.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_PROJ_Version.html">PostGIS_PROJ_Version</a> </span> <span class="refpurpose"> — Returns the version number of the PROJ4 library.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_PROJ_Compiled_Version.html">PostGIS_PROJ_Compiled_Version</a> </span> <span class="refpurpose"> — Returns the version number of the PROJ library against which PostGIS was built.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Wagyu_Version.html">PostGIS_Wagyu_Version</a> </span> <span class="refpurpose"> — Returns the version number of the internal Wagyu library.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Scripts_Build_Date.html">PostGIS_Scripts_Build_Date</a> </span> <span class="refpurpose"> — Returns build date of the PostGIS scripts.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Scripts_Installed.html">PostGIS_Scripts_Installed</a> </span> <span class="refpurpose"> — Returns version of the PostGIS scripts installed in this database.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Scripts_Released.html">PostGIS_Scripts_Released</a> </span> <span class="refpurpose"> — Returns the version number of the postgis.sql script released with the installed PostGIS lib.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_Version.html">PostGIS_Version</a> </span> <span class="refpurpose"> — Returns PostGIS version number and compile-time options.</span> </li> </ul> </div> </section> <section class="section" id="PostGIS_GUC"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.22. Grand Unified Custom Variables (GUCs)</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>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.</p> <p>For more examples of usage refer to <a class="link" href="https://www.postgresql.org/docs/current/sql-set.html" target="_top">SQL SET</a> and <a class="link" href="https://www.postgresql.org/docs/current/sql-altersystem.html" target="_top">SQL ALTER SYSTEM</a></p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="postgis_backend.html">postgis.backend</a> </span> <span class="refpurpose"> — The backend to service a function where GEOS and SFCGAL overlap. Options: geos or sfcgal. Defaults to geos.</span> </li> <li> <span class="refentrytitle"> <a href="postgis_gdal_datapath.html">postgis.gdal_datapath</a> </span> <span class="refpurpose"> — A configuration option to assign the value of GDAL's GDAL_DATA option. If not set, the environmentally set GDAL_DATA variable is used. </span> </li> <li> <span class="refentrytitle"> <a href="postgis_gdal_enabled_drivers.html">postgis.gdal_enabled_drivers</a> </span> <span class="refpurpose"> — A configuration option to set the enabled GDAL drivers in the PostGIS environment. Affects the GDAL configuration variable GDAL_SKIP. </span> </li> <li> <span class="refentrytitle"> <a href="postgis_enable_outdb_rasters.html">postgis.enable_outdb_rasters</a> </span> <span class="refpurpose"> — A boolean configuration option to enable access to out-db raster bands. </span> </li> <li> <span class="refentrytitle"> <a href="postgis_gdal_vsi_options.html">postgis.gdal_vsi_options</a> </span> <span class="refpurpose"> — A string configuration to set options used when working with an out-db raster. </span> </li> </ul> </div> </section> <section class="section" id="Troubleshooting_Functions"> <div class="titlepage"> <div> <div> <h2 class="title" style="clear: both">7.23. Troubleshooting Functions</h2> </div> <div> <div class="abstract"> <div class="abstract-title">Abstract</div> <p>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.</p> </div> </div> </div> </div> <div class="toc"> <ul class="toc"> <li> <span class="refentrytitle"> <a href="PostGIS_AddBBox.html">PostGIS_AddBBox</a> </span> <span class="refpurpose"> — Add bounding box to the geometry.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_DropBBox.html">PostGIS_DropBBox</a> </span> <span class="refpurpose"> — Drop the bounding box cache from the geometry.</span> </li> <li> <span class="refentrytitle"> <a href="PostGIS_HasBBox.html">PostGIS_HasBBox</a> </span> <span class="refpurpose"> — Returns TRUE if the bbox of this geometry is cached, FALSE otherwise.</span> </li> </ul> </div> </section> </section> <footer> <div class="navfooter"> <table style="width: 100%; "> <tr> <td style="width: 40%; text-align: left; "><a accesskey="p" href="performance_tips.html">Prev</a> </td> <td style="width: 20%; text-align: center; "> </td> <td style="width: 40%; text-align: right; "> <a accesskey="n" href="box2d_type.html">Next</a></td> </tr> <tr> <td style="width: 40%; text-align: left; vertical-align: top; ">Chapter 6. Performance Tips </td> <td style="width: 20%; text-align: center; "> <a accesskey="h" href="index.html">Home</a> </td> <td style="width: 40%; text-align: right; vertical-align: top; "> box2d</td> </tr> </table> </div> </footer> </body> </html>