filosganga / geogson

GeoJSON support for Google gson library
Apache License 2.0
68 stars 29 forks source link

Scientific notation when serializing geometries ? #63

Open straup opened 6 years ago

straup commented 6 years ago

Hi,

First a caveat: I am new to Java so I am entirely open to the possibility that I am just "doing it wrong". Apologies if I am missing something obvious.

I am trying to write the simplest-dumbest tool to read and write Who's On First GeoJSON files, using geogjson. For example, files like this:

https://data.whosonfirst.org/1/1.geojson

Reading the files seems fine but when I call gjson.toJson the output encodes all the coordinates in scientific notation, like this:

https://github.com/aaronland/java-whosonfirst-geojson#usage

The relevant code-y bits are here:

https://github.com/aaronland/java-whosonfirst-geojson/blob/master/src/main/java/org/whosonfirst/geojson/HelloWorld.java#L52-L72

Is this a known-known or have I managed to gloss a simple flag or toggle somewhere ?

Thanks,