Learn R Programming

windfarmGA (version 2.3.0)

hexa_area: Polygon to Hexagonal Grid Tessellation

Description

The function takes a Polygon and a sizing argument and creates a list with an indexed matrix with coordinates and a SpatialPolygons object, that consists of hexagonal grids

Usage

hexa_area(Polygon1, size, plotTrue = FALSE)

Arguments

Polygon1

The SpatialPolygons object

size

The side length of an hexagon

plotTrue

Should the object be plotted

Value

Returns a list with an indexed matrix of the point coordinates and a SpatialPolygons object of the hexagons

See Also

Other Helper Functions: dup_coords(), getDEM(), getISO3(), get_grids(), grid_area(), isSpatial(), permutations(), readintegerSel(), readinteger(), splitAt(), tess2SPdf(), windata_format()

Examples

Run this code
# NOT RUN {
library(spatstat)
library(sp)
library(raster)
Polygon1 <- Polygon(rbind(c(4498482, 2668272), c(4498482, 2669343),
                          c(4499991, 2669343), c(4499991, 2668272)))
Polygon1 <- Polygons(list(Polygon1),1);
Polygon1 <- SpatialPolygons(list(Polygon1))
Projection <- "+init=epsg:3035"
proj4string(Polygon1) <- Projection
HexGrid <- hexa_area(Polygon1, 100, TRUE)
plot(HexGrid[[2]])

# }

Run the code above in your browser using DataLab