powered by
sf
An example polygon layer of Victoria's LGAs for demos and tests. Built from data-raw/map/LGA_POLYGON.shp, Z/M dropped, transformed to a projected CRS, simplified, validated, and reduced to LGA_NAME + geometry.
data-raw/map/LGA_POLYGON.shp
LGA_NAME
vic
An sf object with:
Character, LGA name (upper case).
MULTIPOLYGON / POLYGON in a projected CRS.
MULTIPOLYGON
POLYGON
The CRS stored in the object is whatever st_crs(vic) reports at build time. In data-raw/gen-data.R we:
st_crs(vic)
data-raw/gen-data.R
drop Z/M (st_zm()),
st_zm()
transform to a projected CRS (st_transform()),
st_transform()
simplify (st_simplify(dTolerance = 100)),
st_simplify(dTolerance = 100)
repair geometries (st_make_valid()),
st_make_valid()
upper-case names and select columns.
library(sf) plot(sf::st_geometry(vic), col = "grey90", border = "grey50")
Run the code above in your browser using DataLab