Add Geospatial geography files with statistics#109
Open
paleolimbot wants to merge 4 commits into
Open
Conversation
Member
|
Hmm, can the files be smaller? |
Member
Author
|
That's a great point...the biggest one is now 60 KB and gets the same point (or line or polygon, as it may be) across. |
Member
Accross the antimeridian, right? |
Member
Can you add this to the geospatial README? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds some geography test files with statistics that may be useful in testing implementations. Notably, geography statistics can have
xmin > xmaxsuch that row group statistics can "wrap around" the antimeridian (e.g., so that ship position statistics in the pacific ocean, or a catalogue of wildlife in Fiji do not have longitude bounds that span the globe).I recently implemented this in SedonaDB ( apache/sedona-db#805 ) based on the pluggable statistics writer in arrow-rs ( apache/arrow-rs#8414 ).
The underlying stats are coming from s2geometry's S2LatLngRectBounder ( https://github.com/google/s2geometry/blob/master/src/s2/s2latlng_rect_bounder.h ) via s2geography ( https://github.com/paleolimbot/s2geography/blob/main/src/s2geography/coverings.h#L13-L19 ). I'd love to simplify that and just have it all in a self-contained implementation but certain components of bounding on the sphere (e.g., if a polygon contains the north pole) are non-trivial.
The files are basically uniformly distributed (on the sphere) points, segements (basically sequential points sorted on a hilbert curve), and polygons (buffered points, basically rectangles). Both lines and polygon have some geographies that cross the antimeridian, and all the files have at least two row groups with wraparound statistics. All the files have at least one geometry intersecting the north pole and one intersecting the south pole (for polygons, the geometry contains it).
These aren't exhaustive cases for geographical testing but the addition of the wraparound statistics will hopefully help ensure pruning is correct.