TerriaJS / terriajs

A library for building rich, web-based geospatial data platforms.
https://terria.io
Apache License 2.0
1.16k stars 361 forks source link

Accuracy of measurement with the line tool - investigation #5902

Open AnaBelgun opened 2 years ago

AnaBelgun commented 2 years ago

User feedback:

When in 2D the measure distance tool in Terria draws a straight line. Shouldn't that be the orthodromic line as google maps does? Also, the distances are quite different, 11500 km vs 14700km in Buenos Aires to Darwin. It seems that google maps is the right one (http://www.gcmap.com/mapui?P=DRW-EZE).

image

meh9 commented 2 years ago

There are two issues here, both are in Leaflet/2D mode (there are no problems in Cesium/3D mode):

  1. distance is wrong
  2. straight line should be a great arc in Leaflet mode

For 1 - the distance, I talked to the user and what they actually did was create the distance in two stages. First they clicked on Darwin and then they clicked somewhere between Darwin and South America, then they adjusted the area visible on the screen, and then they moved the second point to Buenos Aires. There is 1 or 2 bugs here: firstly, in 3D mode we can't move points but in 2D you can, secondly when you move a point in 2D the distance is not recalculated. We should decide what to fix.

For 2 - straight line we should make it draw a great circle, hopefully there is just a function to do that in Leaflet already, or on the internet somewhere.

juan-guerschman commented 2 years ago

something from here ? https://leafletjs.com/plugins.html#measurement like this one: https://github.com/ppete2/Leaflet.PolylineMeasure !!! big win win for Terria!!! 👍👍👍

AnaBelgun commented 1 year ago

Update 15 Feb 23: