How to convert the result of Presto `ST_Distance` to meters?

I am trying to figure out a way to convert the result of the preliminary geospatial function ST_DISTANCE into meters.

If I run this example query: SELECT ST_Distance (ST_Point (0.3476, 32.5825), ST_Point (0.0512, 32.4637))

Result from Presto: 0.3193217812802629. The actual distance between the two places is 40,000 m.

The preliminary documentation states that ST_DISTANCE: Returns the 2-dimensional cartesian minimum distance (based on spatial ref) between two geometries in projected units.

What I can understand about spatial reflection is in links such as:    http://webhelp.esri.com/arcgiSDEsktop/9.3/index.cfm?TopicName=Defining_a_spatial_reference

Which makes me believe that I need to understand what the Presto space-reflector uses.

If I checked perst docs here:    https://github.com/prestodb/presto/blob/master/presto-geospatial/src/main/java/com/facebook/presto/geospatial/GeoFunctions.java

I can assume that this is using ESRI libraries, so I assume ESRI is spatial ref? But here is where I am losing a little information about where to continue?

Thank you for your help.

+4
source share
2 answers

From the look at the documents, it seems that presto supports a geometry type, but not a geography type. This means that it does not work with latitude and longitude, which I assume that you supply these point parameters. This is just an arbitrary two-dimensional grid, so the resulting units are in any units that you provided as input.

, , , 32,5 "" 0,5 "" ( ), 0,3193217812802629, , .

0

Presto great_circle_distance() ST_Distance(). WGS84 (aka EPSG: 4326) , .

ST_Distance() , , , - , Presto.

0

Source: https://habr.com/ru/post/1689778/


All Articles