Learn R Programming

gdalraster (version 1.11.1)

srs_is_same: Do these two spatial references describe the same system?

Description

srs_is_same() returns TRUE if these two spatial references describe the same system. This is a wrapper for OSRIsSame() in the GDAL Spatial Reference System C API.

Usage

srs_is_same(
  srs1,
  srs2,
  criterion = "",
  ignore_axis_mapping = FALSE,
  ignore_coord_epoch = FALSE
)

Value

Logical. TRUE if these two spatial references describe the same system, otherwise FALSE.

Arguments

srs1

Character string. OGC WKT for a spatial reference system.

srs2

Character string. OGC WKT for a spatial reference system.

criterion

Character string. One of STRICT, EQUIVALENT, EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS. Defaults to EQUIVALENT_EXCEPT_AXIS_ORDER_GEOGCRS.

ignore_axis_mapping

Logical scalar. If TRUE, sets IGNORE_DATA_AXIS_TO_SRS_AXIS_MAPPING=YES in the call to OSRIsSameEx() in the GDAL Spatial Reference System API. Defaults to NO.

ignore_coord_epoch

Logical scalar. If TRUE, sets IGNORE_COORDINATE_EPOCH=YES in the call to OSRIsSameEx() in the GDAL Spatial Reference System API. Defaults to NO.

See Also

srs_is_geographic(), srs_is_projected()

Examples

Run this code
elev_file <- system.file("extdata/storml_elev.tif", package="gdalraster")
ds <- new(GDALRaster, elev_file, TRUE)
srs_is_same(ds$getProjectionRef(), epsg_to_wkt(26912))
srs_is_same(ds$getProjectionRef(), epsg_to_wkt(5070))
ds$close()

Run the code above in your browser using DataLab