Comments (3)
I would think the solution probably relies on the indexing order, however I need help with understanding how that is represented in the indexes between resolutions, if the lowest resolution set is continuous between startAt
and endAt
of higher resolutions...
https://observablehq.com/@nrabinowitz/h3-indexing-order
from h3-js.
I have read a few more responses from @nrabinowitz Stack Overflow as well and now I think I understand that the child indexes of any hexagon are not continuous alphanumerically, and cannot be used to range queries in NoSQL databases:
https://stackoverflow.com/questions/53911322/is-the-h3index-ordered#comment95750613_53915447
Using the referenced h3 indexing order visualization I am able to extract that for the San Fransisco 8428309ffffffff
hexagon the children h3 indexes at lower resolution cannot be described in continuous ranges:
["*807*","*80f*","*817*","*81f*","*827*","*82f*","*837*","*847*",...]
To give more context, for now using the Geofire library I am mapping the h3 hexagons to their nearest geohash [start, end]
range pairs (rectangles), and then calculate and exclude for each range the geohashes that are outside the radius of the hexagon (red rectangles), specifically:
{
"h3Index": "8665812cfffffff",
"geohashRanges": ["w60gh","w60gk"],["w60g4","w60g6"],["w60fu","w60fw"],["w60ff","w60fh"],
"geohashesExcluded: [["w60g5zz8ku","w60g5zz8kv"],["w60g5zz8mh","w60g5zz8mj"],["w60g5zz8kv"],["w60g5zz8mj"],["w60g5zz8kg"],["w60g5zz8m5"]]
}
Unfortunately this results in several parallel aggregate queries, and because the rectangles will never fit the hexagons, displaying aggregate numbers of the rectangles mapped to the hexagon will always be redundant and inaccurate. Of course I could just display the geohash rectangles on the map, but the benefits of h3 indexing are more appealing both visually and computationally.
This is why I am looking for any solution where I can use h3 indexes in the database objects and query them at various resolutions in a way that are less expensive and less inaccurate relative to the current solution.
from h3-js.
If i understand your use case correctly, I believe H3 can do what you're trying to do. While k-rings (also called grid disks, the set of cells within k
steps of some origin) are not ordered sequentially, children at a given resolution are. You can request the range of children at some res with the lower bound as cellToCenterChild(res)
; the upper bound is a little tricker until we release childPosToCell
but you can construct it. This is harder in JS, because we can't use 64-bit ints, but essentially you apply a bitmask of all 1s to the bottom N bits of the index, where N is 3 * (15 - parentRes)
(I think, I haven't tested this). The bit layout diagrams here might help.
from h3-js.
Related Issues (20)
- some h3index values create distorted long horizontal line on map HOT 1
- compactCells throws error HOT 1
- Openlayers instead of Mapbox HOT 1
- Count the number of points in the aggregated bins of H3-hexagons HOT 3
- Upgrade emscripten to 3.X.X? HOT 7
- Integrating with google maps HOT 1
- Potential memory leak in polygonToCells HOT 10
- Load and Display H3-JS binned dataset in Mapbox HOT 1
- Consider buffer radius in addition to H3 resolution when counting points in the aggregated bins of H3-hexagons HOT 2
- Inverted coordinates HOT 1
- H3-JS binning resoluion in OpenLayers HOT 1
- Incorrect result from polygonToCells for bigger screen/ higher dimensions HOT 6
- Error when passing zero area polygon to h3.polygonToCells HOT 2
- Does h3-js send any data to the server? HOT 1
- I am unable to load h3-JS in my quasar project HOT 3
- H3 with dynamodb
- Different output from h3-js and postgis using cellToBoundary function HOT 1
- Hexagons Resolution HOT 1
- Somthing is funky at the borders of the cells HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from h3-js.