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

Compose WebMercatorGridPointSet with WebMercatorExtents to reduce duplication #895

Closed
wants to merge 4 commits into from

Conversation

abyrd
Copy link
Member

@abyrd abyrd commented Oct 17, 2023

DRAFT PR trying out reuse of code from WebMercatorExtents. Some logic was slightly different between the two, this makes it more uniform with less duplication.

Note this branches off of another PR branch, not against dev.

abyrd added 3 commits October 19, 2023 17:09
Includes test which passes with these changes in place.
Also added and updated Javadoc.
This is a more minimal changeset than originally proposed, to facilitate
review and contain risk from changing heavily used math functions.
This complements forTrimmedWgsEnvelope to handle numerical instability
or imprecision in a different case: tight bounds around sets of points
that must fall into the resulting grid.
These existed in two places: on Grid and WebMercatorGridPointSet.
I retained the more general version that takes a zoom parameter.
Math functions were all switched to Java built-in standard Math.

We used both FastMath and Java standard Math. FastMath existed because
standard Math used to be strict, but Java now has separate StrictMath
and standard Math is optimized. This still deserves to be profiled.

Also removed IsochroneFeature which is unused, but called some removed
functions. IsochroneFeature was ported to JS as Jsolines, and sees
destination travel times as being located at the top left corner of
Mercator pixels. Removing it eliminates a source of confusion if someone
sees unused code using pixel corners.
@abyrd abyrd force-pushed the merge-extents-with-pointset branch from 4bb6947 to d0f0f9c Compare October 19, 2023 16:54
Height and width in WebMercatorGridPointSet constructor were often one
unit too narrow (not consistent with WebMercatorExtents).
@abyrd abyrd force-pushed the merge-extents-with-pointset branch from d0f0f9c to a095984 Compare October 19, 2023 17:08
@abyrd
Copy link
Member Author

abyrd commented Oct 19, 2023

Duplicate of #900, closing

@abyrd abyrd closed this Oct 19, 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.

1 participant