12.07.2015 Views

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

PostGIS 1.5.8 Manual - Fedora Project Packages GIT repositories

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>PostGIS</strong> <strong>1.5.8</strong> <strong>Manual</strong>182 / 310126.664256056812-- Geography example -- same but note units in meters - use sphere for slightly faster less ←↪accurateSELECT ST_Distance(gg1, gg2) As spheroid_dist, ST_Distance(gg1, gg2, false) As sphere_distFROM (SELECTST_GeographyFromText(’SRID=4326;POINT(-72.1235 42.3521)’) As gg1,ST_GeographyFromText(’SRID=4326;LINESTRING(-72.1260 42.45, -72.123 42.1546)’) As gg2) As foo ;spheroid_dist | sphere_dist------------------+------------------123.802076746848 | 123.475736916397See AlsoST_DWithin, ST_Distance_Sphere, ST_Distance_Spheroid, ST_MaxDistance, ST_Transform7.8.13 ST_HausdorffDistanceST_HausdorffDistance — Returns the Hausdorff distance between two geometries. Basically a measure of how similar ordissimilar 2 geometries are. Units are in the units of the spatial reference system of the geometries.Synopsisfloat ST_HausdorffDistance(geometry g1, geometry g2);float ST_HausdorffDistance(geometry g1, geometry g2, float densifyFrac);DescriptionImplements algorithm for computing a distance metric which can be thought of as the "Discrete Hausdorff Distance". This is theHausdorff distance restricted to discrete points for one of the geometries. Wikipedia article on Hausdorff distance Martin Davisnote on how Hausdorff Distance calculation was used to prove correctness of the CascadePolygonUnion approach.When densifyFrac is specified, this function performs a segment densification before computing the discrete hausdorff distance.The densifyFrac parameter sets the fraction by which to densify each segment. Each segment will be split into a number ofequal-length subsegments, whose fraction of the total length is closest to the given fraction.NoteThe current implementation supports only vertices as the discrete locations. This could be extended to allow an arbitrarydensity of points to be used.NoteThis algorithm is NOT equivalent to the standard Hausdorff distance. However, it computes an approximation that iscorrect for a large subset of useful cases. One important part of this subset is Linestrings that are roughly parallel toeach other, and roughly equal in length. This is a useful metric for line matching.Availability: 1.5.0 - requires GEOS >= 3.2.0

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!