All Projects → crazycapivara → h3-r

crazycapivara / h3-r

Licence: Unknown, Unknown licenses found Licenses found Unknown LICENSE.md Unknown LICENSE.note
R bindings for H3, a hierarchical hexagonal geospatial indexing system

Programming Languages

r
7636 projects
Dockerfile
14818 projects
shell
77523 projects

Projects that are alternatives of or similar to h3-r

H3
Hexagonal hierarchical geospatial indexing system
Stars: ✭ 3,167 (+5456.14%)
Mutual labels:  h3, geospatial, hexagon, spatial-indexing
H3.net
Port of Uber's H3 to .NET
Stars: ✭ 27 (-52.63%)
Mutual labels:  h3, geospatial, hexagon, spatial-indexing
h3net
H3NET: A Hexagonal Hierarchical Geo-spatial Indexing System In C#
Stars: ✭ 20 (-64.91%)
Mutual labels:  h3, hexagon, spatial-indexing
python-censusbatchgeocoder
A simple Python wrapper for U.S. Census Geocoding Services API batch service
Stars: ✭ 40 (-29.82%)
Mutual labels:  geocoding, geospatial
Atlas
🌎 Atlas is a set of APIs for looking up information about locations
Stars: ✭ 21 (-63.16%)
Mutual labels:  geocoding, geospatial
Maps Api For Javascript Examples
Self-contained examples for Maps API for JavaScript v3.
Stars: ✭ 130 (+128.07%)
Mutual labels:  geocoding, geospatial
placekey-js
placekey.io
Stars: ✭ 19 (-66.67%)
Mutual labels:  h3, geospatial
H3 Py
Python bindings for H3, a hierarchical hexagonal geospatial indexing system
Stars: ✭ 354 (+521.05%)
Mutual labels:  geocoding, geospatial
Examples
Self-contained examples for the legacy Maps API for JavaScript.
Stars: ✭ 78 (+36.84%)
Mutual labels:  geocoding, geospatial
Geo On Fire
A library to create high performance geolocation queries for Firebase. Checkout the demos: https://run.plnkr.co/plunks/AYaN8ABEDcMntgbJyLVW/ and https://run.plnkr.co/plunks/xJgstAvXYcp0w7MbOOjm/
Stars: ✭ 54 (-5.26%)
Mutual labels:  geocoding, geospatial
placekey-py
placekey.io
Stars: ✭ 49 (-14.04%)
Mutual labels:  h3, geospatial
h3ron
Rust crates for the H3 geospatial indexing system
Stars: ✭ 52 (-8.77%)
Mutual labels:  h3, geospatial
svelte-mapbox
MapBox Map and Autocomplete components for Svelte (or Vanilla JS)
Stars: ✭ 267 (+368.42%)
Mutual labels:  geocoding
geopandas-spatial-join-example
An example of how to join point to polygon data with geopandas and Python
Stars: ✭ 21 (-63.16%)
Mutual labels:  geospatial
qgis-maptiler-plugin
QGIS MapTiler Plugin: vector tiles, basemaps, geocoding, OSM, QuickMapServices
Stars: ✭ 73 (+28.07%)
Mutual labels:  geocoding
local-reverse-geocoder
Local reverse geocoder for Node.js based on GeoNames data
Stars: ✭ 155 (+171.93%)
Mutual labels:  geocoding
sits
Satellite image time series in R
Stars: ✭ 342 (+500%)
Mutual labels:  geospatial
miZy
miZy - tiny fast embedded linux
Stars: ✭ 106 (+85.96%)
Mutual labels:  h3
google maps
🗺 An unofficial Google Maps Platform client library for the Rust programming language.
Stars: ✭ 40 (-29.82%)
Mutual labels:  geocoding
Spatial-Analysis-Mapping-Projects
Project Documentation, Best Practices & Procedures for Spatial Analysis and Mapping Projects
Stars: ✭ 15 (-73.68%)
Mutual labels:  geospatial

H3-R

R build status Project Status: Active – The project has reached a stable, usable state and is being actively developed. H3 Version CRAN status

Provides R bindings for H3, a hexagonal hierarchical spatial indexing system.

Documentation

Notes

Succesfully built on

  • Linux
  • macOS
  • Windows

Since v3.7.1 {h3} comes with a bundled version of the H3 C library, so that you no longer have to build it yourself before installing the R package.

Installation

Once on CRAN you can install {h3} with:

install.packages("h3")

You can install the latest version of {h3} from github with:

# install.packages("remotes")
remotes::install_github("crazycapivara/h3-r")

Usage

Core functions:

library(h3)

coords <- c(37.3615593, -122.0553238)
resolution <- 7

# Convert a lat/lng point to a hexagon index at resolution 7
(h3_index <- geo_to_h3(coords, resolution)) 
#> [1] "87283472bffffff"

# Get the center of the hexagon
h3_to_geo_sf(h3_index)
#> Simple feature collection with 1 feature and 1 field
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -122.0503 ymin: 37.35172 xmax: -122.0503 ymax: 37.35172
#> Geodetic CRS:  WGS 84
#>          h3_index                   geometry
#> 1 87283472bffffff POINT (-122.0503 37.35172)

# Get the vertices of the hexagon
h3_to_geo_boundary(h3_index)
#> [[1]]
#>           lat       lng
#> [1,] 37.34110 -122.0416
#> [2,] 37.35290 -122.0340
#> [3,] 37.36352 -122.0428
#> [4,] 37.36234 -122.0591
#> [5,] 37.35054 -122.0666
#> [6,] 37.33992 -122.0579

# Get the polygon of the hexagon
h3_to_geo_boundary_sf(h3_index)
#> Simple feature collection with 1 feature and 1 field
#> Geometry type: POLYGON
#> Dimension:     XY
#> Bounding box:  xmin: -122.0666 ymin: 37.33992 xmax: -122.034 ymax: 37.36352
#> Geodetic CRS:  WGS 84
#>          h3_index                       geometry
#> 1 87283472bffffff POLYGON ((-122.0416 37.3411...

Useful algorithms:

# Get all neighbors within 1 step of the hexagon
radius <- 1
(neighbors <- k_ring(h3_index, radius))
#> [1] "87283472bffffff" "87283472affffff" "87283470cffffff" "87283470dffffff"
#> [5] "872834776ffffff" "872834729ffffff" "872834728ffffff"

h3_to_geo_boundary_sf(neighbors) %>%
  sf::st_geometry() %>% plot(col = "blue")

h3_set_to_multi_polygon(neighbors) %>%
  sf::st_geometry() %>% plot(col = "green")

Run tests

devtools::test(reporter = "minimal")
#> ℹ Loading h3
#> ℹ Testing h3
#> ...................................................
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].