Ege Rubak

Associate Professor at Aalborg University, Denmark

Mainly interested in spatial and computational statistics with a focus on spatial point patterns.

Co-developer on the R package

`spatstat`

together with Rolf Turner and main author Adrian Baddeley.

We are working on an extension/plugin to

`spatstat`

(called`spatstat.sphere`

) where we want to analyse spatial point patterns directly on the sphere without projection.We found a hidden gem in the Google S2 Geometry Library written in C++, which we have (partially) ported to R using the Rcpp package to interface the C++ code (so it is still reasonably fast).

It is also (partially) implemented in NodeJS, Java, Go and Python. The original source code is available here: https://code.google.com/archive/p/s2-geometry-library/

The main reference is the source code comments and a short presentation by a Google employee (which my presentation in the following is heavily inspired from): https://docs.google.com/presentation/d/1Hl4KapfAENAOf4gv-pSngKwvS_jwNVHRPZTTDzXXn6Q

It can e.g.Â be used for building a spatial database index, which is used by companies like Google, Uber, Foursquare, etc.

- Draw a cube around the sphere. Then each ray starting from the center of the sphere will define a projection of a point on the sphere onto the cube and vice versa: