turf-swift icon indicating copy to clipboard operation
turf-swift copied to clipboard

Altitude, Elevation or LocationCoordinate3D

Open paulsUsername opened this issue 3 years ago • 3 comments

Is there any roadmap for the addition of altitude data (by convention the 3 Double in the array of Coords in a Geometry LineString Object is an optional altitude value).

Or is there any know branch or fork with this functionality?

paulsUsername avatar Jan 30 '22 12:01 paulsUsername

This library has always used CLLocationCoordinate2D in order to better integrate with frameworks in the Apple ecosystem such as Core Location. We could define our own Position struct with an altitude property, but it would require us to provide conversions to and from CLLocationCoordinate2D. We’d need to make sure relying so heavily on these conversions wouldn’t significantly affect performance for the very common use cases that require CLLocationCoordinate2D.

1ec5 avatar Feb 02 '22 19:02 1ec5

If we move off CLLocationCoordinate2D as the principle data type, we should consider depending on an SPM package that conditionally includes Core Location on Apple platforms, as a more seamless way to support Core Location and Linux simultaneously.

Edit: wrong link, wrong library.

1ec5 avatar Feb 02 '22 19:02 1ec5

In the meantime, GeoJSON and GEOSwift both support representing altitudes as part of positions.

1ec5 avatar Feb 02 '22 19:02 1ec5