PostGIS 1.5.1 Manual 185 / 315 st_distance ------------------ 126.664256056812
PostGIS 1.5.1 Manual 185 / 315 st_distance ------------------ 126.664256056812 -- Geography example -- same but note units in meters - use sphere for slightly faster less ← - accurate SELECT ST_Distance(gg1, gg2) As spheroid_dist, ST_Distance(gg1, gg2, false) As sphere_dist FROM (SELECT ST_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.475736916397 See Also ST_DWithin, ST_Distance_Sphere, ST_Distance_Spheroid, ST_MaxDistance, ST_Transform 7.8.13 ST_HausdorffDistance Name ST_HausdorffDistance – Returns the Hausdorff distance between two geometries. Basically a measure of how similar or dissim- ilar 2 geometries are. Units are in the units of the spatial reference system of the geometries. Synopsis float ST_HausdorffDistance(geometry g1, geometry g2); float ST_HausdorffDistance(geometry g1, geometry g2, float densifyFrac); Description Implements algorithm for computing a distance metric which can be thought of as the "Discrete Hausdorff Distance". This is the Hausdorff distance restricted to discrete points for one of the geometries. Wikipedia article on Hausdorff distance Martin Davis note 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 of equal-length subsegments, whose fraction of the total length is closest to the given fraction. Note The current implementation supports only vertices as the discrete locations. This could be extended to allow an arbitrary density of points to be used. Note This algorithm is NOT equivalent to the standard Hausdorff distance. However, it computes an approximation that is correct for a large subset of useful cases. One important part of this subset is Linestrings that are roughly parallel to each other, and roughly equal in length. This is a useful metric for line matching. Availability: 1.5.0 - requires GEOS >= 3.2.0 PostGIS 1.5.1 Manual 186 / 315 Examples postgis=# SELECT st_HausdorffDistance( ’LINESTRING (0 0, 2 0)’::geometry, ’MULTIPOINT (0 1, 1 0, 2 1)’::geometry); st_hausdorffdistance ---------------------- 1 (1 row) postgis=# SELECT st_hausdorffdistance(’LINESTRING (130 0, 0 0, 0 150)’::geometry, ’ ← - LINESTRING (10 10, 10 150, 130 10)’::geometry, 0.5); st_hausdorffdistance ---------------------- 70 (1 row) 7.8.14 ST_MaxDistance Name ST_MaxDistance – Returns the 2-dimensional largest distance between two geometries in projected units. Synopsis float ST_MaxDistance(geometry g1, geometry g2); Description Some useful description here. Note Returns the 2-dimensional maximum distance between two linestrings 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. Availability: 1.5.0 Examples postgis=# SELECT ST_MaxDistance(’POINT(0 0)’::geometry, ’LINESTRING ( 2 0, 0 2 )’::geometry ← - ); st_maxdistance ----------------- 2 (1 row) postgis=# SELECT ST_MaxDistance(’POINT(0 0)’::geometry, ’LINESTRING ( 2 2, 2 2 )’::geometry ← - ); st_maxdistance ------------------ 2.82842712474619 (1 row) uploads/Finance/ guide-ruby.pdf
Documents similaires
-
31
-
0
-
0
Licence et utilisation
Gratuit pour un usage personnel Attribution requise- Détails
- Publié le Dec 03, 2022
- Catégorie Business / Finance
- Langue French
- Taille du fichier 0.1155MB