ngageoint / opensphere

OpenSphere
Apache License 2.0
185 stars 90 forks source link

gx:LatLonQuad should discard altitude values #1382

Closed wisestmumbler closed 3 years ago

wisestmumbler commented 3 years ago

Have an issue where a third party provides a gx:LatLonQuad with coordinates with altitude but we don't discard them. Farther down we check that the length of the coordinate is 2 (but it fails because altitude is still in there).

See https://github.com/ngageoint/opensphere/blob/master/src/plugin/file/kml/kml.js#L656 https://github.com/ngageoint/opensphere/blob/master/src/os/geo/geo.js#L1426 https://github.com/ngageoint/opensphere/blob/master/src/os/geo/geo.js#L1670

https://developers.google.com/kml/documentation/kmlreference#gx:latlonquad

If a third value is inserted into any tuple (representing altitude) it will be ignored. Altitude is set using and (or ) extending . Allowed altitude modes are absolute, clampToGround, and clampToSeaFloor.