spTransform() with rgdal >= 1.5 / PROJ 3 – additionalAdditional material of this report.
pt0_lonlat_sf <- st_sfc(st_point(c(10,46)), crs = 4326) # YX CRS
pt0_laea89_sf <- st_transform(pt0_lonlat_sf, 3035) # YX CRS
pt0_wgs32n_sf <- st_transform(pt0_lonlat_sf, 32632) # XY CRS
pt0_psmerc_sf <- st_transform(pt0_lonlat_sf, 3857) # XY CRS
pt0_etrsat_sf <- st_transform(pt0_lonlat_sf, 3416) # YX CRS
pt0_etrs32_sf <- st_transform(pt0_lonlat_sf, 25832) # XY CRS
pt0_lonlat <- as(pt0_lonlat_sf, "Spatial")
pt0_laea89 <- as(pt0_laea89_sf, "Spatial")
## Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded
## datum Unknown_based_on_GRS80_ellipsoid in CRS definition
pt0_wgs32n <- as(pt0_wgs32n_sf, "Spatial")
pt0_psmerc <- as(pt0_psmerc_sf, "Spatial")
## Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt0_etrsat <- as(pt0_etrsat_sf, "Spatial")
## Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown_based_on_GRS80_ellipsoid in CRS definition,
## but +towgs84= values preserved
pt0_etrs32 <- as(pt0_etrs32_sf, "Spatial")
## Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown_based_on_GRS80_ellipsoid in CRS definition,
## but +towgs84= values preserved
pt1_lonlat_inv_sf <- st_sfc(st_point(pt0_lonlat_sf[[1]][2:1]), crs = st_crs(pt0_lonlat_sf))
pt1_laea89_inv_sf <- st_sfc(st_point(pt0_laea89_sf[[1]][2:1]), crs = st_crs(pt0_laea89_sf))
pt1_etrsat_inv_sf <- st_sfc(st_point(pt0_etrsat_sf[[1]][2:1]), crs = st_crs(pt0_etrsat_sf))
pt1_lonlat_inv <- as(pt1_lonlat_inv_sf, "Spatial")
pt1_laea89_inv <- as(pt1_laea89_inv_sf, "Spatial")
## Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded
## datum Unknown_based_on_GRS80_ellipsoid in CRS definition
pt1_etrsat_inv <- as(pt1_etrsat_inv_sf, "Spatial")
## Warning in showSRID(uprojargs, format = "PROJ", multiline = "NO"): Discarded datum Unknown_based_on_GRS80_ellipsoid in CRS definition,
## but +towgs84= values preserved
pt1_lonlat_laea89 <- spTransform(pt0_lonlat, CRS(SRS_string = "EPSG:3035"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum European_Terrestrial_Reference_System_1989 in CRS definition
pt1_lonlat_wgs32n <- spTransform(pt0_lonlat, CRS(SRS_string = "EPSG:32632"))
pt1_lonlat_psmerc <- spTransform(pt0_lonlat, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt1_lonlat_etrsat <- spTransform(pt0_lonlat, CRS(SRS_string = "EPSG:3416"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_lonlat_etrs32 <- spTransform(pt0_lonlat, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_laea89_lonlat <- spTransform(pt0_laea89, CRS(SRS_string = "EPSG:4326"))
pt1_laea89_wgs32n <- spTransform(pt0_laea89, CRS(SRS_string = "EPSG:32632"))
pt1_laea89_psmerc <- spTransform(pt0_laea89, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt1_laea89_etrsat <- spTransform(pt0_laea89, CRS(SRS_string = "EPSG:3416"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_laea89_etrs32 <- spTransform(pt0_laea89, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_wgs32n_lonlat <- spTransform(pt0_wgs32n, CRS(SRS_string = "EPSG:4326"))
pt1_wgs32n_laea89 <- spTransform(pt0_wgs32n, CRS(SRS_string = "EPSG:3035"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum European_Terrestrial_Reference_System_1989 in CRS definition
pt1_wgs32n_psmerc <- spTransform(pt0_wgs32n, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt1_wgs32n_etrsat <- spTransform(pt0_wgs32n, CRS(SRS_string = "EPSG:3416"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_wgs32n_etrs32 <- spTransform(pt0_wgs32n, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_psmerc_lonlat <- spTransform(pt0_psmerc, CRS(SRS_string = "EPSG:4326"))
pt1_psmerc_laea89 <- spTransform(pt0_psmerc, CRS(SRS_string = "EPSG:3035"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum European_Terrestrial_Reference_System_1989 in CRS definition
pt1_psmerc_wgs32n <- spTransform(pt0_psmerc, CRS(SRS_string = "EPSG:32632"))
pt1_psmerc_etrsat <- spTransform(pt0_psmerc, CRS(SRS_string = "EPSG:3416"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_psmerc_etrs32 <- spTransform(pt0_psmerc, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_etrsat_lonlat <- spTransform(pt0_etrsat, CRS(SRS_string = "EPSG:4326"))
pt1_etrsat_laea89 <- spTransform(pt0_etrsat, CRS(SRS_string = "EPSG:3035"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum European_Terrestrial_Reference_System_1989 in CRS definition
pt1_etrsat_wgs32n <- spTransform(pt0_etrsat, CRS(SRS_string = "EPSG:32632"))
pt1_etrsat_psmerc <- spTransform(pt0_etrsat, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt1_etrsat_etrs32 <- spTransform(pt0_etrsat, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt1_etrs32_lonlat <- spTransform(pt0_etrs32, CRS(SRS_string = "EPSG:4326"))
pt1_etrs32_laea89 <- spTransform(pt0_etrs32, CRS(SRS_string = "EPSG:3035"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum European_Terrestrial_Reference_System_1989 in CRS definition
pt1_etrs32_wgs32n <- spTransform(pt0_etrs32, CRS(SRS_string = "EPSG:32632"))
pt1_etrs32_psmerc <- spTransform(pt0_etrs32, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt1_etrs32_etrsat <- spTransform(pt0_etrs32, CRS(SRS_string = "EPSG:3416"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt2_lonlat_inv_laea89 <- spTransform(pt1_lonlat_inv, CRS(SRS_string = "EPSG:3035"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum European_Terrestrial_Reference_System_1989 in CRS definition
pt2_lonlat_inv_wgs32n <- spTransform(pt1_lonlat_inv, CRS(SRS_string = "EPSG:32632"))
pt2_lonlat_inv_psmerc <- spTransform(pt1_lonlat_inv, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt2_lonlat_inv_etrsat <- spTransform(pt1_lonlat_inv, CRS(SRS_string = "EPSG:3416"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt2_lonlat_inv_etrs32 <- spTransform(pt1_lonlat_inv, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt2_laea89_inv_lonlat <- spTransform(pt1_laea89_inv, CRS(SRS_string = "EPSG:4326"))
pt2_laea89_inv_wgs32n <- spTransform(pt1_laea89_inv, CRS(SRS_string = "EPSG:32632"))
pt2_laea89_inv_psmerc <- spTransform(pt1_laea89_inv, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt2_laea89_inv_etrsat <- spTransform(pt1_laea89_inv, CRS(SRS_string = "EPSG:3416"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt2_laea89_inv_etrs32 <- spTransform(pt1_laea89_inv, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
pt2_etrsat_inv_lonlat <- spTransform(pt1_etrsat_inv, CRS(SRS_string = "EPSG:4326"))
pt2_etrsat_inv_laea89 <- spTransform(pt1_etrsat_inv, CRS(SRS_string = "EPSG:3035"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum European_Terrestrial_Reference_System_1989 in CRS definition
pt2_etrsat_inv_wgs32n <- spTransform(pt1_etrsat_inv, CRS(SRS_string = "EPSG:32632"))
pt2_etrsat_inv_psmerc <- spTransform(pt1_etrsat_inv, CRS(SRS_string = "EPSG:3857"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded
## datum WGS_1984 in CRS definition
pt2_etrsat_inv_etrs32 <- spTransform(pt1_etrsat_inv, CRS(SRS_string = "EPSG:25832"))
## Warning in showSRID(SRS_string, format = "PROJ", multiline = "NO"): Discarded datum European_Terrestrial_Reference_System_1989 in CRS definition,
## but +towgs84= values preserved
Reprojections from / to XY CRSs:
# Output WGS32N
pt1_psmerc_wgs32n@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt1_etrs32_wgs32n@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt0_wgs32n@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
# Output PSMERC
pt1_wgs32n_psmerc@coords
## coords.x1 coords.x2
## [1,] 1113195 5780349
pt1_etrs32_psmerc@coords
## coords.x1 coords.x2
## [1,] 1113195 5780349
pt0_psmerc@coords
## coords.x1 coords.x2
## [1,] 1113195 5780349
# Output ETRS32
pt1_wgs32n_etrs32@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt1_psmerc_etrs32@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt0_etrs32@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534Reprojections from XY to YX CRSs:
# Output LONLAT
pt1_wgs32n_lonlat@coords
## coords.x1 coords.x2
## [1,] 46 10
pt1_psmerc_lonlat@coords
## coords.x1 coords.x2
## [1,] 46 10
pt1_etrs32_lonlat@coords
## coords.x1 coords.x2
## [1,] 46 10
pt0_lonlat@coords
## coords.x1 coords.x2
## [1,] 10 46
# Output LAEA89
pt1_wgs32n_laea89@coords
## coords.x1 coords.x2
## [1,] 2543009 4321000
pt1_psmerc_laea89@coords
## coords.x1 coords.x2
## [1,] 2543009 4321000
pt1_etrs32_laea89@coords
## coords.x1 coords.x2
## [1,] 2543009 4321000
pt0_laea89@coords
## coords.x1 coords.x2
## [1,] 4321000 2543009
# Output ETRSAT
pt1_wgs32n_etrsat@coords
## coords.x1 coords.x2
## [1,] 238826.4 141868.2
pt1_psmerc_etrsat@coords
## coords.x1 coords.x2
## [1,] 238826.4 141868.2
pt1_etrs32_etrsat@coords
## coords.x1 coords.x2
## [1,] 238826.4 141868.2
pt0_etrsat@coords
## coords.x1 coords.x2
## [1,] 141868.2 238826.4Reprojections from YX to XY CRSs:
# Output WGS32N
pt2_lonlat_inv_wgs32n@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt2_laea89_inv_wgs32n@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt2_etrsat_inv_wgs32n@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt0_wgs32n@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
# Output PSMERC
pt2_lonlat_inv_psmerc@coords
## coords.x1 coords.x2
## [1,] 1113195 5780349
pt2_laea89_inv_psmerc@coords
## coords.x1 coords.x2
## [1,] 1113195 5780349
pt2_etrsat_inv_psmerc@coords
## coords.x1 coords.x2
## [1,] 1113195 5780349
pt0_psmerc@coords
## coords.x1 coords.x2
## [1,] 1113195 5780349
# Output ETRS32
pt2_lonlat_inv_etrs32@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt2_laea89_inv_etrs32@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt2_etrsat_inv_etrs32@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534
pt0_etrs32@coords
## coords.x1 coords.x2
## [1,] 577432.2 5094534Reprojections from / to YX CRSs:
# Output LONLAT
pt2_laea89_inv_lonlat@coords
## coords.x1 coords.x2
## [1,] 46 10
pt2_etrsat_inv_lonlat@coords
## coords.x1 coords.x2
## [1,] 46 10
pt0_lonlat@coords
## coords.x1 coords.x2
## [1,] 10 46
# Output LAEA89
pt2_lonlat_inv_laea89@coords
## coords.x1 coords.x2
## [1,] 2543009 4321000
pt2_etrsat_inv_laea89@coords
## coords.x1 coords.x2
## [1,] 2543009 4321000
pt0_laea89@coords
## coords.x1 coords.x2
## [1,] 4321000 2543009
# Output ETRSAT
pt2_lonlat_inv_etrsat@coords
## coords.x1 coords.x2
## [1,] 238826.4 141868.2
pt2_laea89_inv_etrsat@coords
## coords.x1 coords.x2
## [1,] 238826.4 141868.2
pt0_etrsat@coords
## coords.x1 coords.x2
## [1,] 141868.2 238826.4