I am doing some geospatial analysis and am having a difficult time finding an appropriate CRS to transform the data to. I am using two resources to look up CRS codes.
- https://resources.arcgis.com/en/help/main/10.1/018z/pdf/projected_coordinate_systems.pdf
- https://epsg.io/
The proj4string of a CRS code, for example, EPSG:6566, can be obtained using the code below:
sf::st_crs("EPSG:6566")$proj4string
# "+proj=lcc +lat_0=17.8333333333333 +lon_0=-66.4333333333333 +lat_1=18.4333333333333 +lat_2=18.0333333333333 +x_0=200000 +y_0=200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
My data contains latitudes and longitudes for places that I want to use for performing proximity analysis.
library(sf)
library(dplyr)
data %>%
st_as_sf(coords = c("nh_lon", "nh_lat"), crs = 4326) %>%
st_transform(crs = "EPSG:6566")
If I wanted to use a Equidistant Conic (eqdc) projection instead of a Lambert Conformal Conic (lcc) projection, could I do it by simply replacing the "+proj=" portion of the proj4string or is it more nuanced than this?
library(sf)
library(dplyr)
prj <- "+proj=eqdc +lat_0=17.8333333333333 +lon_0=-66.4333333333333 +lat_1=18.4333333333333 +lat_2=18.0333333333333 +x_0=200000 +y_0=200000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
data %>%
st_as_sf(coords = c("nh_lon", "nh_lat"), crs = 4326) %>%
st_transform(crs = prj)