google / s2geometry

Computational geometry and spatial indexing on the sphere
http://s2geometry.io/
Apache License 2.0
2.32k stars 308 forks source link

Is the implementation of s2 bound to the earth? #196

Closed jievince closed 3 years ago

jievince commented 3 years ago

Can I use it for other planets, such as Mars? What would I need to change if I used it for Mars?

rsned commented 3 years ago

It's bound to a unit sphere, so any planet or body that is basically spherical would work.

There are some implicit assumptions on things like Latitude [-90, 90] and Longitude [-180, 180] so if your planet didn't have those specific limits it could bite you.

You would also need to adjust the radius you use when scaling to the planets normal dimensions for things like area and distance.

eengle commented 3 years ago

I'm marking this as closed, but feel free to reopen if there are further questions about relating the radian/steradian measures to different shapes (Earth, Mars, etc).