spherely icon indicating copy to clipboard operation
spherely copied to clipboard

Add support for getting projected coordinates

Open jorisvandenbossche opened this issue 2 years ago • 1 comments

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)

jorisvandenbossche avatar Mar 13 '23 10:03 jorisvandenbossche

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.

benbovy avatar Mar 13 '23 15:03 benbovy

Going to close this, as we now have projection support through either WKB/WKT or for coordinate values through geoarrow.

We can still discuss whether we want something more similar to shapelys get_coordinates` for geographies in general (not just points), and at that point such function could also support projection/tessselation. But let's first discuss that in itself.

jorisvandenbossche avatar Dec 07 '24 14:12 jorisvandenbossche