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

Reduce precision to 8 places for query tokens (including BBOX) so that tests pass #949

Closed

Conversation

jchamberlain
Copy link
Contributor

The purpose of this PR is to make tests pass on Apple silicon without breaking tests for x86. The assumption (possibly incorrect) is that 8 places of precision is enough for scale demoninator, pixel width and height, and bounding box.

@jchamberlain
Copy link
Contributor Author

There's more going on here than just precision. I tried getting the TestGenerateTilesForBounds test passing without fully understanding it, but now realize it's failing on arm64 but not amd64 because overflow of unsigned ints is implementation-specific (see golang/go#52943). We'll need a different solution for that test case.

@gdey
Copy link
Member

gdey commented Sep 9, 2023

Sounds like there is still an issue here. Were you looking for advice or looking to find a new way to write this test case?

@jchamberlain
Copy link
Contributor Author

jchamberlain commented Sep 11, 2023

Looking for feedback, including advice on other approaches. I've never used Tegola or anything go-spatial before a couple weeks ago, so I'm assuming there are probably obvious things I'm missing. Any pointers are appreciated.

  • TestGenerateTilesForBounds is failing in master because of a bug in go-spatial/geom which is fixed in more recent versions, but it's not a simple upgrade because many of the functions Tegola relies on have been removed. I've worked through most of it, but the one piece I'm missing now is the ability to transform a geom.Extent of SRID 3857 to SRID 4326. The geom package doesn't seem to include that capability. If such a capability already exists, can you point me to it?
  • The precision changes in this PR aren't enough to make tests pass after the go-spatial/geom upgrade. geom must be doing math differently enough that floats end up being substantially different in some cases (e.g., -1.0021200154904785e+07 instead of -1.017529720390625e+07).

I've opened #951 to track this better.

@jchamberlain
Copy link
Contributor Author

This address the first part of #951.

I've removed the changes to TestGenerateTilesForBounds as that is handled in #952. Now this contains only precision formatting changes.

Copy link
Member

@gdey gdey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, should wait to deploy after the upgrade to geom PR is through.

@coveralls
Copy link

Pull Request Test Coverage Report for Build f609b1416-PR-949

  • 7 of 7 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 46.855%

Totals Coverage Status
Change from base Build a6f1b0cd3: 0.0%
Covered Lines: 6571
Relevant Lines: 14024

💛 - Coveralls

@ARolek
Copy link
Member

ARolek commented Nov 9, 2023

I just merged this into master but the PR didn't close. ref: b7ad33b

@ARolek ARolek closed this Nov 9, 2023
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.

4 participants