<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>
</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
-----------------
<!-- 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>