Turf: interpolate elevation in all computations

Created on 11 Jun 2016  路  2Comments  路  Source: Turfjs/turf

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 馃槂

enhancement

Most helpful comment

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

All 2 comments

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!

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

Was this page helpful?
0 / 5 - 0 ratings