You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just ran a conversion using polyline.fromGeoJSON(feature) on some data and when I reconverted back to geojson using polyline.toGeoJSON(mPolyline) I got some weird results.
I dug into my source geojson then noticed it had [x, y, elevation] coordinates, so I trimmed to [x, y], and this produced the expected results.
Yikes. There is also #43 which asks for 3d support, but since the resulting polyline encoding needs to know if it's 2d or 3d, I think it should be opt in and the default should be to ignore any extra coordinates, so consider the current behaviour a bug.
If you had a PR I can provide a second set of eyes to review and we can ping Tristen to try and get it merged, but if not that's fine also.
I just ran a conversion using
polyline.fromGeoJSON(feature)
on some data and when I reconverted back to geojson usingpolyline.toGeoJSON(mPolyline)
I got some weird results.I dug into my source geojson then noticed it had [x, y, elevation] coordinates, so I trimmed to [x, y], and this produced the expected results.
I'd guess these lines are responsible
https://github.com/mapbox/polyline/blob/master/src/polyline.js#L109-L113
Anyway just a word of warning to others, check your inputs :)
The text was updated successfully, but these errors were encountered: