Questions tagged [s2]

Computational geometry and spatial indexing on the sphere This is a package for manipulating geometric shapes. Unlike many geometry libraries, S2 is primarily designed to work with spherical geometry, i.e., shapes drawn on a sphere rather than on a planar 2D map. This makes it especially suitable for working with geographic data.

The tag is for discussing Google S2 spherical geometry library, https://s2geometry.io/, and S2 hierarchical cell indexing in general. Also for discussing its ports to other languages and applications.

https://github.com/google/s2geometry

24 questions
0
votes
1 answer

S2-Cell-Draw, gaps in returned Polygons

I am tagging geospatial data using S2 and would like to display it on a leaflet map, along with the corresponding S2 tile. When I use the library s2-cell-draw to plot the s2 boxes, there is one row with a triangle and unclosed polygons. Image…
mikefreudiger
  • 11
  • 2
  • 4
0
votes
1 answer

Google S2 Geometry: polygon contains check does not work as expected

I'm using the Google S2 Geometry library to check whether a given geo point is within a polygon. The following assertion should pass, but is failing and I'm unable to explain what's going wrong: std::vector vertices = { …
jeffreyveon
  • 13,400
  • 18
  • 79
  • 129
0
votes
1 answer

How does Google S2's use of Hilbert Curve solve (if not, minimize) the problem of closer cells having different prefix values like in Geohash?

In the case of GeoHash, two points that are close can have totally different hash values, making it impossible to do things like prefix comparison. This is due to the fact that somewhere in the ancestry line, there is a split (in geographical…
Aung Khant
  • 324
  • 3
  • 14
0
votes
2 answers

How would I use S2 in a Yelp or Uber service?

Let's say I have a list of restaurants and I have the location of a customer that's looking for restaurants that are nearby. How could I use S2? From my understanding without S2, I would maintain my own Quad Tree that has all the restaurants and…
Dipen
  • 536
  • 2
  • 5
  • 13
0
votes
1 answer

In BigQuery, how can I find the S2_ID at level 16 corresponding to each (latitude, longitude)?

I am working with the Chicago-taxi-trips dataset and I want to find the average fare per pick up location S2_ID at level 16 for the given date, based on the pickup time of the trip S2_ID Chicago-taxi-trips dataset
0
votes
1 answer

TypeError: ljust() argument 2 must be char, not unicode

I'm getting the following error when using the s2sphere library in python2.7 at this location. ljust() argument 2 must be char, not unicode The method is link to the file on GH: @classmethod def from_token(cls, token): """Creates a…
rupello
  • 8,361
  • 2
  • 37
  • 34
0
votes
1 answer

Accuracy for points within distance of 5km

What are the precision characteristics of Google S2 for let’s say two indexed points which are within a radius of 5km? What kind of precision can I expect in mm for a query for these points?
benjist
  • 2,740
  • 3
  • 31
  • 58
0
votes
1 answer

Convert longitude, latitude to cell id from s2 geometry-library python

I am following this tutorials. As explained I can convert the cell id from degrees like below latlng = s2.S2LatLng.FromDegrees(-30.043800, -51.140220) cell = s2.S2CellId.FromLatLng(latlng) But I want to get the cell id from lat lng values (Not from…
Vish K
  • 135
  • 5
  • 14
-1
votes
1 answer

How to aggregate real-time geolocation of user using S2 Geometry Library at different zoom levels?

I am working on an idea where every user (~10,000 Concurrent Users) are streaming their geo-location. I want to aggregate users and display on a map with one single pointer at different zoom levels after that If the user zoom in or zoom out then…
1
2