View source: R/genetic_algorithm.R
| isSpatial | R Documentation |
Helper Function, which transforms SpatialPolygons or coordinates in matrix/data.frame - form to a Simple Feature Polygon
isSpatial(area, crs = NULL)
area |
Site as SpatialPolygon, Simple Feature polygon, or coordinates as matrix/data.frame |
crs |
CRS assigned to matrix / data.frame coordinates |
If the columns are named, it will look for common abbreviation to match x/y or long/lat columns. If the columns are not named, the first 2 numeric columns are taken.
A Simple Feature Polygon
Other Helper Functions:
get_grids(),
grid_area(),
hexa_area(),
permutations(),
read_power_curve(),
splitAt(),
wind_from_series(),
wind_from_uv(),
windata_format()
library(sf)
df <- rbind(
c(4498482, 2668272), c(4498482, 2669343),
c(4499991, 2669343), c(4499991, 2668272)
)
isSpatial(df)
area <- sf::st_as_sf(sf::st_sfc(
sf::st_polygon(list(cbind(
c(4498482, 4498482, 4499991, 4499991, 4498482),
c(2668272, 2669343, 2669343, 2668272, 2668272)
))),
crs = 3035
))
isSpatial(st_coordinates(area), 3035)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.