What should I do to find the distance between two very far points?
p1 = "POINT(6.2 61.1)"
p2 = "POINT(6.1 61.0)"
select
ST_Distance(
ST_Transform(ST_GeomFromWKT('$p1'), 'EPSG:4326', '$epsg'),
ST_Transform(ST_GeomFromWKT('$p2'), 'EPSG:4326', '$epsg')
) as distance
with EPSG:3857 this is 25550.25
but with EPSG:32632 I'm got 12382.11 and leaning on Google that's right.
I'm using GeoSpark library in my calculations.
Update: My range of longitude approximately from 20 to 190
Update 2: I can't use PostGIS, I'm using Hadoop and GeoSpark
In global, my objective is find nieghbors polygons in 500 meters, where I use epsg:3856, and then precise distance with local EPSG which i find with that function: `val epsgCode: Geometry => String = { g => val lat: Double = g.getCentroid.getX;
}`
– K. Kostikov Apr 01 '19 at 11:18