-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simple KD tree is insufficient for coordinate transformation #34
Comments
Hi @danlooo , just a comment, you are doing interesting stuff. Generally I would want that we can do single API calls into DGGRID for single point conversions, just like H3 and S2 are offering it. The thing of course with DGGRID as well as with e.g. rHEALPix or OpenEAGGR is that the correct DGGS model needs to be instantiated first before you can ask it to do any calculations. H3 and S2 have a fixed rotation and and single geometry so single point conversions are always operating already on the hard-coded DGGS model. |
Purely out of curiosity, did you look into working directly in Cartesian coordinates (x, y, z) after transforming lat/long to e.g a unit sphere for this? It seems to me that you could then avoid any projections at all and work in 3D space on the surface of the sphere, where all polygons would have to be more or less regular. |
@asinghvi17 Indeed, there is no difference in terms of accuracy in using either polar or Cartesian coordinates. It's all about finding an efficient data structure for billions or even trillions of cells (We target high-res satellite raster data here). |
We want fast transformation between cell ids and lan/lot coordinates.
Since the DGGRID polygons are regular, we can just store the center points in a KD-Tree and assume a voronoi like partition.
However, this seems to be only true at the planar face of the DGGS polyhedron as demonstrated in this R script using centers and boundaries exported from DGGRID as GeoJSON:
The difference, of course, is the highest near the poles using high shape distorted ISEA projection.
In Addition, the cell_id of some points are different if they are calculated based on DGGRID boundary polygons or voronoi like partitioning of getting the nearest center point neighbor using R function
nngeo::st_nn
with metricsf::st_distance
:Do we really need system calls to DGGRID binary for a single point to cell id look up?
Seems we need to re-project not to the entire sphere, but only to the corresponding face of the DGGS polyhedron.
This would involve to create a custom metric type of Distances.jl that is doing the re-projection to the corresponding polyhedron face.
Am I right, @allixender ?
The text was updated successfully, but these errors were encountered: