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

Provide method to allow user to specify the GeometryFactory #28

Closed
fbl100 opened this issue Sep 6, 2018 · 5 comments
Closed

Provide method to allow user to specify the GeometryFactory #28

fbl100 opened this issue Sep 6, 2018 · 5 comments

Comments

@fbl100
Copy link

fbl100 commented Sep 6, 2018

Provide the user a mechanism to specify the GeometryFactory used in the GeoJSONReader. An example use case for this would be a geometry factory that creates Polygons that properly calculate their area on the surface of the earth.

@fbl100
Copy link
Author

fbl100 commented Sep 6, 2018

FWIW I have a local branch with this working. Not sure if I need special permissions to push my branch for considerations.

@woodsyb-zz
Copy link

This would be awesome. Being able to set precision is pretty important.

@patzi
Copy link
Contributor

patzi commented Oct 12, 2018

Hi, I'd like to work on this as I need the possibility to set the GeometryFactory#SRID . Is see two possible ways to achieve this:

  • change the API of GeoJSONReader, make the factory a settable property and call read(...) like this:
    GeoJSONReader.instance().read(...), where GeoJSONReader.instance() returns a static instance of a GeoJSONReader that would be in the same state as the current version.
    Or:
    GeoJSONReader reader = new GeoJSONReader(); reader.read(...);
  • change read(...) to read(..., GeometryFactory aFactory) and use the existing GeoJSONReader.factory when the argument aFactory is null. Additional I would add read(...) as a shorthand for read(..., null)

What would you prefer @bjornharrtell ? Second would be of course with lot less changes to current users. I could then provide a pull request. A similar approach could also be used for #22

@bjornharrtell
Copy link
Owner

Second option looks pragmatic to me. I found the initial description of this issue hard to understand which is the reason for the lack of response.

@patzi
Copy link
Contributor

patzi commented Oct 12, 2018

OK, then I will make a pull request for this with the second option.

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

No branches or pull requests

4 participants