2. “flat two-dimensional projections (similar to an atlas) on a
three-dimensional sphere (similar to a globe).”
“While the Earth is not quite spherical, it is much closer to
being a sphere than it is to being flat!”
What
13. Hilbert Space Filling Curve
● Map points in multidimensional space to a one-dimensional space
● spatially similar objects are given close numeric indices
● Fractal
16. ● hierarchy (is cell x contained by cell y?)
● neighbour queries (return all adjacent cells on the same level)
O(1) Time & Space Complexity
O(1) is a constant number of ops, not dependant on N, but usually > 1.
That's still considered very fast for geo ops, especially neighbour queries.
Bit Operations
17. 1. Projecting six faces of a cube onto the unit sphere
2. Partitioning each cell into four children recursively using a quadtree
3. For all of the cells of a given level :
a. Enumerate cell Ids along a hilbert space filling curve
Building a S2 cell hierarchy
18. ● S2Builder
● S2ShapeIndex - Spatial Indexing
○ A.K.A “S2 Cover” / “Region Coverer”
○ Building a S2 cell hierarchy
Main Clases
25. ● Growth Prediction
○ Learning “how many # (users/sessions/events) will I have in the future” on a cell level.
○ Given a future date & cell, what will be the #amount?
● Reverse Geocoding
○ A wrapper of S2ShapeIndex
○ Inclusion queries over coordinates
○ Given (longitude,latitude) what city (polygon) does it belong to?
Use Cases