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

Description Usage Arguments Value Examples

View source: R/create_hexmap.R

Description

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

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
create_hexmap(
  shp,
  sf_id,
  hex_size = NULL,
  buffer_dist = NULL,
  hex_filter = 10,
  neighbours = NULL,
  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

neighbours

use the shp sf set to find spatial neighbours

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

1
2
3
4
5
6
7
data(tas_sa2)
data(capital_cities)
hexmap <- create_hexmap(
  shp = tas_lga,
  sf_id = "LGA_CODE16",
  focal_points = capital_cities, verbose = TRUE
)

sugarbag documentation built on Jan. 9, 2020, 1:07 a.m.