Open astrojuanlu opened 6 years ago
(Notice that there is the combination of two problems here, see #23)
A good starting point for geodesic buffering is this exquisite paper "Algorithms for geodesics" by Charles F. F. Karney, where modern algorithms to compute the direct and inverse problems of the geodesic distance are developed:
https://arxiv.org/abs/1109.4448
(discovered from https://www.wikiwand.com/en/Vincenty%27s_formulae)
An undocumented version of the direct problem is implemented in GeoPy:
and also in Pyproj:
Hit by this today, I might try and fix it.
There is a broader question here, that is: what to do with an operation that produces a result that is not representable in the original CRS?
This is exactly the case of the geodesic buffering: imagine that we have a point in EPSG:3857 close to 85 deg latitude. If we do a big buffer, the result can contain the pole, which is not representable in EPSG:3857 anymore. Naturally we would "cut-off" this part for visualization, but what about for storing it? Options:
More ideas?
Cartopy already visualizes it correctly:
But the core problem of telluric is still that a reproject
might turn a valid geometry into an invalid one:
In [6]: geod_buffer = p0.reproject(azeq_p0).buffer(5000_000)
In [7]: geod_buffer.is_valid
Out [7]: True
In [8]: geod_buffer.reproject(WEB_MERCATOR_CRS).is_valid
Out [8]: False
Complete notebook: https://nbviewer.jupyter.org/gist/Juanlu001/a01e396e2364274a4a50af61eb15f6ce
See also #154.
Expected behavior and actual behavior
When doing
GeoVector.buffer
the user would expect for proper geodesic buffering to happen, as described in this article:https://www.esri.com/news/arcuser/0111/geodesic.html
Instead, the wrong result is displayed.
Steps to reproduce the problem
Operating system and installation details
Linux, latest telluric.