qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.43k stars 2.99k forks source link

Add H3 grid to "Create Grid" tool #43531

Open tjukanovt opened 3 years ago

tjukanovt commented 3 years ago

Feature description. As the H3 grid is becoming more and more widely used, it would be nice to have support for that in QGIS.

Additional context A logical place to have this would be IMHO in the Create Grid algorithm. It does already have support for hexagons, but those are not the "standard" H3 hexagons. Could be useful if the user could select the resolution and the extent.

We have initially discussed that @Joonalai could be interested in developing this feature. But all comments, questions and inputs are very much welcome.

Also this discussion could be helpful: https://gis.stackexchange.com/questions/310555/using-uber-h3-from-qgis and there is also a link to a PyQGIS implementation by @maphew --> https://github.com/maphew/code/blob/master/gis/qgis/h3-grid-from-layer.py

Joonalai commented 3 years ago

Indeed, as @tjukanovt mentioned, I would be willing to join QGIS dev community and this would be a great feature to start the journey with!

lbartoletti commented 3 years ago

Indeed, as @tjukanovt mentioned, I would be willing to join QGIS dev community and this would be a great feature to start the journey with!

Feel free to add the algorithm in src/analysis/processing/qgsalgorithmgrid.cpp with test file.

We can help you if you want.

And BTW, welcome :)

Joonalai commented 3 years ago

@lbartoletti the PyQGIS script has an external dependency h3-py, which is a binding of H3 Core Library written in C. What would be a best approach to apply an external H3 dependency?

Joonalai commented 2 years ago

@lbartoletti what do you think?

arongergely commented 2 years ago

Hi @Joonalai, I made an H3 plugin which adds grid creation tools via an 'H3' processing provider. I just submitted it to the plugin repository today.

If you would like to take a look, here is the repo: https://github.com/arongergely/qgis-h3-toolkit-plugin

hamiltoncj commented 2 years ago

I just saw this. I have also implemented H3 in the Density Analysis plugin. https://plugins.qgis.org/plugins/densityanalysis/

In this case I am using it to geohash points to H3 locations to do density analysis. Traditional methods would be to use the QGIS create grid (hexagon) and then do a count points in polygon, but with H3 this is orders of magnitude faster.

I recommend H3 to be added to QGIS. If I were more into c++ and had a developers environment, I would implement some of the Density Analysis plugin code into core QGIS algorithms, but I don't have an environment set up to do this and my C++ is very rusty.

In the Density analysis plugin you can compare the difference in speed with the QGIS create grid method, vs geohash, vs H3 geohash.