How to compare projection or raster and vector data?

Viewed 40

I am interacting raster and vector data in R. It seems that both my datasets (raster and vector) are in the same projection, but I wonder if there is a systematic way of checking for this without necessarily relying on looking at the code.

For the raster data (called PRODES) I do:

library(terra)
crs(PRODES)

[1] "GEOGCRS[\"SIRGAS 2000\",\n    DATUM[\"Sistema de Referencia Geocentrico para las AmericaS 2000\",\n        ELLIPSOID[\"GRS 1980\",6378137,298.257222101004,\n            LENGTHUNIT[\"metre\",1]]],\n    PRIMEM[\"Greenwich\",0,\n        ANGLEUNIT[\"degree\",0.0174532925199433]],\n    CS[ellipsoidal,2],\n        AXIS[\"geodetic latitude (Lat)\",north,\n            ORDER[1],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n        AXIS[\"geodetic longitude (Lon)\",east,\n            ORDER[2],\n            ANGLEUNIT[\"degree\",0.0174532925199433]],\n    ID[\"EPSG\",4674]]"

For the vector data (called bioma) I do:

st_crs(bioma)

Coordinate Reference System:
  User input: SIRGAS 2000 
  wkt:
BOUNDCRS[
    SOURCECRS[
        GEOGCRS["SIRGAS 2000",
            DATUM["Sistema de Referencia Geocentrico para las AmericaS 2000",
                ELLIPSOID["GRS 1980",6378137,298.257222101,
                    LENGTHUNIT["metre",1]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433]],
            CS[ellipsoidal,2],
                AXIS["geodetic latitude (Lat)",north,
                    ORDER[1],
                    ANGLEUNIT["degree",0.0174532925199433]],
                AXIS["geodetic longitude (Lon)",east,
                    ORDER[2],
                    ANGLEUNIT["degree",0.0174532925199433]],
            USAGE[
                SCOPE["Horizontal component of 3D system."],
                AREA["Latin America - Central America and South America - onshore and offshore. Brazil - onshore and offshore."],
                BBOX[-59.87,-122.19,32.72,-25.28]],
            ID["EPSG",4674]]],
    TARGETCRS[
        GEOGCRS["WGS 84",
            DATUM["World Geodetic System 1984",
                ELLIPSOID["WGS 84",6378137,298.257223563,
                    LENGTHUNIT["metre",1]]],
            PRIMEM["Greenwich",0,
                ANGLEUNIT["degree",0.0174532925199433]],
            CS[ellipsoidal,2],
                AXIS["latitude",north,
                    ORDER[1],
                    ANGLEUNIT["degree",0.0174532925199433]],
                AXIS["longitude",east,
                    ORDER[2],
                    ANGLEUNIT["degree",0.0174532925199433]],
            ID["EPSG",4326]]],
    ABRIDGEDTRANSFORMATION["SIRGAS 2000 to WGS 84 (1)",
        VERSION["OGP-C&S America"],
        METHOD["Geocentric translations (geog2D domain)",
            ID["EPSG",9603]],
        PARAMETER["X-axis translation",0,
            ID["EPSG",8605]],
        PARAMETER["Y-axis translation",0,
            ID["EPSG",8606]],
        PARAMETER["Z-axis translation",0,
            ID["EPSG",8607]],
        USAGE[
            SCOPE["Transformation of coordinates at 1m level of accuracy."],
            AREA["Latin America - Central America and South America - onshore and offshore. Brazil - onshore and offshore."],
            BBOX[-59.87,-122.19,32.72,-25.28]],
        ID["EPSG",15894]]]

They both seem to be using the same coordinate system SIRGAS 2000, but do you know a way to perform a test of the compatibility of the two datasets?

Thank you very much.

0 Answers
Related