List PROJ 6 coordinate operations for a pair of source/target coordinate reference systems

list_coordOps(src_crs, tgt_crs, area_of_interest = as.numeric(NA), 
 strict_containment = FALSE, visualization_order = NULL)
best_instantiable_coordOp(x)
# S3 method for coordOps
print(x, ...)

Arguments

src_crs

Source coordinate reference system string

tgt_crs

Target coordinate reference system string

area_of_interest

Numeric vector; either NA, or the xmin, ymin, xmax, ymax of the bounding box of the area of interest. This may be used to restrict the search for coordinate operations

strict_containment

default FALSE, permit partial matching of the area of interest; if TRUE strictly contain the area of interest. The area of interest is either as given, or as implied by the source/target coordinate reference systems (FIXME)

visualization_order

default NULL, taking the value of get_enforce_xy(); if TRUE always choose x or longitude for the first axis; if FALSE, follow the axis orders given by the coordinate reference systems when constructing the coordinate operation

x

an object of class "coordOps"

...

arguments possibly passed through, unused

Details

(FIXME)

Value

A data frame with rows showing the coordinate operations found, and columns:

description

String describing the operation

definition

PROJ pipeline for executing the operation

accuracy

Accuracy in meters, if negative, unknown

instantiable

Can this operation be carried out with available resources

ballpark

Does this operation only have ballpark accuracy

number_grids

The number of grids required for the operation

The object has a "grids" attribute containing a nested list of grids for each coordinate operations found; if number_grids == 0, NULL, otherwise a list of grids. For each grid required, the short and long names of the grid are given, the package name if available in a PROJ grid package, and the download URL for that package. Three logical variables report whether the grid may be downloaded directly, whether it has an open license, and whether it is available.

References

https://proj.org/

Author

Roger Bivand Roger.Bivand@nhh.no

Note

Fragile: work in progress

Examples

run <- new_proj_and_gdal()
if (run) {
  discarded_datum <- showSRID("EPSG:27700", "PROJ")
  (x <- list_coordOps(paste0(discarded_datum, " +type=crs"), "OGC:CRS84"))
}
#> Candidate coordinate operations found:  1 
#> Strict containment:  FALSE 
#> Visualization order:  TRUE 
#> Source: +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000
#>         +y_0=-100000 +ellps=airy +units=m +no_defs +type=crs
#>         +type=crs
#> Target: OGC:CRS84 
#> Best instantiable operation has only ballpark accuracy 
#> Description: Inverse of unknown + Ballpark geographic offset from unknown to
#>              WGS 84 (CRS84)
#> Definition:  +proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2
#>              +k=0.9996012717 +x_0=400000 +y_0=-100000
#>              +ellps=airy +step +proj=unitconvert +xy_in=rad
#>              +xy_out=deg
if (run) {
  best_instantiable_coordOp(x)
}
#> Warning: Best instantiable operation has only ballpark accuracy
#> [1] "+proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +step +proj=unitconvert +xy_in=rad +xy_out=deg"
#> attr(,"description")
#> [1] "Inverse of unknown + Ballpark geographic offset from unknown to WGS 84 (CRS84)"
if (run) {
  restored_datum <- showSRID("EPSG:27700", "PROJ")
  list_coordOps(paste0(restored_datum, " +datum=OSGB36 +type=crs"), "OGC:CRS84")
}
#> Candidate coordinate operations found:  9 
#> Strict containment:  FALSE 
#> Visualization order:  TRUE 
#> Source: +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000
#>         +y_0=-100000 +ellps=airy +units=m +no_defs +type=crs
#>         +datum=OSGB36 +type=crs
#> Target: OGC:CRS84 
#> Best instantiable operation has accuracy: 2 m
#> Description: Inverse of unknown + OSGB36 to WGS 84 (6) + axis order change
#>              (2D)
#> Definition:  +proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2
#>              +k=0.9996012717 +x_0=400000 +y_0=-100000
#>              +ellps=airy +step +proj=push +v_3 +step +proj=cart
#>              +ellps=airy +step +proj=helmert +x=446.448
#>              +y=-125.157 +z=542.06 +rx=0.15 +ry=0.247 +rz=0.842
#>              +s=-20.489 +convention=position_vector +step +inv
#>              +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step
#>              +proj=unitconvert +xy_in=rad +xy_out=deg
#> Operation 8 is lacking 1 grid with accuracy 1 m
#> Missing grid: uk_os_OSTN15_NTv2_OSGBtoETRS.tif 
#> URL: https://cdn.proj.org/uk_os_OSTN15_NTv2_OSGBtoETRS.tif 
if (run) {
  wkt_datum <- showSRID("EPSG:27700", "WKT2")
  (x <- list_coordOps(wkt_datum, "OGC:CRS84"))
}
#> Candidate coordinate operations found:  11 
#> Strict containment:  FALSE 
#> Visualization order:  TRUE 
#> Source: PROJCRS["OSGB36 / British National Grid", BASEGEOGCRS["OSGB36",
#>         DATUM["Ordnance Survey of Great Britain 1936",
#>         ELLIPSOID["Airy 1830", 6377563.396, 299.3249646,
#>         LENGTHUNIT["metre", 1]]], PRIMEM["Greenwich", 0,
#>         ANGLEUNIT["degree", 0.0174532925199433]], ID["EPSG",
#>         4277]], CONVERSION["British National Grid",
#>         METHOD["Transverse Mercator", ID["EPSG", 9807]],
#>         PARAMETER["Latitude of natural origin", 49,
#>         ANGLEUNIT["degree", 0.0174532925199433], ID["EPSG",
#>         8801]], PARAMETER["Longitude of natural origin", -2,
#>         ANGLEUNIT["degree", 0.0174532925199433], ID["EPSG",
#>         8802]], PARAMETER["Scale factor at natural origin",
#>         0.9996012717, SCALEUNIT["unity", 1], ID["EPSG", 8805]],
#>         PARAMETER["False easting", 400000, LENGTHUNIT["metre",
#>         1], ID["EPSG", 8806]], PARAMETER["False northing",
#>         -100000, LENGTHUNIT["metre", 1], ID["EPSG", 8807]]],
#>         CS[Cartesian, 2], AXIS["(E)", east, ORDER[1],
#>         LENGTHUNIT["metre", 1]], AXIS["(N)", north, ORDER[2],
#>         LENGTHUNIT["metre", 1]], USAGE[ SCOPE["Engineering
#>         survey, topographic mapping."], AREA["United Kingdom
#>         (UK) - offshore to boundary of UKCS within 49°45'N to
#>         61°N and 9°W to 2°E; onshore Great Britain (England,
#>         Wales and Scotland). Isle of Man onshore."],
#>         BBOX[49.75, -9, 61.01, 2.01]], ID["EPSG", 27700]]
#> Target: OGC:CRS84 
#> Best instantiable operation has accuracy: 2 m
#> Description: Inverse of British National Grid + OSGB36 to WGS 84 (6) + axis
#>              order change (2D)
#> Definition:  +proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2
#>              +k=0.9996012717 +x_0=400000 +y_0=-100000
#>              +ellps=airy +step +proj=push +v_3 +step +proj=cart
#>              +ellps=airy +step +proj=helmert +x=446.448
#>              +y=-125.157 +z=542.06 +rx=0.15 +ry=0.247 +rz=0.842
#>              +s=-20.489 +convention=position_vector +step +inv
#>              +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step
#>              +proj=unitconvert +xy_in=rad +xy_out=deg
#> Operation 10 is lacking 1 grid with accuracy 1 m
#> Missing grid: uk_os_OSTN15_NTv2_OSGBtoETRS.tif 
#> URL: https://cdn.proj.org/uk_os_OSTN15_NTv2_OSGBtoETRS.tif 
if (run) {
  best_instantiable_coordOp(x)
}
#> [1] "+proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2 +k=0.9996012717 +x_0=400000 +y_0=-100000 +ellps=airy +step +proj=push +v_3 +step +proj=cart +ellps=airy +step +proj=helmert +x=446.448 +y=-125.157 +z=542.06 +rx=0.15 +ry=0.247 +rz=0.842 +s=-20.489 +convention=position_vector +step +inv +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step +proj=unitconvert +xy_in=rad +xy_out=deg"
#> attr(,"description")
#> [1] "Inverse of British National Grid + OSGB36 to WGS 84 (6) + axis order change (2D)"
if (run) {
  list_coordOps("EPSG:27700", "OGC:CRS84")
}
#> Candidate coordinate operations found:  11 
#> Strict containment:  FALSE 
#> Visualization order:  TRUE 
#> Source: EPSG:27700 
#> Target: OGC:CRS84 
#> Best instantiable operation has accuracy: 2 m
#> Description: Inverse of British National Grid + OSGB36 to WGS 84 (6) + axis
#>              order change (2D)
#> Definition:  +proj=pipeline +step +inv +proj=tmerc +lat_0=49 +lon_0=-2
#>              +k=0.9996012717 +x_0=400000 +y_0=-100000
#>              +ellps=airy +step +proj=push +v_3 +step +proj=cart
#>              +ellps=airy +step +proj=helmert +x=446.448
#>              +y=-125.157 +z=542.06 +rx=0.15 +ry=0.247 +rz=0.842
#>              +s=-20.489 +convention=position_vector +step +inv
#>              +proj=cart +ellps=WGS84 +step +proj=pop +v_3 +step
#>              +proj=unitconvert +xy_in=rad +xy_out=deg
#> Operation 10 is lacking 1 grid with accuracy 1 m
#> Missing grid: uk_os_OSTN15_NTv2_OSGBtoETRS.tif 
#> URL: https://cdn.proj.org/uk_os_OSTN15_NTv2_OSGBtoETRS.tif 
if (run) {
}
#> NULL
if (run) {
  discarded_datum <- showSRID("EPSG:22525", "PROJ")
  list_coordOps(paste0(discarded_datum, " +type=crs"), "EPSG:31985")
}
#> Candidate coordinate operations found:  1 
#> Strict containment:  FALSE 
#> Visualization order:  TRUE 
#> Source: +proj=utm +zone=25 +south +ellps=intl +units=m +no_defs
#>         +type=crs +type=crs
#> Target: EPSG:31985 
#> Best instantiable operation has only ballpark accuracy 
#> Description: Inverse of UTM zone 25S + Ballpark geographic offset from
#>              unknown to SIRGAS 2000 + UTM zone 25S
#> Definition:  +proj=pipeline +step +inv +proj=utm +zone=25 +south +ellps=intl
#>              +step +proj=utm +zone=25 +south +ellps=GRS80
if (run) {
}
#> NULL
if (run) {
  wkt_datum <- showSRID("EPSG:22525", "WKT2")
  list_coordOps(wkt_datum, "EPSG:31985")
}
#> Candidate coordinate operations found:  2 
#> Strict containment:  FALSE 
#> Visualization order:  TRUE 
#> Source: PROJCRS["Corrego Alegre 1970-72 / UTM zone 25S",
#>         BASEGEOGCRS["Corrego Alegre 1970-72", DATUM["Corrego
#>         Alegre 1970-72", ELLIPSOID["International 1924",
#>         6378388, 297, LENGTHUNIT["metre", 1]]],
#>         PRIMEM["Greenwich", 0, ANGLEUNIT["degree",
#>         0.0174532925199433]], ID["EPSG", 4225]],
#>         CONVERSION["UTM zone 25S", METHOD["Transverse
#>         Mercator", ID["EPSG", 9807]], PARAMETER["Latitude of
#>         natural origin", 0, ANGLEUNIT["degree",
#>         0.0174532925199433], ID["EPSG", 8801]],
#>         PARAMETER["Longitude of natural origin", -33,
#>         ANGLEUNIT["degree", 0.0174532925199433], ID["EPSG",
#>         8802]], PARAMETER["Scale factor at natural origin",
#>         0.9996, SCALEUNIT["unity", 1], ID["EPSG", 8805]],
#>         PARAMETER["False easting", 500000, LENGTHUNIT["metre",
#>         1], ID["EPSG", 8806]], PARAMETER["False northing",
#>         10000000, LENGTHUNIT["metre", 1], ID["EPSG", 8807]]],
#>         CS[Cartesian, 2], AXIS["(E)", east, ORDER[1],
#>         LENGTHUNIT["metre", 1]], AXIS["(N)", north, ORDER[2],
#>         LENGTHUNIT["metre", 1]], USAGE[ SCOPE["Engineering
#>         survey, topographic mapping."], AREA["Brazil - onshore
#>         east of 36°W ."], BBOX[-10.1, -36, -4.99, -34.74]],
#>         ID["EPSG", 22525]]
#> Target: EPSG:31985 
#> Best instantiable operation has accuracy: 5 m
#> Description: Inverse of UTM zone 25S + Corrego Alegre 1970-72 to SIRGAS 2000
#>              (2) + UTM zone 25S
#> Definition:  +proj=pipeline +step +inv +proj=utm +zone=25 +south +ellps=intl
#>              +step +proj=push +v_3 +step +proj=cart +ellps=intl
#>              +step +proj=helmert +x=-206.05 +y=168.28 +z=-3.82
#>              +step +inv +proj=cart +ellps=GRS80 +step +proj=pop
#>              +v_3 +step +proj=utm +zone=25 +south +ellps=GRS80
#> Operation 2 is lacking 1 grid with accuracy 2 m
#> Missing grid: br_ibge_CA7072_003.tif 
#> URL: https://cdn.proj.org/br_ibge_CA7072_003.tif 
if (run) {
  (x <- list_coordOps("EPSG:22525", "EPSG:31985"))
}
#> Candidate coordinate operations found:  2 
#> Strict containment:  FALSE 
#> Visualization order:  TRUE 
#> Source: EPSG:22525 
#> Target: EPSG:31985 
#> Best instantiable operation has accuracy: 5 m
#> Description: Inverse of UTM zone 25S + Corrego Alegre 1970-72 to SIRGAS 2000
#>              (2) + UTM zone 25S
#> Definition:  +proj=pipeline +step +inv +proj=utm +zone=25 +south +ellps=intl
#>              +step +proj=push +v_3 +step +proj=cart +ellps=intl
#>              +step +proj=helmert +x=-206.05 +y=168.28 +z=-3.82
#>              +step +inv +proj=cart +ellps=GRS80 +step +proj=pop
#>              +v_3 +step +proj=utm +zone=25 +south +ellps=GRS80
#> Operation 2 is lacking 1 grid with accuracy 2 m
#> Missing grid: br_ibge_CA7072_003.tif 
#> URL: https://cdn.proj.org/br_ibge_CA7072_003.tif 
if (run) {
  best_instantiable_coordOp(x)
}
#> [1] "+proj=pipeline +step +inv +proj=utm +zone=25 +south +ellps=intl +step +proj=push +v_3 +step +proj=cart +ellps=intl +step +proj=helmert +x=-206.05 +y=168.28 +z=-3.82 +step +inv +proj=cart +ellps=GRS80 +step +proj=pop +v_3 +step +proj=utm +zone=25 +south +ellps=GRS80"
#> attr(,"description")
#> [1] "Inverse of UTM zone 25S + Corrego Alegre 1970-72 to SIRGAS 2000 (2) + UTM zone 25S"