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

New Geometry has old Precision Model #8

Open
pramsey opened this issue Aug 24, 2020 · 4 comments
Open

New Geometry has old Precision Model #8

pramsey opened this issue Aug 24, 2020 · 4 comments

Comments

@pramsey
Copy link

pramsey commented Aug 24, 2020

Why is the geomFact, which is used to create the resultant geometry, a reference to the factory from geom0 instead of a new construction based on pm?

@pramsey
Copy link
Author

pramsey commented Aug 24, 2020

In adding the NG precision reduction to the CAPI in GEOS, I had to add an OverlayNG constructor that took a GeometryFactory, in order to obey GEOS ownership rules. Relevant changes are here: pramsey/geos@678babd

@dr-jts
Copy link
Owner

dr-jts commented Aug 27, 2020 via email

@pramsey
Copy link
Author

pramsey commented Aug 27, 2020

I can grok that. For precision reduction though, I think it makes sense to build the new geometry with a precisionModel that matches the reduced geometry? Or maybe not? The assumption in the existing GEOS code is that the new geometry gets a new coarse precisionModel, so I aped that. However, reducing precision while retaining a FLOAT model is also a valid use case. ... Reasoning about precision is hard!

@pramsey pramsey closed this as completed Aug 27, 2020
@dr-jts
Copy link
Owner

dr-jts commented Aug 27, 2020

For precision reduction though, I think it makes sense to build the new geometry with a precisionModel that matches the reduced geometry? Or maybe not? The assumption in the existing GEOS code is that the new geometry gets a new coarse precisionModel, so I aped that. However, reducing precision while retaining a FLOAT model is also a valid use case. ... Reasoning about precision is hard!

I think there's an argument to be made for offering both options. But not sure what the best/simplest API is for doing this. Usually in this kind of design situation I like to factor out the two functions into separate API calls, to provide generality.

JTS provides the GeometryPrecisionReducer.setChangePrecisionModel method to allow the user to choose the behaviour wanted.

@dr-jts dr-jts reopened this Aug 27, 2020
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

2 participants