benbovy / spherely

Manipulation and analysis of geometric objects on the sphere.
https://spherely.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
119 stars 8 forks source link

Add support for getting projected coordinates #23

Open jorisvandenbossche opened 1 year ago

jorisvandenbossche commented 1 year ago

Just putting it here as draft PR to show what I was experimenting with (this just projects a single point at the moment).

The reason I started looking at this is because it would be nice to get the coordinates in a certain projection for quick plotting of spherely geography objects (https://dewey.dunnington.ca/post/2022/s2-version-1.1.0/#plotting, https://github.com/r-spatial/s2/blob/76e36ae9ef1348412726e780f6a5a9e4ba0805d8/R/plot.R). But also in general we will want to expose methods to get all the coordinates, and then providing an option to get projected coordinates (in some basic projections that S2 supports) might be nice.

For the plotting, we will also need to add tesselation in the process of getting the projected coordinates (to correctly represent the shortest-path-on-the-sphere in a projection that uses "straight" lines)

benbovy commented 1 year ago

Thanks for looking into this @jorisvandenbossche. I agree it would be nice to have an option to get coordinates in a given projection with support for tessellation.