0

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.

  1. https://resources.arcgis.com/en/help/main/10.1/018z/pdf/projected_coordinate_systems.pdf
  2. 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)

1 Answer 1

0

Replacing lcc with eqdc does change a conic projection to an equidistant one. But you should make sure all the other parameters are relevant and correct for your use case.

The general parameters are documented here:

https://proj.org/en/9.3/usage/projections.html

and specific parameters for those projections are on their pages:

You might notice that eqdc doesn't have a lat_0 parameter, which in this case probably doesn't matter (I assume it gets ignored, haven't tested) so you have probably made a valid PROJ string and you will get a eqdc projection. Does it look right when you test it? Check it on a few features. Then maybe adjust the parameters to get it rotated the right way up for your data, adjust the offset parameters if you want the projected origin (0,0) to be elsewhere and so on.

1
  • Thank you for providing additional resources, @spacedman! I will take a look at those. I have not done any testing of the returned results. I will try to plot them on a map and see if they make sense. Commented Aug 23 at 16:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.