Convert shapefile (class sf) of points to data.table of lat, lon columns
Source:R/shapefile_xyz.R
shapefile2latlon.Rd
Makes lat and lon columns, from a sfc_POINT class geometry field,
via sf::st_coordinates()
Arguments
- shp
shapefile that is class sf, as from
shapefile_from_any()
orsf::st_read()
, with geometry column that has points so is class sfc_POINT- include_only_latlon
set to FALSE to have function return lat lon columns plus all of columns in shp. If TRUE, just returns lat lon columns.