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

Round offsets to integral values #135

Merged
merged 1 commit into from
Jan 18, 2023
Merged

Round offsets to integral values #135

merged 1 commit into from
Jan 18, 2023

Conversation

connormanning
Copy link
Collaborator

COPC validation (link) was identifying data which was unpacking to be outside of its bounds due to the offset not being evenly divisible by the scale factor. For example, the following value:

Scale: 0.01
Offset: [215957.75236873244, 2034592.0870288194, 29.55000000000001]
Bounds (of node): [
    211645.27529721166,
    2033409.4779929873,
    -65.85000000000036,
    211739.02490434938,
    2033503.2276001251,
    27.8996071377328
]
Point: [211708.50236873244, 2033409.4770288193, -21.499999999999993]

Here, the Y-value of this point is less than the minimum-Y value of the bounds of its containing node. It may be true that it's not strictly incorrect, but for practical purposes pinning to a neater number so the associated floating point operations with bounds bisecting etc. will work better.

@connormanning
Copy link
Collaborator Author

Probably the comment here is still inaccurate, this PR does not attempt to preserve things like scale=0.1 offset=50.042 for example, where the source data would have raw values which are not pinned to the 0.1 grid.

@hobu hobu merged commit 4017aa2 into main Jan 18, 2023
@hobu hobu deleted the integral-offset branch January 18, 2023 23:03
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.

2 participants