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.
Syntax: AddGeometryColumn(<db_name>, <table_name>, <column_name>, <srid>, <type>, <dimension>). Adds a geometry column to an existing table of attributes. The dbname is the name of the database instance. The srid must be an integer value reference to an entry in the SPATIAL_REF_SYS table. The type must be an uppercase string corresponding to the geometry type, eg, 'POLYGON' or 'MULTILINESTRING'.
Syntax: DropGeometryColumn(<db_name>,<table_name>,<column_name>). Remove a geometry column from a spatial table.
Returns the geometry in the OGC "well-known-binary" format, using the endian encoding of the server on which the database is running. This is useful in binary cursors to pull data out of the database without converting it to a string representation.
Returns '2' if the geometry is two dimensional and '3' if the geometry is three dimensional.
Returns a POLYGON representing the bounding box of the geometry.
Returns the type of the geometry as a string. Eg: 'LINESTRING', 'POLYGON', 'MULTIPOINT', etc.
Find and return the X coordinate of the first point in the geometry. Return NULL if there is no point in the geometry.
Find and return the Y coordinate of the first point in the geometry. Return NULL if there is no point in the geometry.
Find and return the Z coordinate of the first point in the geometry. Return NULL if there is no point in the geometry.
Find and return the number of points in the first linestring in the geometry. Return NULL if there is no linestring in the geometry.
Return the N'th point in the first linestring in the geometry. Return NULL if there is no linestring in the geometry.
Return the exterior ring of the first polygon in the geometry. Return NULL if there is no polygon in the geometry.
Return the number of interior rings of the first polygon in the geometry. Return NULL if there is no polygon in the geometry.
Return the N'th interior ring of the first polygon in the geometry. Return NULL if there is no polygon in the geometry.
Returns true of the geometry start and end points are coincident.
If geometry is a GEOMETRYCOLLECTION return the number of geometries, otherwise return NULL.
Return the N'th geometry if the geometry is a GEOMETRYCOLLECTION, MULTIPOINT, MULTILINESTRING or MULTIPOLYGON. Otherwise, return NULL.
Return the cartesian distance between two geometries in projected units.
Return the Well-Known Text representation of the geometry. For example: POLYGON(0 0,0 1,1 1,1 0,0 0)
Returns the integer SRID number of the spatial reference system of the geometry.
Syntax: GeometryFromText(<geometry>,<SRID>) Convert a Well-Known Text representation of a geometry into a geometry object.
Set the SRID on a geometry to a particular integer value. Useful in constructing bounding boxes for queries.
Returns the last point of the geometry as a point.
Returns the first point of the geometry as a point.
Returns the centroid of the geometry as a point.