[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0rc1-111-gedc81df

git at osgeo.org git at osgeo.org
Thu Mar 4 16:31:24 PST 2021


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  edc81df0e8d261ab3b5a18f30411ba057309894f (commit)
      from  4bc6b1ee11e1bb7df3786d904ab04fe816fc08ec (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit edc81df0e8d261ab3b5a18f30411ba057309894f
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Thu Mar 4 16:31:14 2021 -0800

    Improve doc on topological relationships

diff --git a/doc/reference_relationship.xml b/doc/reference_relationship.xml
index 4cecb5b..7359bc9 100644
--- a/doc/reference_relationship.xml
+++ b/doc/reference_relationship.xml
@@ -81,7 +81,7 @@
 	  <refnamediv>
 		<refname>ST_Contains</refname>
 
-		<refpurpose>Returns true if and only if no points of B lie in the exterior of A, and at least one point of the interior of B lies in the interior of A. </refpurpose>
+		<refpurpose>Returns true if no points of B lie in the exterior of A, and A and B have at least one interior point in common. </refpurpose>
 	  </refnamediv>
 
 	  <refsynopsisdiv>
@@ -101,14 +101,19 @@
 	  <refsection>
 		<title>Description</title>
 
-		<para>Geometry A contains Geometry B if and only if no points of B lie in the exterior of A, and at least one point of the interior of B lies in the interior of A.
-		An important subtlety of this definition is that A does not contain its boundary, but A does contain itself. Contrast that to <xref linkend="ST_ContainsProperly" /> where geometry
-		A does not Contain Properly itself.</para>
+		<para>Returns TRUE if geometry B is completely inside geometry A.
+        A contains B if and only if no points of B lie in the exterior of A, and at least one point of the interior of B lies in the interior of A.
+        </para>
+        <para>A subtlety of the definition is that a geometry does not contain its boundary.
+        This implies that polygons and lines do <emphasis>not</emphasis> contain lines and points lying in their boundary.
+        For further details see <ulink url="http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html">Subtleties of OGC Covers, Contains, Within</ulink>.
+        (The <xref linkend="ST_Covers" /> predicate provides a more inclusive relationship.)
+        However, a geometry does contain itself.
+        (In contrast, in the <xref linkend="ST_ContainsProperly" />
+        predicate a geometry does <emphasis>not</emphasis> properly contain itself.)</para>
 
-		<para>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.</para>
+        <para>ST_Contains is the inverse of <xref linkend="ST_Within"/>.
+        So, <code>ST_Contains(A,B) = ST_Within(B,A)</code>.</para>
 
 		<para>Performed by the GEOS module</para>
 		<para>Enhanced: 2.3.0 Enhancement to PIP short-circuit extended to support MultiPoints with few points. Prior versions only supported point in polygon.</para>
@@ -124,7 +129,7 @@
 		<para>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.</para>
+			<function>_ST_Contains</function>.</para>
 
 		<para>NOTE: this is the "allowable" version that returns a
 			boolean, not an integer.</para>
@@ -133,8 +138,6 @@
 		- same as within(geometry B, geometry A)</para>
 		<para>&sqlmm_compliant;	SQL-MM 3: 5.1.31</para>
 
-		<para>There are certain subtleties to ST_Contains and ST_Within that are not intuitively obvious.
-			For details check out <ulink url="http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html">Subtleties of OGC Covers, Contains, Within</ulink></para>
 	  </refsection>
 
 	  <refsection>
@@ -264,7 +267,7 @@ ST_Point      | t          | t              | f           | f
 	  <refnamediv>
 		<refname>ST_ContainsProperly</refname>
 
-		<refpurpose>Returns true if B intersects the interior of A but not the boundary (or exterior). A does not contain properly itself, but does contain itself.</refpurpose>
+		<refpurpose>Returns true if B intersects the interior of A but not the boundary or exterior. </refpurpose>
 	  </refnamediv>
 
 	  <refsynopsisdiv>
@@ -284,19 +287,20 @@ ST_Point      | t          | t              | f           | f
 	  <refsection>
 		<title>Description</title>
 
-		<para>Returns true if B intersects the interior of A but not the boundary (or exterior).</para>
+		<para>Returns true if B intersects the interior of A but not the boundary or exterior.</para>
 
-		<para>A does not contain properly itself, but does contain itself.</para>
+		<para>A does not properly contain itself, but does contain itself.</para>
 		<para>Every point of the other geometry is a point of this geometry's interior. The DE-9IM Intersection Matrix for the two geometries matches
    [T**FF*FF*] used in <xref linkend="ST_Relate" /></para>
 
-		<note>
-		  <para>From JTS docs slightly reworded: The advantage to using this predicate over <xref linkend="ST_Contains" /> and <xref linkend="ST_Intersects" /> is that it can be computed
-	  efficiently, with no need to compute topology at individual points.</para>
 		<para>
-			 An example use case for this predicate is computing the intersections of a set of geometries with a large polygonal geometry. Since intersection is a fairly slow operation, it can be more efficient to use containsProperly to filter out test geometries which lie
-	wholly inside the area.  In these cases the intersection is	known a priori to be exactly the original test geometry.
-	 </para>
+		An example use case for this predicate is computing the intersections of a set of geometries with a large polygonal geometry. Since intersection is a fairly slow operation, it can be more efficient to use containsProperly to filter out test geometries which lie
+	    wholly inside the area.  In these cases the intersection is	known a priori to be exactly the original test geometry.
+	    </para>
+
+		<note>
+		  <para>The advantage of this predicate over <xref linkend="ST_Contains" /> and <xref linkend="ST_Intersects" /> is that it can be computed
+	        more efficiently, with no need to compute topology at individual points.</para>
 		</note>
 		<para>Performed by the GEOS module.</para>
 		<para>Availability: 1.4.0</para>
@@ -312,7 +316,7 @@ ST_Point      | t          | t              | f           | f
 		<para>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_ContainsProperly.</para>
+			<function>_ST_ContainsProperly</function>.</para>
 
 	  </refsection>
 
@@ -355,17 +359,17 @@ ST_Point      | t          | t              | f           | f
 	  </refsection>
  </refentry>
 
-  <refentry id="ST_Covers">
+  <refentry id="ST_CoveredBy">
 	  <refnamediv>
-		<refname>ST_Covers</refname>
+		<refname>ST_CoveredBy</refname>
 
-		<refpurpose>Returns true if no point in B is outside A</refpurpose>
+		<refpurpose>Returns true if no point in A is outside B</refpurpose>
 	  </refnamediv>
 
 	  <refsynopsisdiv>
 		<funcsynopsis>
 		  <funcprototype>
-			<funcdef>boolean <function>ST_Covers</function></funcdef>
+			<funcdef>boolean <function>ST_CoveredBy</function></funcdef>
 
 			<paramdef><type>geometry </type>
 			<parameter>geomA</parameter></paramdef>
@@ -373,14 +377,15 @@ ST_Point      | t          | t              | f           | f
 			<paramdef><type>geometry </type>
 			<parameter>geomB</parameter></paramdef>
 		  </funcprototype>
+
 		  <funcprototype>
-			<funcdef>boolean <function>ST_Covers</function></funcdef>
+			<funcdef>boolean <function>ST_CoveredBy</function></funcdef>
 
 			<paramdef><type>geography </type>
-			<parameter>geogpolyA</parameter></paramdef>
+			<parameter>geogA</parameter></paramdef>
 
 			<paramdef><type>geography </type>
-			<parameter>geogpointB</parameter></paramdef>
+			<parameter>geogB</parameter></paramdef>
 		  </funcprototype>
 		</funcsynopsis>
 	  </refsynopsisdiv>
@@ -388,8 +393,11 @@ ST_Point      | t          | t              | f           | f
 	  <refsection>
 		<title>Description</title>
 
-		  <para>Returns 1 (TRUE) if no point in Geometry/Geography B is outside
-			Geometry/Geography A</para>
+		  <para>Returns <varname>true</varname> if no point in Geometry/Geography A lies outside
+            Geometry/Geography B.
+            Equivalently, tests if every point of geometry A is inside
+            (i.e. intersects the interior or boundary of) geometry B.
+            </para>
 
 		<important>
 		  <para>Enhanced: 3.0.0 enabled support for <varname>GEOMETRYCOLLECTION</varname></para>
@@ -398,74 +406,53 @@ ST_Point      | t          | t              | f           | f
 		<important>
 		  <para>Do not use this function with invalid geometries. You will get unexpected results.</para>
 		</important>
-
+		<para>Performed by the GEOS module</para>
+		<para>Availability: 1.2.2</para>
 		<para>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_Covers.</para>
-
-		<para>Performed by the GEOS module</para>
-    <para>Enhanced: 2.4.0 Support for polygon in polygon and line in polygon added for geography type</para>
-		<para>Enhanced: 2.3.0 Enhancement to PIP short-circuit for geometry extended to support MultiPoints with few points. Prior versions only supported point in polygon.</para>
-		<para>Availability: 1.5 - support for geography was introduced. </para>
-		<para>Availability: 1.2.2</para>
+			<function>_ST_CoveredBy</function>.</para>
 
 		<para>NOTE: this is the "allowable" version that returns a
 			boolean, not an integer.</para>
 
 		<para>Not an OGC standard, but Oracle has it too.</para>
-		<para>There are certain subtleties to ST_Contains and ST_Within that are not intuitively obvious.
-			For details check out <ulink url="http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html">Subtleties of OGC Covers, Contains, Within</ulink></para>
 	  </refsection>
 
 	  <refsection>
 		<title>Examples</title>
-			<para> Geometry example </para>
 		  <programlisting>
-	--a circle covering a circle
-SELECT ST_Covers(smallc,smallc) As smallinsmall,
-	ST_Covers(smallc, bigc) As smallcoversbig,
-	ST_Covers(bigc, ST_ExteriorRing(bigc)) As bigcoversexterior,
-	ST_Contains(bigc, ST_ExteriorRing(bigc)) As bigcontainsexterior
+	--a circle coveredby a circle
+SELECT ST_CoveredBy(smallc,smallc) As smallinsmall,
+	ST_CoveredBy(smallc, bigc) As smallcoveredbybig,
+	ST_CoveredBy(ST_ExteriorRing(bigc), bigc) As exteriorcoveredbybig,
+	ST_Within(ST_ExteriorRing(bigc),bigc) As exeriorwithinbig
 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 | smallcoversbig | bigcoversexterior | bigcontainsexterior
---------------+----------------+-------------------+---------------------
- t            | f              | t                 | f
+ smallinsmall | smallcoveredbybig | exteriorcoveredbybig | exeriorwithinbig
+--------------+-------------------+----------------------+------------------
+ t            | t                 | t                    | f
 (1 row)	</programlisting>
-		<para>Geeography Example</para>
-		<programlisting>
--- a point with a 300 meter buffer compared to a point, a point and its 10 meter buffer
-SELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt,
-	ST_Covers(ST_Buffer(geog_pt,10), geog_pt) As buff_10m_covers_cent
-	FROM (SELECT ST_Buffer(ST_GeogFromText('SRID=4326;POINT(-99.327 31.4821)'), 300) As geog_poly,
-				ST_GeogFromText('SRID=4326;POINT(-99.33 31.483)') As geog_pt ) As foo;
-
- poly_covers_pt | buff_10m_covers_cent
-----------------+------------------
- f              | t
-		</programlisting>
 	  </refsection>
 
 	  <refsection>
 		<title>See Also</title>
-		<para><xref linkend="ST_Contains"/>, <xref linkend="ST_CoveredBy" />, <xref linkend="ST_Within"/></para>
+		<para><xref linkend="ST_Contains"/>, <xref linkend="ST_Covers" />, <xref linkend="ST_ExteriorRing"/>, <xref linkend="ST_Within"/></para>
 	  </refsection>
  </refentry>
 
-  <refentry id="ST_CoveredBy">
+  <refentry id="ST_Covers">
 	  <refnamediv>
-		<refname>ST_CoveredBy</refname>
+		<refname>ST_Covers</refname>
 
-		<refpurpose>Returns true if no point in Geometry/Geography A is outside
-			Geometry/Geography B</refpurpose>
+		<refpurpose>Returns true if no point in B is outside A</refpurpose>
 	  </refnamediv>
 
 	  <refsynopsisdiv>
 		<funcsynopsis>
 		  <funcprototype>
-			<funcdef>boolean <function>ST_CoveredBy</function></funcdef>
+			<funcdef>boolean <function>ST_Covers</function></funcdef>
 
 			<paramdef><type>geometry </type>
 			<parameter>geomA</parameter></paramdef>
@@ -473,15 +460,14 @@ SELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt,
 			<paramdef><type>geometry </type>
 			<parameter>geomB</parameter></paramdef>
 		  </funcprototype>
-
 		  <funcprototype>
-			<funcdef>boolean <function>ST_CoveredBy</function></funcdef>
+			<funcdef>boolean <function>ST_Covers</function></funcdef>
 
 			<paramdef><type>geography </type>
-			<parameter>geogA</parameter></paramdef>
+			<parameter>geogpolyA</parameter></paramdef>
 
 			<paramdef><type>geography </type>
-			<parameter>geogB</parameter></paramdef>
+			<parameter>geogpointB</parameter></paramdef>
 		  </funcprototype>
 		</funcsynopsis>
 	  </refsynopsisdiv>
@@ -489,8 +475,11 @@ SELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt,
 	  <refsection>
 		<title>Description</title>
 
-		  <para>Returns 1 (TRUE) if no point in Geometry/Geography A is outside
-			Geometry/Geography B</para>
+		  <para>Returns <varname>true</varname> if no point in Geometry/Geography B is outside
+			Geometry/Geography A.
+            Equivalently, tests if every point of geometry B is inside
+            (i.e. intersects the interior or boundary of) geometry A.
+            </para>
 
 		<important>
 		  <para>Enhanced: 3.0.0 enabled support for <varname>GEOMETRYCOLLECTION</varname></para>
@@ -499,41 +488,57 @@ SELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt,
 		<important>
 		  <para>Do not use this function with invalid geometries. You will get unexpected results.</para>
 		</important>
-		<para>Performed by the GEOS module</para>
-		<para>Availability: 1.2.2</para>
+
 		<para>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_CoveredBy.</para>
+			<function>_ST_Covers</function>.</para>
+
+		<para>Performed by the GEOS module</para>
+    <para>Enhanced: 2.4.0 Support for polygon in polygon and line in polygon added for geography type</para>
+		<para>Enhanced: 2.3.0 Enhancement to PIP short-circuit for geometry extended to support MultiPoints with few points. Prior versions only supported point in polygon.</para>
+		<para>Availability: 1.5 - support for geography was introduced. </para>
+		<para>Availability: 1.2.2</para>
 
 		<para>NOTE: this is the "allowable" version that returns a
 			boolean, not an integer.</para>
 
 		<para>Not an OGC standard, but Oracle has it too.</para>
-		<para>There are certain subtleties to ST_Contains and ST_Within that are not intuitively obvious.
-			For details check out <ulink url="http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html">Subtleties of OGC Covers, Contains, Within</ulink></para>
 	  </refsection>
 
 	  <refsection>
 		<title>Examples</title>
+			<para> Geometry example </para>
 		  <programlisting>
-	--a circle coveredby a circle
-SELECT ST_CoveredBy(smallc,smallc) As smallinsmall,
-	ST_CoveredBy(smallc, bigc) As smallcoveredbybig,
-	ST_CoveredBy(ST_ExteriorRing(bigc), bigc) As exteriorcoveredbybig,
-	ST_Within(ST_ExteriorRing(bigc),bigc) As exeriorwithinbig
+	--a circle covering a circle
+SELECT ST_Covers(smallc,smallc) As smallinsmall,
+	ST_Covers(smallc, bigc) As smallcoversbig,
+	ST_Covers(bigc, ST_ExteriorRing(bigc)) As bigcoversexterior,
+	ST_Contains(bigc, ST_ExteriorRing(bigc)) As bigcontainsexterior
 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 | smallcoveredbybig | exteriorcoveredbybig | exeriorwithinbig
---------------+-------------------+----------------------+------------------
- t            | t                 | t                    | f
+ smallinsmall | smallcoversbig | bigcoversexterior | bigcontainsexterior
+--------------+----------------+-------------------+---------------------
+ t            | f              | t                 | f
 (1 row)	</programlisting>
+		<para>Geeography Example</para>
+		<programlisting>
+-- a point with a 300 meter buffer compared to a point, a point and its 10 meter buffer
+SELECT ST_Covers(geog_poly, geog_pt) As poly_covers_pt,
+	ST_Covers(ST_Buffer(geog_pt,10), geog_pt) As buff_10m_covers_cent
+	FROM (SELECT ST_Buffer(ST_GeogFromText('SRID=4326;POINT(-99.327 31.4821)'), 300) As geog_poly,
+				ST_GeogFromText('SRID=4326;POINT(-99.33 31.483)') As geog_pt ) As foo;
+
+ poly_covers_pt | buff_10m_covers_cent
+----------------+------------------
+ f              | t
+		</programlisting>
 	  </refsection>
 
 	  <refsection>
 		<title>See Also</title>
-		<para><xref linkend="ST_Contains"/>, <xref linkend="ST_Covers" />, <xref linkend="ST_ExteriorRing"/>, <xref linkend="ST_Within"/></para>
+		<para><xref linkend="ST_Contains"/>, <xref linkend="ST_CoveredBy" />, <xref linkend="ST_Within"/></para>
 	  </refsection>
  </refentry>
 
@@ -561,19 +566,16 @@ FROM (SELECT ST_Buffer(ST_GeomFromText('POINT(1 2)'), 10) As smallc,
 	  <title>Description</title>
 
 	  <para><function>ST_Crosses</function> takes two geometry objects and
-	  returns <varname>TRUE</varname> if their intersection "spatially cross", that is, the
+	  returns <varname>true</varname> if their intersection "spatially cross", that is, the
 	  geometries have some, but not all interior points in common. The
 	  intersection of the interiors of the geometries must not be the empty
 	  set and must have a dimensionality less than the maximum dimension
 	  of the two input geometries. Additionally, the intersection of the two
 	  geometries must not equal either of the source geometries. Otherwise, it
-	  returns <varname>FALSE</varname>.</para>
+	  returns <varname>false</varname>.</para>
 
 	  <para>In mathematical terms, this is expressed as:</para>
 
-	  <remark>TODO: Insert appropriate MathML markup here or use a gif.
-	  Simple HTML markup does not work well in both IE and Firefox.</remark>
-
 	  <informalfigure>
 		<mediaobject>
 		  <imageobject>
@@ -905,7 +907,7 @@ WHERE ST_CrossingDirection(s1.the_geom, s2.the_geom) > 0;
 		<refnamediv>
 			<refname>ST_Disjoint</refname>
 
-			<refpurpose>Returns true if two geometries do not spatially
+			<refpurpose>Returns true if two geometries do not
 			intersect (they have no point in common).
 			</refpurpose>
 		</refnamediv>
@@ -973,7 +975,7 @@ SELECT ST_Disjoint('POINT(0 0)'::geometry, 'LINESTRING ( 0 0, 0 2 )'::geometry);
 	  <refnamediv>
 		<refname>ST_Equals</refname>
 
-		<refpurpose>Returns true if two geometries include the same set of points in space.</refpurpose>
+		<refpurpose>Returns true if two geometries include the same set of points.</refpurpose>
 	  </refnamediv>
 
 	  <refsynopsisdiv>
@@ -1042,8 +1044,8 @@ SELECT ST_Equals(ST_Reverse(ST_GeomFromText('LINESTRING(0 0, 10 10)')),
 		<refnamediv>
 			<refname>ST_Intersects</refname>
 
-			<refpurpose>Returns true if two Geometries/Geography spatially
-			intersect in 2D (have at least one point in common).
+			<refpurpose>Returns true if two geometries
+			intersect (they have at least one point in common).
 			</refpurpose>
 		</refnamediv>
 		<refsynopsisdiv>
@@ -1242,7 +1244,7 @@ SELECT ST_OrderingEquals(ST_Reverse(ST_GeomFromText('LINESTRING(0 0, 10 10)')),
 		<para>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_Overlaps.</para>
+		<function>_ST_Overlaps</function>.</para>
 
 		<para>NOTE: this is the "allowable" version that returns a
 			boolean, not an integer.</para>
@@ -1345,7 +1347,7 @@ FROM (SELECT ST_Buffer(ST_GeomFromText('POINT(1 0.5)'), 3)  As a,
 			<refname>ST_Relate</refname>
 
 			<refpurpose>Tests if two geometries have a topological relationship
-            matching a given Intersection Matrix pattern,
+            matching an Intersection Matrix pattern,
             or computes their Intersection Matrix
             </refpurpose>
 		</refnamediv>
@@ -1605,10 +1607,10 @@ SELECT pat.name AS relationship, pat.val AS pattern,
 			<funcdef>boolean <function>ST_Touches</function></funcdef>
 
 			<paramdef><type>geometry </type>
-			<parameter>g1</parameter></paramdef>
+			<parameter>A</parameter></paramdef>
 
 			<paramdef><type>geometry </type>
-			<parameter>g2</parameter></paramdef>
+			<parameter>B</parameter></paramdef>
 		  </funcprototype>
 		</funcsynopsis>
 	  </refsynopsisdiv>
@@ -1616,14 +1618,13 @@ SELECT pat.name AS relationship, pat.val AS pattern,
 	  <refsection>
 		<title>Description</title>
 
-		<para>Returns <varname>TRUE</varname> if the only points in common between
-		<parameter>g1</parameter> and <parameter>g2</parameter> lie in the union of the
-		boundaries of <parameter>g1</parameter> and <parameter>g2</parameter>.
-		The <function>ST_Touches</function> relation applies
-		to all Area/Area, Line/Line, Line/Area, Point/Area and Point/Line pairs of relationships,
-		but <emphasis>not</emphasis> to the Point/Point pair.</para>
+		<para>Returns <varname>TRUE</varname> if A and B intersect,
+        but their interiors do not intersect.  Equivalently, A and B have at least one point in common,
+        and the common points lie in the intersection of their boundaries.
+		For Point/Point inputs the relationship is always <varname>FALSE</varname>,
+        since points do not have a boundary.</para>
 
-		<para>In mathematical terms, this predicate is expressed as:</para>
+		<para>In mathematical terms, this relationship is expressed as:</para>
 
 		<informalfigure>
 		  <mediaobject>
@@ -1633,7 +1634,7 @@ SELECT pat.name AS relationship, pat.val AS pattern,
 		  </mediaobject>
 		</informalfigure>
 
-		<para>The allowable DE-9IM Intersection Matrices for the two geometries are:</para>
+		<para>This relationship holds if the DE-9IM Intersection Matrix for the two geometries matches one of:</para>
 
 		<itemizedlist>
 		  <listitem>
@@ -1754,7 +1755,7 @@ SELECT ST_Touches('LINESTRING(0 0, 1 1, 0 2)'::geometry, 'POINT(0 2)'::geometry)
 	  <refnamediv>
 		<refname>ST_Within</refname>
 
-		<refpurpose>Returns true if geometry A is completely inside geometry B</refpurpose>
+		<refpurpose>Returns true if no points of A lie in the exterior of B, and A and B have at least one interior point in common.</refpurpose>
 	  </refnamediv>
 
 	  <refsynopsisdiv>
@@ -1779,6 +1780,15 @@ SELECT ST_Touches('LINESTRING(0 0, 1 1, 0 2)'::geometry, 'POINT(0 2)'::geometry)
 		having the same SRID.  It is a given that if ST_Within(A,B) is true and ST_Within(B,A) is true, then
 		the two geometries are considered spatially equal.</para>
 
+        <para>A subtlety of this definition is that the boundary of a geometry is not within the geometry.
+        This means that lines and points lying in the boundary of a polygon or line are <emphasis>not</emphasis> within the geometry.
+        For further details see <ulink url="http://lin-ear-th-inking.blogspot.com/2007/06/subtleties-of-ogc-covers-spatial.html">Subtleties of OGC Covers, Contains, Within</ulink>.
+        (The <xref linkend="ST_CoveredBy" /> predicate provides a more inclusive relationship).
+        </para>
+
+        <para>ST_Within is the inverse of <xref linkend="ST_Contains"/>.
+        So, <code>ST_Within(A,B) = ST_Contains(B,A)</code>.</para>
+
 		<para>Performed by the GEOS module</para>
 
 		<para>Enhanced: 2.3.0 Enhancement to PIP short-circuit for geometry extended to support MultiPoints with few points. Prior versions only supported point in polygon.</para>
@@ -1794,7 +1804,7 @@ SELECT ST_Touches('LINESTRING(0 0, 1 1, 0 2)'::geometry, 'POINT(0 2)'::geometry)
 		<para>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_Within.</para>
+			<function>_ST_Within</function>.</para>
 
 		<para>NOTE: this is the "allowable" version that returns a
 			boolean, not an integer.</para>
@@ -1835,7 +1845,7 @@ SELECT ST_Buffer(ST_GeomFromText('POINT(50 50)'), 20) As smallc,
 
 	  <refsection>
 		<title>See Also</title>
-		<para><xref linkend="ST_Contains"/>, <xref linkend="ST_Equals"/>, <xref linkend="ST_IsValid"/></para>
+		<para><xref linkend="ST_Contains"/>, <xref linkend="ST_CoveredBy"/>, <xref linkend="ST_Equals"/>, <xref linkend="ST_IsValid"/></para>
 	  </refsection>
 	</refentry>
 

-----------------------------------------------------------------------

Summary of changes:
 doc/reference_relationship.xml | 232 +++++++++++++++++++++--------------------
 1 file changed, 121 insertions(+), 111 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list