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 in h3-js which will take radius , array of stores , h3 index and then give back the list of stores which are within 5 km range from the given h3 index . or how can i implement this using h3-js?
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?
2.2k Views Asked by Goutham Raj R At
1
There are 1 best solutions below
Related Questions in MAPS
- Compiling hybrid CUDA/MPI and CUDA/UPC
- UPC shared arrays
- UPC allocating dynamic array and sorting
- UPC error when running (reason: unable to open any HCA ports)
- Is there a way to get Visual Studio code to recognize the .upc file format?
- How to solve UPC Runtime error: out of shared memory
- Berkeley UPC compiler error upcc: error running '/bin/gmake --no-print-directory' to link application
- which network type should i use in UPC
- Unified Parallel C - examples and list of extensions
- MPI error due to Timeout in making connection to a remote process
Related Questions in UBER-API
- Compiling hybrid CUDA/MPI and CUDA/UPC
- UPC shared arrays
- UPC allocating dynamic array and sorting
- UPC error when running (reason: unable to open any HCA ports)
- Is there a way to get Visual Studio code to recognize the .upc file format?
- How to solve UPC Runtime error: out of shared memory
- Berkeley UPC compiler error upcc: error running '/bin/gmake --no-print-directory' to link application
- which network type should i use in UPC
- Unified Parallel C - examples and list of extensions
- MPI error due to Timeout in making connection to a remote process
Related Questions in H3
- Compiling hybrid CUDA/MPI and CUDA/UPC
- UPC shared arrays
- UPC allocating dynamic array and sorting
- UPC error when running (reason: unable to open any HCA ports)
- Is there a way to get Visual Studio code to recognize the .upc file format?
- How to solve UPC Runtime error: out of shared memory
- Berkeley UPC compiler error upcc: error running '/bin/gmake --no-print-directory' to link application
- which network type should i use in UPC
- Unified Parallel C - examples and list of extensions
- MPI error due to Timeout in making connection to a remote process
Related Questions in S2
- Compiling hybrid CUDA/MPI and CUDA/UPC
- UPC shared arrays
- UPC allocating dynamic array and sorting
- UPC error when running (reason: unable to open any HCA ports)
- Is there a way to get Visual Studio code to recognize the .upc file format?
- How to solve UPC Runtime error: out of shared memory
- Berkeley UPC compiler error upcc: error running '/bin/gmake --no-print-directory' to link application
- which network type should i use in UPC
- Unified Parallel C - examples and list of extensions
- MPI error due to Timeout in making connection to a remote process
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are a few different parts here:
Pick a resolution: Pick an H3 resolution for lookup. Finer res means more accuracy but more memory usage. Res 8 is roughly a few city blocks in size.
Indexing Data: To use H3 for the radius lookup, you need to index the stores by H3 index. If you want this to be efficient, you'd be better off indexing all the stores ahead of time. How you do this is up to you; one easy way in JS might be to create a map of id arrays:
Perform the lookup: To search, index your search location and get all the H3 indexes within some radius. You can use the
h3.edgeLength
function to get the approximate radius of a cell at your current resolution.See a working example on Observable
Caveats: This is not a true radius search. The k-ring is a roughly hexagonal shape centered on the origin. This is good enough for many use cases, and much faster than a traditional Haversine radius search, especially if you have many rows to search over. But if you care about the exact distance H3 might not be appropriate (or, in some cases, H3 might be fine, but you might want the indexes inside a "true" circle - one option here is to convert your circle to a close-to-circular polygon, then get the indexes via
h3.polyfill
).