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

Allow specifying a fixed PrecisionModel via grid size #804

Merged
merged 1 commit into from
Nov 24, 2021

Conversation

dr-jts
Copy link
Contributor

@dr-jts dr-jts commented Nov 24, 2021

This enhancement allows specifying a fixed PrecisionModel via the grid size, instead of the scale factor. This is done by providing a negative value to the PrecisionModel constructor.

This is used to specify precise integral grid sizes, and provides a more accurate and robust rounding. Otherwise an integral grid size must be specified by the reciprocal scale factor, which in most cases cannot be computed exactly, and hence causes undesirable decimal places in computed precise values.

Internally the scale factor is computed as the reciprocal of the (positive) grid size value.

Signed-off-by: Martin Davis [email protected]

@dr-jts dr-jts merged commit 963738d into locationtech:master Nov 24, 2021
@dr-jts dr-jts deleted the add-pm-gridsize branch November 24, 2021 19:34
pramsey added a commit to pramsey/geos that referenced this pull request Nov 26, 2021
@jodygarnett jodygarnett added this to the 1.19.0 milestone Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants