From: Regina Obe Date: Sat, 6 Sep 2008 18:58:03 +0000 (+0000) Subject: Move over ST_Contains to new section. Provide example. Minor changes to ST_Within X-Git-Tag: 1.4.0b1~765 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a82d95d3e37e07b5f8f3492ab7c3ba972f77c55e;p=postgis Move over ST_Contains to new section. Provide example. Minor changes to ST_Within git-svn-id: http://svn.osgeo.org/postgis/trunk@2939 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/doc/reference.xml b/doc/reference.xml index 9d5c7ec88..025009a8c 100644 --- a/doc/reference.xml +++ b/doc/reference.xml @@ -23,31 +23,6 @@ Geometry Relationship Functions - - - ST_Contains(A geometry, B geometry) - - - Returns TRUE if Geometry A "spatially contains" Geometry - B. - - Performed by the GEOS module - - Do not call with a GeometryCollection as an argument - - This function call will automatically include a bounding box - comparison that will make use of any indexes that are available on - the geometries. To avoid index use, use the function - _ST_Contains. - - NOTE: this is the "allowable" version that returns a - boolean, not an integer. - - OGC SPEC s2.1.1.2 // s2.1.13.3 - same as within(geometry B, - geometry A) - - - ST_Covers(geometry A, geometry B) diff --git a/doc/reference_new.xml b/doc/reference_new.xml index 3e0c4f70d..399aba0c5 100644 --- a/doc/reference_new.xml +++ b/doc/reference_new.xml @@ -3364,6 +3364,99 @@ st_area + + + + ST_Contains + + Returns true if the geometry B is completely inside geometry A + + + + + + boolean ST_Contains + + geometry + A + + geometry + B + + + + + + Description + + Returns TRUE if geometry B is completely inside geometry A. For this function to make + sense, the source geometries must both be of the same coordinate projection, + having the same SRID. ST_Contains is the inverse of ST_Within. So ST_Contains(A,B) implies ST_Within(B,A) except in the case of + invalid geometries where the result is always false regardless or not defined. + + Performed by the GEOS module + + + Do not call with a GEOMETRYCOLLECTION as an argument + + + + Do not use this function with invalid geometries. You will get unexpected results. + + + This function call will automatically include a bounding box + comparison that will make use of any indexes that are available on + the geometries. To avoid index use, use the function + _ST_Contains. + + NOTE: this is the "allowable" version that returns a + boolean, not an integer. + + + + + + + This method implements the + OpenGIS Simple Features + Implementation Specification for SQL. + OGC SPEC s2.1.1.2 // s2.1.13.3 - same as within(geometry B, + geometry A) + + + + + + + + This method implements the SQL/MM specification: + SQL-MM 3: 5.1.30 + + + + Examples + + --a circle within a circle + SELECT ST_Contains(smallc,smallc) As smallinsmall, + ST_Contains(smallc, bigc) As smallinbig, + ST_Contains(bigc,smallc) As biginsmall, + ST_Contains(ST_Union(smallc, bigc), bigc) as unioninbig, + ST_Contains(bigc, ST_Union(smallc, bigc)) as biginunion, + ST_Equals(bigc, ST_Union(smallc, bigc)) as bigisunion + FROM (SELECT ST_Buffer(ST_GeomFromText('POINT(1 2)'), 10) As smallc, + ST_Buffer(ST_GeomFromText('POINT(1 2)'), 20) As bigc) As foo; + --Result + smallinsmall | smallinbig | biginsmall | unioninbig | biginunion | bigisunion +--------------+------------+------------+------------+------------+------------ + t | f | t | t | t | t + + + + + See Also + + + @@ -3788,9 +3881,9 @@ SELECT s.gid, s.school_name ST_OrderingEquals (it must be noted ST_OrderingEquals is a little more stringent than simply verifying order of points are the same). - - This function will return false if either geometry is invalid even if they are binary equal. - + + This function will return false if either geometry is invalid even if they are binary equal. + @@ -4485,6 +4578,10 @@ SELECT ST_Touches('LINESTRING(0 0, 1 1, 0 2)'::geometry, 'POINT(0 2)'::geometry) Do not call with a GEOMETRYCOLLECTION as an argument + + + Do not use this function with invalid geometries. You will get unexpected results. + This function call will automatically include a bounding box comparison that will make use of any indexes that are available on @@ -4494,12 +4591,6 @@ SELECT ST_Touches('LINESTRING(0 0, 1 1, 0 2)'::geometry, 'POINT(0 2)'::geometry) NOTE: this is the "allowable" version that returns a boolean, not an integer. - - This function call will automatically include a bounding box - comparison that will make use of any indexes that are available on - the geometries. - - @@ -4543,7 +4634,7 @@ FROM (SELECT ST_Buffer(ST_GeomFromText('POINT(1 2)'), 10) As smallc, See Also - + ,