Geography Reference
In-Depth Information
ST_Point()
ST_LineFromMultiPoint()
ST_Polygon()
All of which are detailed in the Geometry Constructors section of the online PostGIS manual
at http://postgis.refractions.net/docs/reference.html#Geometry_Constructors . Most of the
geometry constructors are also defined in the OGC specifications.
Output Functions
Now that we've seen how to generate geometry objects, it would be great to be able to get
our data back out of the database.
If you want just the binary blob representation, a simple Select will do the job. In the
creation samples in the previous section, because we weren't inserting the data, the output
was the actual binary blob that represented the geometry.
One thing you must be cautious of: when dumping the blob directly, it might not be a WKB
formatted object. Some database services store the data in an internal format which allows
them to manage it quicker and easier than if it were WKB. If you want to ensure you always
receive a WKB output, be sure to use the correct output function as shown in the following
code:
SELECT ST_AsBinary(geometry)
Quite a few textual output functions are available as well, such as:
SELECT ST_AsText(geometry)
This will output your geometry in the WKT format.
If you want your geometry output in the EWKT format, use the following:
SELECT ST_AsEWKT(geometry)
If you're displaying your geometry in an HTML 5 page using SVG, then you'll use the
following:
SELECT ST_AsSVG(geometry)
 
Search WWH ::




Custom Search