From: Kevin Neufeld Date: Wed, 16 Jul 2008 06:42:00 +0000 (+0000) Subject: moved ST_Envelope, complete with examples. X-Git-Tag: 1.4.0b1~835 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3db92219ec1ccce53d8be0f79a4c5b2d77510196;p=postgis moved ST_Envelope, complete with examples. git-svn-id: http://svn.osgeo.org/postgis/trunk@2863 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference.xml b/doc/reference.xml index 1952d58d7..7b17c44a9 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -475,24 +475,6 @@ ST_Dimension - - ST_Envelope(geometry) - - - Returns a vald geometry (POINT, LINESTRING or POLYGON) - representing the bounding box of the geometry. Degenerate cases - (vertical lines, point) will return a geometry of lower dimension - than POLYGON. - - OGC SPEC s2.1.1.1 - The minimum bounding box for this - Geometry, returned as a Geometry. The polygon is defined by the - corner points of the bounding box ((MINX, MINY), (MAXX, MINY), - (MAXX, MAXY), (MINX, MAXY), (MINX, MINY)). - - NOTE:PostGIS will add a Zmin/Zmax coordinate as well. - - - ST_IsEmpty(geometry) @@ -1094,18 +1076,6 @@ GROUP BY gid, field1,field2; Management Functions - - UpdateGeometrySRID([<schema_name>], <table_name>, - <column_name>, <srid>) - - - Update the SRID of all features in a geometry column - updating constraints and reference in geometry_columns. Note: uses - current_schema() on schema-aware pgsql installations if schema is - not provided. - - - update_geometry_stats([<table_name>, <column_name>]) @@ -2812,17 +2782,6 @@ WHERE n*100.00/length < 1; - - ST_Envelope - - - Return the bounding rectangle for the ST_Geometry - value. - - SQL-MM 3: 5.1.15 - - - ST_Equals diff --git a/doc/reference_new.xml b/doc/reference_new.xml index 17e2ebf8b..70b9eacf3 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -412,6 +412,100 @@ FROM userpoints ; Geometry Accessors + + + + ST_Envelope + + Returns a geometry representing the bounding box of the + supplied geometry. + + + + + + boolean ST_Envelope + + geometry g1 + + + + + + Description + + Returns the minimum bounding box for the supplied geometry, as a geometry. + The polygon is defined by the corner points of the bounding box + ((MINX, MINY), + (MINX, MAXY), + (MAXX, MAXY), + (MAXX, MINY), + (MINX, MINY)). (PostGIS will add a + ZMIN/ZMAX coordinate as + well). + + Degenerate cases (vertical lines, points) will return a geometry of + lower dimension than POLYGON, ie. + POINT or LINESTRING. + + + In PostGIS, the bounding box of a geometry is represented internally using + float4s instead of float8s that are used + to store geometries. The bounding box coordinates are floored, guarenteeing + that the geometry is contained entirely within its bounds. This has the + advantage that a geometry's bounding box is half the size as the minimum + bounding rectangle, which means significantly faster indexes and general performance. + But it also means that the bounding box is NOT the same as the minimum bounding + rectangle that bounds the geometry. + + + + + + + This method implements the OpenGIS Simple Features + Implementation Specification for SQL: v1.1: s2.1.1.1 + + + + + + This method implements the SQL/MM specification: + SQL-MM 3: 5.1.15 + + + + Examples + + +SELECT ST_AsText(ST_Envelope('POINT(1 3)'::geometry)); + st_astext +------------ + POINT(1 3) +(1 row) + + +SELECT ST_AsText(ST_Envelope('LINESTRING(0 0, 1 3)'::geometry)); + st_astext +-------------------------------- + POLYGON((0 0,0 3,1 3,1 0,0 0)) +(1 row) + + +SELECT ST_AsText(ST_Envelope('POLYGON((0 0, 0 1, 1.0000001 1, 1.0000001 0, 0 0))'::geometry)); + st_astext +-------------------------------------------------------------- + POLYGON((0 0,0 1,1.00000011920929 1,1.00000011920929 0,0 0)) +(1 row) +SELECT ST_AsText(ST_Envelope('POLYGON((0 0, 0 1, 1.0000000001 1, 1.0000000001 0, 0 0))'::geometry)); + st_astext +-------------------------------------------------------------- + POLYGON((0 0,0 1,1.00000011920929 1,1.00000011920929 0,0 0)) +(1 row) + + +