Converts spatial data to a sf object
Arguments
- spatdat
Spatial data containing information on fishery management or regulatory zones.
- lon
Longitude variable in
spatdat. This is required for csv files or ifspatdatis a dataframe (i.e. is not asforspobject).- lat
Latitude variable in
spatdat. This is required for csv files or ifspatdatis a dataframe (i.e. is not asforspobject).- id
Polygon ID column. This is required for csv files or if
spatdatis a dataframe (i.e. is not asforspobject).
Details
This function checks whether spatdat is a sf object
and attempts to convert it if not. It also applies clean_spat
which fixes certain spatial issues such as invalid or empty polygons,
whether a projected CRS is used (converts to WGS84 if detected), and if
longitude should be shifted to Pacific view (0-360 format) to avoid
splitting the Alaska region during plotting.
