benbovy / pys2index

Python/NumPy compatible geographical index based on s2geometry

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

change distance unit

carloshorn opened this issue · comments

Change Proposal

In the current implementation, the nearest neighbor query returns distances in unit of degrees. I would propose to change the units to either arc length on unit sphere (radians) or meters.

Reason(s) for the Change

If working with geo-locations, the user is normally interested in distances on earth which are typically given in a length unit, e.g. meters. Radians are also fine, because a user would just need to multiply by a radius in length unit.
Furthermore, an inexperienced user might be confused by this unit, because latitudes and longitudes come with the same unit, but for instance longitude differences would only correspond to these differences at the equator.

Implementation Proposal

I would provide the distances in radians and forward the S2 earth radius constant to the pys2index api.