Skip to main content
10 votes
Accepted

Seeking shapefile of hexagons that covers world?

Uber has recently developed H3, which is a geospatial indexing system using multiple hexagonal grids of different sizes organized hierarchically. There is an R package called h3r that makes it easy ...
rafa.pereira's user avatar
  • 1,277
7 votes

Using Uber H3 hexagon grids in QGIS

You can play with it using my #30DayMapChallenge hexagon demo https://github.com/ThomasG77/30DayMapChallenge/blob/master/day4_hexagons/data/h3-processing.py Except the fact I do no use an UI, I ...
ThomasG77's user avatar
  • 31.2k
6 votes

Using Uber H3 hexagon grids in QGIS

I adapted @ThomasG77's 30 day challenge script into something that can be run from the Qgis processing toolbox. Using Uber's H3 hex grid system in Qgis https://github.com/maphew/code/tree/master/gis/...
matt wilkie's user avatar
  • 28.3k
4 votes
Accepted

Uber H3 DGGS: Table of largest hexagons per resolution?

We don't have a table like this, though we do have a ticket to create one FWIW. For max and min, you don't have to iterate over the entire grid. The smallest cells are the pentagons at the vertices ...
nrabinowitz's user avatar
4 votes
Accepted

Distorted H3 hexagons - even though projection is matching

The definition of EPSG:4326 is simply just a representation of the WGS84 coordinate system which is a 1:1 mapping from the spheroid to an XY plane. And, while WGS84 is the correct spheroid for h3 ...
nagytech's user avatar
  • 3,761
4 votes
Accepted

How to extract the overlay line geometry length using geopandas?

Intersect, calculate line length, sum and merge it back to the polygon df: import geopandas as gpd hexgrid = gpd.read_file(r"C:\GIS\GIStest\hexgrid.shp") hexgrid["gridid"] = range(...
Bera's user avatar
  • 77.8k
3 votes
Accepted

How can cells of a given resolution vary in size if their centers have the same distance from their adjacent cells

H3 is based round an icosahedron that touches the earth sphere at a small number of places. This icosahedron has flat sides. These flat sides are divided into hexagons of equal size and so equal area. ...
Spacedman's user avatar
  • 66.5k
3 votes

Seeking shapefile of hexagons that covers world?

Note that it is impossible to partition a sphere into hexagons only; such a partition must contain some non-hexagonal cells. For example, every resolution of Uber's H3 contains exactly 12 pentagons ...
ksahr's user avatar
  • 31
3 votes
Accepted

Converting line to set of H3 hexagons?

I think this is fine, with two caveats: You should preserve order by using an ordered data structure (and not an unordered set). You should allow for some repetitions by using a data structure that ...
alphabetasoup's user avatar
2 votes

Implementing H3-JS in Mapbox based map to Openlayers based map

If you wish to style the features according to a property "value" as the the Mapbox code you should create corresponding OpenLayers fill styles from your colorScale array var outlineColor = '...
Mike's user avatar
  • 12.9k
2 votes

Seeking Python equivalent to h3_to_polygon of R

Here is what I did to solve the problem. There appears to be no equivalent in Python. # turn h3 hexs into geo. boundary df['geometry'] = df["h3_hexs"].apply(lambda x: h3.h3_to_geo_boundary(h=...
John Stud's user avatar
  • 139
1 vote

Create PostGIS column of a specific H3 hexID/resolution

As commented by @geozelot: Create columns -> Populate columns - that's the deal. This blog uses GENERATED columns to do that, try it. Note that this is not a spatial index in the stricter sense, ...
PolyGeo's user avatar
  • 65.4k
1 vote

How can cells of a given resolution vary in size if their centers have the same distance from their adjacent cells

H3 cell centres are not equal distances apart. I wonder if you've confused the idea of only having one type of cell neighbour relationship (a property of a hexagonal grid), as compared to square or ...
alphabetasoup's user avatar
1 vote

Openlayers H3 Binning works but map only displays on page load

If you make changes to the map div visibility or size you must call map.updateSize(). In your case you must declare map before defining the displayMap function: <script> let map; ...
Mike's user avatar
  • 12.9k
1 vote
Accepted

Get all h3 indexes within a polygon in PostGIS

What is the area of your polygons, say SELECT SUM(ST_Area(poly.way)) FROM planet_osm_polygon WHERE admin_level = '4' I would suspect the H3 resolution could be too high. H3 Level 8 has average area ...
Michael Entin's user avatar
1 vote
Accepted

How to obtain the minimal covering of a circle with H3 hexagons?

One option would be to calculate your polygon as you are now (though I'd probably use a popular geometry library like Shapely rather than my own circle buffering algorithm), but only with a buffer of ...
alphabetasoup's user avatar
1 vote
Accepted

Why is h3.polyfill(geojson, 15) returning empty list for this polygon?

You need to use h3.polyfill_geojson(geojson, 15) or h3.polyfill(geojson, 15, geo_json_conformant=True)
alphabetasoup's user avatar
1 vote

Converting line to set of H3 hexagons?

Solution above proposed by @alphabetasoup works very well with H3 version 3.x With H3 version 4.x you need to follow the migration documentation and make the following replacements: replace geo_to_h3 ...
SeF's user avatar
  • 131
1 vote

Converting line to set of H3 hexagons?

I want to share a discussion from a Github issue. I think it is valuable regarding the question. Nick Rabinowitz said Your approach is what I would have recommended. h3_line has some limitations here ...
gman's user avatar
  • 133
1 vote

Converting line to set of H3 hexagons?

Same problem, similar solution. Only one additional step that seemed to provide a smoother / more accurate result (i.e., H3s that more closely follow the shape of the line). For each set of points ...
cal_mapper's user avatar
1 vote

Distorted h3 hexagons using h3js with Mapbox

Something is definitely off there - while H3 hexagons do have some distortion in various parts of the globe, and while this distortion is further distorted at extreme latitudes when rendered in a ...
nrabinowitz's user avatar
1 vote

Seeking Python equivalent to h3_to_polygon of R

There is a simple equivalent in python: Assumptions: hexagonID: your pandas column name containing hexagon ids geometry: your geometry output column from shapely.geometry import Polygon import h3 ...
Hosein Basafa's user avatar
1 vote

Using Uber H3 hexagon grids in QGIS

Use the Create Grid tool in QGIS, and select hexagons. For a more thorough, but still brief walk-through, see Jonathan Soma's blog. (This is for creating a hex grid, it will not be specific to Uber'...
Unrelated's user avatar
  • 191
1 vote

Using Uber H3 hexagon grids in QGIS

There's the official https://github.com/uber/h3-py Python bindings for H3, a hierarchical hexagonal geospatial indexing system https://uber.github.io/h3/ but I haven't tried it myself.
underdark's user avatar
  • 84.5k

Only top scored, non community-wiki answers of a minimum length are eligible