create_hexmap: Create a tessellated hexagon map from a set of polygons

View source: R/create_hexmap.R

create_hexmapR Documentation

Create a tessellated hexagon map from a set of polygons

Description

Allocates each polygon in a shape file to a grid point to create a map of tessellated hexagons. The spatial relationships of areas are preserved while the geographic shape of each area is lost.

Usage

create_hexmap(
  shp,
  sf_id,
  hex_size = NULL,
  buffer_dist = NULL,
  hex_filter = 10,
  f_width = 30,
  focal_points = NULL,
  order_sf_id = NULL,
  export_shp = FALSE,
  verbose = FALSE
)

Arguments

shp

a shape file, if class is SPDF, will be converted to sf

sf_id

name of a unique column that distinguishes areas

hex_size

a float value in degrees for the diameter of the hexagons

buffer_dist

distance in degrees to extend beyond the geometry provided

hex_filter

amount of hexagons around centroid to consider

f_width

the angle used to filter the grid points around a centroid

focal_points

a data frame of reference locations when allocating hexagons, capital cities of Australia are used in the example

order_sf_id

a string name of a column to order by for allocating

export_shp

export the simple features set

verbose

a boolean to indicate whether to show function progress

Value

a data set containing longitude and latitude of allocated hexagon points for each non null geometry passed in the shape file

Examples


data(tas_lga)
# Smaller set for faster example
tas_lga_sub <- tas_lga[1:10,] 
data(capital_cities)
hexmap <- create_hexmap(
  shp = tas_lga_sub,
  sf_id = "lga_code_2016",
  hex_filter = 3,
  focal_points = capital_cities, 
  verbose = TRUE)


sugarbag documentation built on Nov. 10, 2022, 5:49 p.m.