# PostGIS Reference

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.

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. These will be deprecated in a future release.

## OpenGIS Functions

### Geometry Constructors

ST_PolyFromWKB(bytea,[<srid>])

  Makes a Geometry from WKB with the given SRID. If SRID is not give, it defaults to -1.

  OGC SPEC 3.2.7.2 - option SRID is from the conformance suite

  throws an error if WKB is not a POLYGON

ST_PolygonFromWKB(bytea,[<srid>])

  Makes a Geometry from WKB with the given SRID. If SRID is not give, it defaults to -1.

  from the conformance suite

  throws an error if WKB is not a POLYGON

ST_MPointFromWKB(bytea,[<srid>])

  Makes a Geometry from WKB with the given SRID. If SRID is not give, it defaults to -1.

  OGC SPEC 3.2.7.2 - option SRID is from the conformance suite

  throws an error if WKB is not a MULTIPOINT

ST_MLineFromWKB(bytea,[<srid>])

  Makes a Geometry from WKB with the given SRID. If SRID is not give, it defaults to -1.

  OGC SPEC 3.2.7.2 - option SRID is from the conformance suite

  throws an error if WKB is not a MULTILINESTRING

ST_MPolyFromWKB(bytea,[<srid>])

  Makes a Geometry from WKB with the given SRID. If SRID is not give, it defaults to -1.

  OGC SPEC 3.2.7.2 - option SRID is from the conformance suite

  throws an error if WKB is not a MULTIPOLYGON

ST_GeomCollFromWKB(bytea,[<srid>])

  Makes a Geometry from WKB with the given SRID. If SRID is not give, it defaults to -1.

  OGC SPEC 3.2.7.2 - option SRID is from the conformance suite

  throws an error if WKB is not a GEOMETRYCOLLECTION

## SQL-MM Functions

This is a listing of the SQL-MM defined functions that PostGIS currently supports. The implementations of these functions follow the ArcSDE implementation, and thus deviate somewhat from the spec. These deviations will be noted.

As of version 1.2.0, these functions have been implemented by wrapping existing PostGIS functions. As a result, full support for curved geometries may not be in place for many functions.

SQL-MM defines the default SRID of all geometry constructors as 0. PostGIS uses a default SRID of -1.

ST_MLineFromWKB

  Return a specified ST_MultiLineString value.

  SQL-MM 3: 9.4.5

ST_MPointFromWKB

  Return a specified ST_MultiPoint value.

  SQL-MM 3: 9.2.5

ST_MPolyFromWKB

  Return a specified ST_MultiPolygon value.

  SQL-MM 3: 9.6.5

ST_PolyFromWKB

  Return a specified ST_Polygon value.

  SQL-MM 3: 8.3.7

## ArcSDE Functions

Additional functions have been added to improve support for an ArcSDE style interface.

SE_EnvelopesIntersect

  Returns t (TRUE) if the envelopes of two geometries intersect; otherwise, it returns f (FALSE).

SE_Is3d

  Test if a geometry value has z coordinate values.

SE_IsMeasured

  Test if a geometry value has m coordinate values.

SE_LocateAlong

  Return a derived geometry collection value with elements that match the specified measur.

SE_LocateBetween

  Return a derived geometry collection value with elements that match the specified range of measures inclusively.

SE_M

  Returns the m coordinate value of an ST_Point value.

SE_Z

  Returns the z coordinate value of an ST_Point value