]> granicus.if.org Git - postgis/commitdiff
useful real world example of using ST_MaxDistance
authorRegina Obe <lr@pcorp.us>
Tue, 2 Jul 2013 13:55:48 +0000 (13:55 +0000)
committerRegina Obe <lr@pcorp.us>
Tue, 2 Jul 2013 13:55:48 +0000 (13:55 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11604 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_measure.xml

index d9e0dde8e466b4a2d17278a2f10f0c57854f52d1..b147ce023c60a33697af8fcaa5d1bee7a42123e2 100644 (file)
@@ -2138,11 +2138,9 @@ The current implementation supports only vertices as the discrete locations. Thi
   <refsection>
     <title>Description</title>
 
-    <para>Some useful description here.</para>
-
     <!-- optionally mention that this function uses indexes if appropriate -->
     <note>
-      <para>Returns the 2-dimensional maximum distance between two linestrings in
+      <para>Returns the 2-dimensional maximum distance between two geometries in
                projected units. If g1 and g2 is the same geometry the function will return the distance between
                the two vertices most far from each other in that geometry.</para>
     </note>
@@ -2151,7 +2149,12 @@ The current implementation supports only vertices as the discrete locations. Thi
   </refsection>
   <refsection>
     <title>Examples</title>
-
+       <para>For each building, find the parcel that best covers it. The answer will return at most one record per building
+and will return the parcel that it intersects and parts of building that don't intersect the furthest part of building is closest to this parcel.</para>
+               <programlisting>SELECT DISTINCT ON(buildings.gid) buildings.gid, parcels.parcel_id 
+   FROM buildings INNER JOIN parcels ON ST_Intersects(buildings.geom,parcels.geom) 
+     ORDER BY buildings.gid, ST_MaxDistance(buildings.geom, parcels.geom);</programlisting>
+     <para>Basic furthest distance the point is to any part of the line</
                <programlisting>postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry);
    st_maxdistance
 -----------------
@@ -2168,7 +2171,7 @@ postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 2, 2 2 )
   <!-- Optionally add a "See Also" section -->
   <refsection>
     <title>See Also</title>
-<para><xref linkend="ST_Distance"/>, <xref linkend="ST_LongestLine"/></para>
+<para><xref linkend="ST_Distance"/>, <xref linkend="ST_LongestLine"/>, <xref linkend="ST_DFullyWithin" /></para>
   </refsection>
 </refentry>