Skip to content

Compare CRS #180

@etiennebr

Description

@etiennebr

What's the best option to compare crs's ? For instance:

epsg <- "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs"
st_crs(epsg)$proj4string; epsg
# [1] "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.9999 +x_0=304800 +y_0=0 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"
# [1] "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs"

Using == like it's currently the case seems too strict.

epsg <- "+proj=tmerc +lat_0=0 +lon_0=0 +k=0.9999 +x_0=304800 +y_0=0 +datum=NAD83 +units=m +no_defs"
y <- x <- st_crs(epsg)
y$proj4string <- epsg  # this is cheating, but it's for illustration; it happened in a "natural" way via st_read
x == y
# FALSE

I see sp::identicalCRS(), sf doesn't seem to have an equivalent, yet. Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions