Commit fac8b6b8 authored by Barry Rowlingson's avatar Barry Rowlingson
Browse files

comments

parent 8c33b6f8
## write hex list to a geopackage with adjacency table
make_geo <- function(hexlist, packagename){
for(n in names(hexlist)){
st_write(hexlist[[n]]$map, packagename, n)
......
##' .. content for \description{} (no empty lines) ..
##'
##' .. content for \details{} ..
##' @title Uber H3 hex map generation
##' @param polys source sf object to map over
##' @param res H3 resolution
##' @param dst_crs optional crs to transform result to
##' @param buffer buffer size to try and get everything in
##' @param add_nbr_columns add the names of neighbour hexes as columns
##' @return a list with a few things in
##' @author Barry Rowlingson
sfHex <- function(polys, res, dst_crs, buffer, add_nbr_columns=FALSE){
###
### get all H3 hexes overlapping the polys.
###
## buffer to catch things outside the source bounding box
if(!missing(buffer)){
buffpolys <- st_buffer(polys, buffer)
......@@ -18,7 +32,7 @@ sfHex <- function(polys, res, dst_crs, buffer, add_nbr_columns=FALSE){
bb = st_polygon(list(pts))
d = st_as_sf(data.frame(geom=st_sfc(bb)))
## get all hexes with centres in the bounding box at this resolution
## get all hexes with *centres* in the bounding box at this resolution
p = polyfill(d, res)
hexpolys = geo_boundary_to_sf(h3_to_geo_boundary(p))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment