opendatalab-de / geojson-jackson

GeoJson POJOs for Jackson - serialize and deserialize objects with ease
http://blog.opendatalab.de
Apache License 2.0
263 stars 94 forks source link

Fix for LngLatAltSerializer so that it produces an array of doubles rather than strings #37

Closed Ruckley closed 7 years ago

Ruckley commented 7 years ago

If you look at the geoJson specifications position data should be given as an array of doubles not strings. http://geojson.org/geojson-spec.html#geometry-objects

Theres was also the problem that the Double to String conversion in LngLatAltSerializer performed on lng and lat but not alt. So a 3d point ends up with two strings and a double.

I came accorss this problem when I was trying to use geojson generated by this api with MongoDB. MongoDB is designed to work wth the geoJson spec and so cannot create indexes for the generated geoJson as it expects arrays of Doubles not Strings when dealing with locations.

Ive corrected these problems by removing the fastDoubleToString method from the LngLatAltSerializer.

Ruckley commented 7 years ago

Any action on this PR?

Ruckley commented 7 years ago

Any action on this PR?

Babbleshack commented 7 years ago

This PR looks good, I ran into a similar issue recently! @grundid Are you going to merge this?

grundid commented 7 years ago

no tests :( anyway...