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.
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
)
a shape file, if class is SPDF, will be converted to sf
name of a unique column that distinguishes areas
a float value in degrees for the diameter of the hexagons
distance in degrees to extend beyond the geometry provided
amount of hexagons around centroid to consider
the angle used to filter the grid points around a centroid
a data frame of reference locations when allocating hexagons, capital cities of Australia are used in the example
a string name of a column to order by for allocating
export the simple features set
a boolean to indicate whether to show function progress
a data set containing longitude and latitude of allocated hexagon points for each non null geometry passed in the shape file
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)
#> Buffer set to 0.9084 degrees.
#> Converted hexagon size to 0.1717 degrees.
#> Filter set to 0.5152 degrees.
#> Finding closest point in focal_points data set.
#> Allocating centroids, in order of distance to closest focal point.
#>
#> Filter distance was expanded for 22 area(s).