I have the following linestring which approximately marks an airport runway:
LINESTRING(-381578.819887 6574044.360475, -378513.534443 6574799.475787) # EPSG 3857 LINESTRING(-3.427781 50.732117, -3.400245 50.73641) # EPSG 4326
If I use the GLength function, I get a length of
SELECT GLength(GeomFromText('LINESTRING(-381578.819887 6574044.360475, -378513.534443 6574799.475787)')) 3156.925m # EPSG 3857 SELECT GLength(GeomFromText('LINESTRING(-3.427781 50.732117, -3.400245 50.73641)')) 0.027869° # EPSG 4326 ~ 0.027869 x 111319.9 = 3102m
The actual length of this runway is 2076m. QGIS will display this correct distance if I check the ellipsoidal box using the measure tool, so I assume this performs a projection/trigonometry conversion. Yet, I can't seem to find the correct calculation to replicate this conversion and go from the (planar?) distance returned by the GLength function to the real distance.
Can anyone direct me to a tutorial for this?
This question is a continuation of my pervious question How can I get the ellipsoidal values for length and area using spatialite? which got side tracked into correcting a different issue.