turf icon indicating copy to clipboard operation
turf copied to clipboard

interpolate elevation in all computations

Open pcardune opened this issue 8 years ago • 3 comments

According to the geojson spec, positions can include a 3rd number to represent elevation. It looks like turf does not support elevation in any way. It would be awesome if turf could (optionally) interpolate elevation in all computatations. Is this something other people are interested in? I'd be willing to add support assuming someone is willing to accept my pull requests 😃

pcardune avatar Jun 10 '16 23:06 pcardune

Hey Paul!

Yep, as it currently stands, Turf doesn't support the elevation parameter in GeoJSON in any meaningful way. This was a combination of two factors:

  1. It's kind of hard to implement
  2. The GeoJSON spec didn't specify a unit or meaning for the altitude coordinate of a position

Luckily, #2 is no longer the case! The IETF draft in section 4 specifies the meaning of altitude: https://tools.ietf.org/html/draft-ietf-geojson-03#section-4

An OPTIONAL third position element SHALL be the height in meters above or below the WGS 84 reference ellipsoid. In the absence of elevation values, applications sensitive to height or depth SHOULD interpret positions as being at local ground or sea level.

So that's cleared up. Happy to accept any PRs that interpolate/include elevation when it's present!

tmcw avatar Jun 13 '16 15:06 tmcw

👍 Support having elevation in all computations, reference https://github.com/Turfjs/turf/issues/628.

DenisCarriere avatar Apr 08 '17 18:04 DenisCarriere

I too am interested in the addition of the altitude element and this becoming significant in the calculation of distance.

To that end, I did find the following useful response along the same lines, which demonstrates how to add the altitude distance calculation:

https://stackoverflow.com/questions/64877775/calculate-distance-between-two-coordinates-with-short-distances-considering-alt

pbelbin avatar May 15 '22 04:05 pbelbin