tests/test_enforce_xy.R

suppressPackageStartupMessages(library(rgdal))
set_thin_PROJ6_warnings(TRUE)
if (new_proj_and_gdal()) {
get_enforce_xy()
x0 <- showSRID("EPSG:4326", multiline=TRUE, EPSG_to_init=FALSE)
cat(x0, "\n")
set_enforce_xy(FALSE)
x1 <- showSRID("EPSG:4326", multiline=TRUE, EPSG_to_init=FALSE)
cat(x1, "\n")
set_enforce_xy(TRUE)
x2 <- showSRID("EPSG:4326", multiline=TRUE, EPSG_to_init=FALSE)
cat(x2, "\n")
get_enforce_xy()
y0 <- showSRID("EPSG:4326", multiline=TRUE, EPSG_to_init=FALSE, prefer_proj=TRUE)
cat(y0, "\n")
showSRID("EPSG:4326", format="PROJ", EPSG_to_init=FALSE, prefer_proj=TRUE)
set_enforce_xy(FALSE)
y1 <- showSRID("EPSG:4326", multiline=TRUE, EPSG_to_init=FALSE, prefer_proj=TRUE)
cat(y1, "\n")
showSRID("EPSG:4326", format="PROJ", EPSG_to_init=FALSE, prefer_proj=TRUE)
set_enforce_xy(TRUE)
y2 <- showSRID("EPSG:4326", multiline=TRUE, EPSG_to_init=FALSE, prefer_proj=TRUE)
cat(y2, "\n")
showSRID("EPSG:4326", format="PROJ", EPSG_to_init=FALSE, prefer_proj=TRUE)
}

Try the rgdal package in your browser

Any scripts or data that you put into this service are public.

rgdal documentation built on June 7, 2023, 5:09 p.m.