Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add JTS geometry/GeoJson support #28

Merged
merged 2 commits into from
Apr 20, 2017

Conversation

buehner
Copy link
Contributor

@buehner buehner commented Apr 19, 2017

As already proposed in #23, it would be nice to have the ability to access the geometries of addresses. Currently, this is not possible as polygonpoints is deprecated (and always null in the address results!?).

When using the PolygonFormat.GEO_JSON format, geojson will be inlcuded in the result sets , but it has not yet been deserialized by GSON.

To solve this problem, this PR

  • adds a geojson field to the Address model. The type of the new field is com.vividsolutions.jts.geom.Geometry from the popular JTS library.
  • adds a new dependency geogson-jts to register its JtsAdapterFactory and GeometryAdapterFactory to the gsonBuilder, so that the GeoJson can easily be deserialized by Gson (as described here)

I also added a test to check the new functionality.
On top of that, some of the dependencies in the POM have been updated.

@jeremiehuchet
Copy link
Owner

Thanks for you PR,
I will release a new version ASAP

@jeremiehuchet jeremiehuchet merged commit a834869 into jeremiehuchet:master Apr 20, 2017
@jeremiehuchet jeremiehuchet added this to the 3.3 milestone Apr 20, 2017
@jeremiehuchet jeremiehuchet mentioned this pull request Apr 23, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants