Questions tagged [h3]
H3 is an open source geospatial indexing system using a hexagonal grid that can be subdivided into finer and finer hexagonal grids.
119
questions
15
votes
4
answers
9k
views
How to generate shapefiles for H3 hexagons in a particular area
I would like to generate shapefiles for H3 hexagons in a specific geographic area. Particularly, I'm interested in the Bay Area with resolutions = 6, 7 and 9. How can I create the shapefiles for the ...
6
votes
4
answers
9k
views
How to convert shapefile/geojson to hexagons using uber h3 in python?
I want to create hexagons on my geographic map and want to preserve the digital boundary specified by the shapefile/geojson as well.
How do I do it using uber's h3 python library?
I'm new to ...
6
votes
1
answer
4k
views
How to choose the suitable h3 resolutions when use polyfill?
The H3 library offers hexagon grids at many resolutions - how should I choose the suitable h3 resolutions when using polyfill?
6
votes
4
answers
4k
views
Uber h3 for finding distance between two geo locations
I read the h3 doc and I am not sure finding the absolute distance between two geo point is one of the use case. There are formulas for it like in this page or google maps provides API for it. I see an ...
6
votes
2
answers
1k
views
Android h3: A Hexagonal Hierarchical Geospatial Indexing System
I want to integrate h3 java binding library to my android app and I'm getting following exception:
java.lang.UnsatisfiedLinkError: No native resource found at /android-armv7l/libh3-java.so
at com....
5
votes
1
answer
2k
views
H3 hexagons not matching
I'm trying to use the polyfill function with the Python's h3 implementation, but I'm recieving unexpected results.
If I use the function with fixed resolution, I can get and show a polygon grid as ...
5
votes
1
answer
2k
views
How to find the locations (indices whose lat long co-ordinates are stored in geo-json format) within 5 Km radius of a h3 index in h3-js?
I'm creating a hyper local delivery service app . I can only receive order if there is a store within 5 km radius from the user . I stored the store locations in geojson format . Is there a function ...
4
votes
1
answer
2k
views
How to identify the hexagons which overlap with a given geofence?
The H3 API reference introduced polyfill, the idea of which is "a point-in-poly operation on every hexagon in a k-ring defined around the given geofence". The questions are:
I don't ...
2
votes
1
answer
1k
views
Drawing a hex grid over a Geopandas map
I'm trying to draw a hex grid over a world map. The latter can be done easily enough with Geopandas:
import geopandas
import matplotlib.pyplot as plt
world = geopandas.read_file(geopandas.datasets....
2
votes
1
answer
250
views
How can I get vertices for only the outside edges of a hexRing() in H3?
The gist of this is pretty straight forward, even if the implementation isn't...
I want to get the outside edges of a hexRing, as opposed to all edges of the hexagons. Pretty much creating a single ...
2
votes
1
answer
1k
views
How to find the neighbour indexes/cells of a base cell at a given radius(Km) in the H3 library
I have no idea how to find the neighbouring cells of the base cell at a given radius(Km). How can I achieve this? If possible for the h3-go library as I am familiar with Go.
2
votes
2
answers
2k
views
H3 hexagons render with swapped lat, long in kepler.gl
I want to plot H3 hexagons. Of Austria.
Download and unzip
https://biogeo.ucdavis.edu/data/gadm3.6/gpkg/gadm36_AUT_gpkg.zip
The full code is available at https://gist.github.com/geoHeil/...
2
votes
1
answer
134
views
Spark DataFrame apply Databricks geospatial indexing functions
I have a spark DataFrame with h3 hex ids and I am trying to obtain the polygon geometries.
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, expr
from pyspark.databricks.sql....
2
votes
1
answer
2k
views
h3-js in a web worker: document is not defined
I'm trying to use h3-js inside a web worker. The error I get is:
Uncaught ReferenceError: document is not defined
at libh3-browser.js:6
at Module../node_modules/h3-js/dist/browser/h3-js.es.js ...
2
votes
0
answers
51
views
H3-go library not running
I am newbie to golang who usually uses python.
what I did:
copied sample from https://github.com/uber/h3-go
pasted it in local machine
Run go run main.go which was the code placed.
The output:
github....
2
votes
0
answers
370
views
plot h3 hexagons with folium
I´m trying to plot some h3 hexagons with folium using .explore
Here is my code:
B['h3_code'] = B.apply(lambda row: h3.geo_to_h3(row['latitude_Destino'], row['longitude_Destino'], 8), axis=1)
desthex =...
2
votes
0
answers
1k
views
How to create H3 shapefiles in a particular area to use in Tableau
I'd like to visualize some point data in Tableau and create a density map using H3 hexagons at resolutions 4 through 10. I haven't been able to find a way to create the shapefiles I need using Python, ...
2
votes
1
answer
563
views
pandas sum of value for nearest matching neighbors in area
I have two data frames.
One is structured like:
id,value
the second one:
id, neighbor_1, neighbor_2, neighbor_3, neighbor_4, neighbor_5, ...
Now I want to lookup for each id in the neighborhood ...
2
votes
1
answer
670
views
Using Deck.GL as Webpack external
I'm currently developing two different React applications which use Deck.GL to render two maps, each with a different type of layer.
When using them as standalone they both work perfectly, however, ...
1
vote
2
answers
2k
views
calculate distance between latitude longitude columns for pandas data frame
I am trying to apply this code:
import h3
coords_1 = (52.2296756, 21.0122287)
coords_2 = (52.406374, 16.9251681)
distance = h3.point_dist(coords_1, coords_2, unit='km')
distance
to a pandas ...
1
vote
1
answer
492
views
conda install h3 still fails on import
I have tried to install the h3 package, and it seemed to work:
(torch) C:\alpha\map>conda install -c conda-forge h3
Collecting package metadata (current_repodata.json): done
Solving environment: ...
1
vote
1
answer
31
views
Safe to truncate .in file extension for C header file?
I've imported a C library into my Swift project (in Xcode) from Uber's H3 (their geospatial library). Everything works as expected, however, the main header file has a .in file extension suffix which ...
1
vote
4
answers
4k
views
How to polyfill a Multi-polygon in H3?
I have a set of multipolygons in GeoJSON format, for example:
{
"type": "MultiPolygon",
"coordinates": [
[[[102.0, 2.0], [103.0, 2.0], [103.0, 3.0], [102.0, 3.0],...
1
vote
1
answer
71
views
Implicit conversion error C# netstandard2.1
I'm trying to port some code from Net5.0 to Netstandard2.1, but running out of C# knowledge.
I am trying to rewrite this function
public static readonly Dictionary<Direction, CoordIJK> ...
1
vote
1
answer
166
views
How would I modify the H3 library to change the base cell orientation?
The H3 library uses a Dymaxion orientation, which means that the hexagon grid is rotated to an unusual angle relative to the equator/meridian lines. This makes sense when modelling the Earth, as the ...
1
vote
1
answer
1k
views
Best way to determine actual H3 hexagon size?
What is the best way to get the actual size of an H3 hexagon (area or edge length) given an H3Index and not the average constant provided by the H3 API?
1
vote
1
answer
784
views
How can I get the H3 hexagons on a react-map-gl/deck.gl viewport?
I want to query for data based on the H3 hexagons that are visible on the viewport (and for new data on each viewport change). Is there anyway to achieve this with react-map-gl and deck.gl?
1
vote
2
answers
681
views
How to calculate the average distance between 2 neighboring H3 Cells?
I'm using the Uber H3 Library for Java https://github.com/uber/h3-java
I'm trying to figure out what is the average distance between 2 neighboring H3 cells of resolution 15 (the distance between their ...
1
vote
1
answer
666
views
calculating geospatial indexes for h3 at any given resolution
I am just starting out with Uber's h3geo (JavaScript), and am getting half the number of indexes at every resolution than what the docs suggest.
const nw = [-180, 90];
const ne = [ 180, 90];
const ...
1
vote
3
answers
2k
views
using h3 library with pyspark dataframe
I have a spark dataframe that looks like this:
+-----------+-----------+-------+------------------+----------+--------+--------+--------+--------+
|client_id_x|client_id_y| dist| time| ...
1
vote
1
answer
684
views
Uber H3 geoToH3 is not working in React Native
I am developing simple grid location based application in React Native using Uber H3. I installed H3 by
npm install h3-js. Then
I created a file to read H3Index from latitude and longitude.
import ...
1
vote
1
answer
890
views
Why i am gething different h3 index with same latitude and longitude
I am working with a SQlite hexagon index database and other information, the Hexagons index is the primary key. This database is generated by code written in python, and other codes written in C use ...
1
vote
2
answers
1k
views
How do I convert an H3 ID from hex to integer back and forth in JS
When in Javascript I do:
h3Int = parseInt("8B2A100D1D98FFF",16) //626740323050688500
h3Int.toString(16).toUpperCase() // 8B2A100D1D99000
So does not seem to get me the same result in both directions
...
1
vote
1
answer
686
views
H3 getting started
I'm new to geospatial indexing and found H3 to be really interesting. Currently messing around with the several different functions on API, but my question is how do I render the H3 cells to a map?
...
1
vote
2
answers
1k
views
Can Uber h3 cover the entire globe in hexagonal grid?
Uber has released h3, a framework for efficiently handling big data in the geospatial file. Using h3, I attempted to get the location of a hexagonal grid location as shown in the figure.
(https://eng....
1
vote
1
answer
244
views
How many possible H3 GeoBoundary vertex configurations are there?
When getting the vertices of an H3 cell using H3toGeoBoundary, how many possible vertex configurations can the GeoBoundary struct produce? I count four:
6 vertices: regular hexagon
5 vertices: ...
1
vote
2
answers
197
views
Adding C binding to H3 Rust library
I'm attempting to add the kRing function (amongst others) to an existing Rust project that implements a C-binding of the Uber H3 library. Here's the original source: https://github.com/scottmmjackson/...
1
vote
1
answer
221
views
For imprecise geoquerying with H3, can we consider pentagons equal to hexagons?
If we use the kRing(H3Index origin, int k, H3Index* out) function to get surrounding hexagons, and we're going to refine the results on the client (i.e. haversine), we never have to worry about ...
1
vote
1
answer
966
views
installing h3 python library on AWS Redshift for usage in an UDF
I was trying to install the python library from ubers H3 as a custom library for aws redshift by using this for the installation.
I followed the process and created the following function:
create or ...
1
vote
1
answer
787
views
Is the H3Index ordered?
Is the return value of java api kRingDistances orderly?
Does the H3Index of two adjacent cells have other H3Index?
for example,List<List<Long>> result = h3.kRingDistances(index, k)
here ...
1
vote
1
answer
429
views
typescript declaration: module detection and namespace
I am trying to write a declaration file for h3. Please see the function reference.
First, I am not sure how typescript detects the definition files.
It detects my definition, if placed on a folder /...
1
vote
1
answer
1k
views
How to use the new H3 layer
I've checked out the newest code in the github master branch of kepler.gl and I'm running the demo. But I don't see the H3HexGrid layer option. How do I use it? The git commits seem to indicate it can ...
1
vote
1
answer
497
views
Converting h3 hex id to polygon in python
I'm trying to take a h3 hex id and convert it to a polygon to use in a geodataframe (and eventually export as a shapefile). All of the methods in h3 documented online don't seem to work for me, and ...
1
vote
1
answer
186
views
How do I format the geojson data so that it is accepted by Mapbox
I have a geoJson of hex indexes, which I am trying to render on to mapbox.
Here is my code (ignore the indentation):
export default class App extends Component {
constructor() {
super();
...
1
vote
0
answers
185
views
How to populate world map with hexagons Mapbox
I want to make an interactive app where users can view crime rates in their area by pulling in geo-data from the met police website.
I want to display hexagons across the map (either through using H3 ...
1
vote
1
answer
218
views
How to install h3-py (from uber) with mamba?
I have recently switched to mamba as a package installer and am now trying to install h3-py into an environment. I have tried several ways, first using:
mamba install h3-py
but then it says
...
1
vote
0
answers
321
views
Build failed - h3
Installing h3 throws back an error
pip install h3
Error log when trying to install h3 (uber-api). Building failed is what I got in multiple attempts. Try to help me with some solution
Collecting h3
...
1
vote
1
answer
185
views
Is H3 adequate for generic sphere tilling?
Is it possible to use the H3 grid system for celestial tilling? I want to use the (alpha, delta)=(right ascension, declinaison) coordinate system (equatorial coordinate system) to assign a point/...
1
vote
0
answers
612
views
Scala: H3 Indexes - multiPolygonToH3 function
I’ve been doing this tutorial: https://databricks.com/notebooks/geomesa-h3-notebook.html
The polygon function (polygonToH3) works perfectly but however the multi polygon function is giving strange ...
1
vote
1
answer
384
views
H3Index in which Hexagon?
Actually I'm playing with the uber h3-Api in JavaScript. I've split the area into a few hexagons.
By given the hexeid into the kRing function.
Now I want to know by a given lat/lng in which Hexagon (...