]> granicus.if.org Git - postgis/commitdiff
move example to ST_HausdorffDistance
authorRegina Obe <lr@pcorp.us>
Tue, 2 Jul 2013 16:11:55 +0000 (16:11 +0000)
committerRegina Obe <lr@pcorp.us>
Tue, 2 Jul 2013 16:11:55 +0000 (16:11 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11608 b70326c6-7e19-0410-871a-916f4a2858ee

doc/reference_measure.xml

index fc194fc81b85a7a2f38965ce4c590ec6e561c76f..9d43aa81ad8b1225b1c89a388d2e3a42aa0e09b6 100644 (file)
@@ -2098,8 +2098,13 @@ The current implementation supports only vertices as the discrete locations. Thi
 
          <refsection>
                <title>Examples</title>
+                   <para>For each building, find the parcel that best represents it. First we require the parcel intersect with the geometry.
+       DISTINCT ON guarantees we get each building listed only once, the ORDER BY .. ST_HausdorffDistance gives us a preference of parcel that is most similar to the building.</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_HausdorffDistance(buildings.geom, parcels.geom);</programlisting> 
 
-                               <programlisting>postgis=# SELECT st_HausdorffDistance(
+                               <programlisting>postgis=# SELECT ST_HausdorffDistance(
                                'LINESTRING (0 0, 2 0)'::geometry,
                                'MULTIPOINT (0 1, 1 0, 2 1)'::geometry);
  st_hausdorffdistance
@@ -2149,11 +2154,7 @@ 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. First we prefer the parcel first that completely covers.
-       Then for those that only partially cover we prefer the parcel whose furthest part from the building closer than any other 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</para>
                <programlisting>postgis=# SELECT ST_MaxDistance('POINT(0 0)'::geometry, 'LINESTRING ( 2 0, 0 2 )'::geometry);
    st_maxdistance