http://c7700.com/list-19.html,Migration to PROJ6/GDAL3

博客围绕坐标操作展开,介绍了在搜索可实例化坐标操作时,丢弃基准面信息对结果的影响。通过具体示例展示了不同情况下,如添加有效基准面标签、直接定义查找术语等,对找到的坐标操作数量和精度的影响。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Coordinate operations

library(rgdal)

## rgdal: version: 1.5-1, (SVN revision 870)

## Geospatial Data Abstraction Library extensions to R successfully loaded

## Loaded GDAL runtime: GDAL 3.0.2, released 2019/10/28

## Path to GDAL shared files:

## GDAL binary built with GEOS: TRUE

## Loaded PROJ.4 runtime: Rel. 6.2.1, November 1st, 2019, [PJ_VERSION: 621]

## Path to PROJ.4 shared files: (autodetected)

## Linking to sp version: 1.3-3

run

We can first show what happens when searching for instantiable coordinate operations. These are coordinate operations that can be created by look-up in the PROJ database given the information in the input description. Here the datum has been discarded.

(discarded_datum

## Warning in showSRID("EPSG:27700", "PROJ"): Discarded datum OSGB 1936 in Proj4

## definition

## [1] "+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"

## Warning in showSRID("EPSG:27700", "PROJ"): Discarded datum OSGB_1936 in CRS

## definition

Consequently, when searching for coordinate operations to transform to geographical coordinates and the WGS84 datum, and using importFromProj4() to instantiate the source SRS, the only operation found only has the Airy ellipse information to guide its search. The list_coordOps() function takes two SRS descriptions, and returns coordinate operations found by look-up. We need to add the type tag to a PROJ string here.

(x

## 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: EPSG:4326

## Best instantiable operation has only ballpark accuracy

## Description: Inverse of unknown + Ballpark geographic offset from unknown to

## WGS 84 + 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=unitconvert +xy_in=rad

## +xy_out=deg

## 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

## Target: EPSG:4326

## Best instantiable operation has only ballpark accuracy

## Description: Inverse of unknown + Ballpark geographic offset from unknown to

## WGS 84 + 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=unitconvert +xy_in=rad

## +xy_out=deg

The best_instantiable_coordOp() function retuns the best instantiable coordinate operation, in this case the only one, with a description attribute. This is the current best available in calling spTransform() with "CRS" objects with discarded +datum= tags.

best_instantiable_coordOp(x)

## Warning in best_instantiable_coordOp(x): 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 + axis order change (2D)"

## Warning in best_instantiable_coordOp(x): 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 +

## axis order change (2D)"

If we add back the discarded +datum= tag with a valid value, we give the search process what it needs to find more coordinate operations.

list_coordOps(paste0(discarded_datum, " +datum=OSGB36 +type=crs"), "EPSG:4326")

## 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: EPSG:4326

## Best instantiable operation has accuracy: 2 m

## Description: Inverse of unknown + axis order change (2D) + OSGB 1936 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

Now we have 7 operations, one the ballpark accuracy operation with unknown accuracy found above, 5 others that can be instantiated, of which the best has 2m accuracy, and an operation that cannot be instantiated because a publically available grid is missing. On download and installation of this grid, 1m accuracy could be achieved.

## Candidate coordinate operations found: 7

## 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

## +datum=OSGB36 +type=crs

## Target: EPSG:4326

## Best instantiable operation has accuracy: 2 m

## Description: Inverse of unknown + axis order change (2D) + OSGB 1936 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 6 is lacking 1 grid with accuracy 1 m

## Missing grid: OSTN15_NTv2_OSGBtoETRS.gsb

## URL: https://download.osgeo.org/proj/proj-datumgrid-europe-latest.zip

If we pass the source WKT string to list_coordOps() we get 6 operations back, now without the ballpark accuracy operation; this would be the situation in which WKT comments if present were used to construct the source and target SRS:

wkt_source_datum

wkt_target_datum

(x

## Candidate coordinate operations found: 9

## Strict containment: FALSE

## Visualization order: TRUE

## Source: PROJCRS["OSGB 1936 / British National Grid", BASEGEOGCRS["OSGB

## 1936", DATUM["OSGB 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:

## GEOGCRS["WGS 84 (with axis order normalized for

## visualization)", DATUM["World Geodetic System 1984",

## ELLIPSOID["WGS 84", 6378137, 298.257223563,

## LENGTHUNIT["metre", 1]], ID["EPSG", 6326]],

## PRIMEM["Greenwich", 0, ANGLEUNIT["degree",

## 0.0174532925199433], ID["EPSG", 8901]], CS[ellipsoidal,

## 2], AXIS["geodetic longitude (Lon)", east, ORDER[1],

## ANGLEUNIT["degree", 0.0174532925199433, ID["EPSG",

## 9122]]], AXIS["geodetic latitude (Lat)", north,

## ORDER[2], ANGLEUNIT["degree", 0.0174532925199433,

## ID["EPSG", 9122]]]]

## Best instantiable operation has accuracy: 2 m

## Description: Inverse of British National Grid + OSGB 1936 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

## Candidate coordinate operations found: 6

## Strict containment: FALSE

## Visualization order: TRUE

## Source: PROJCRS["OSGB 1936 / British National Grid", BASEGEOGCRS["OSGB

## 1936", DATUM["OSGB 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["unknown"],

## AREA["UK - Britain and UKCS 49°46'N to 61°01'N, 7°33'W

## to 3°33'E"], BBOX[49.75, -9.2, 61.14, 2.88]],

## ID["EPSG", 27700]]

## Target: 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["geodetic latitude (Lat)",

## north, ORDER[1], ANGLEUNIT["degree",

## 0.0174532925199433]], AXIS["geodetic longitude (Lon)",

## east, ORDER[2], ANGLEUNIT["degree",

## 0.0174532925199433]], USAGE[SCOPE["unknown"],

## AREA["World"], BBOX[-90, -180, 90, 180]], ID["EPSG",

## 4326]]

## Best instantiable operation has accuracy: 2 m

## Description: Inverse of British National Grid + OSGB 1936 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 6 is lacking 1 grid with accuracy 1 m

## Missing grid: OSTN15_NTv2_OSGBtoETRS.gsb

## URL: https://download.osgeo.org/proj/proj-datumgrid-europe-latest.zip

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 + OSGB 1936 to WGS 84 (6) + axis order change (2D)"

## [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 + OSGB 1936 to WGS 84 (6) + axis order change (2D)"

Turning to a different example, a Brazilian UTM25S Corrego Alegre 1970-72 datum, and looking for coordinate operations transform to UTM25S SIRGAS 2000, we see that a +towgs84= tag was preserved.

discarded_datum

## Warning in showSRID("EPSG:22525", "PROJ"): Discarded datum Corrego Alegre

## 1970-72 in Proj4 definition

## Warning in showSRID("EPSG:22525", "PROJ"): Discarded datum Corrego_Alegre_1970-72 in CRS definition,

## but +towgs84= values preserved

This meant that while only ballpark accuracy is reported, a Helmert transformation is carried out:

(x

## 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

## Candidate coordinate operations found: 1

## Strict containment: FALSE

## Visualization order: TRUE

## Source: +proj=utm +zone=25 +south +ellps=intl

## +towgs84=-205.57,168.77,-4.12,0,0,0,0 +units=m +no_defs

## +type=crs

## Target: EPSG:31985

## Best instantiable operation has only ballpark accuracy

## Description: Inverse of UTM zone 25S + Transformation from unknown to WGS84

## + Inverse of SIRGAS 2000 to WGS 84 (1) + 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=-205.57 +y=168.77 +z=-4.12

## +rx=0 +ry=0 +rz=0 +s=0 +convention=position_vector

## +step +inv +proj=cart +ellps=GRS80 +step +proj=pop

## +v_3 +step +proj=utm +zone=25 +south +ellps=GRS80

best_instantiable_coordOp(x)

## Warning in best_instantiable_coordOp(x): Best instantiable operation has only

## ballpark accuracy

## [1] "+proj=pipeline +step +inv +proj=utm +zone=25 +south +ellps=intl +step +proj=utm +zone=25 +south +ellps=GRS80"

## attr(,"description")

## [1] "Inverse of UTM zone 25S + Ballpark geographic offset from unknown to SIRGAS 2000 + UTM zone 25S"

## Warning in best_instantiable_coordOp(x): Best instantiable operation has only

## ballpark accuracy

## [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=-205.57

## +y=168.77 +z=-4.12 +rx=0 +ry=0 +rz=0 +s=0 +convention=position_vector +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 + Transformation from unknown to WGS84 + Inverse of

## SIRGAS 2000 to WGS 84 (1) + UTM zone 25S"

If we move to input WKT strings when searching for coordinate operations, we get to the same result with unknown accuracy but using a Helmert transformation:

wkt_source_datum

wkt_target_datum

(x

## 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:

## PROJCRS["SIRGAS 2000 / UTM zone 25S", BASEGEOGCRS["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]], ID["EPSG", 4674]],

## 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 - between

## 36°W and 30°W, northern and southern hemispheres,

## onshore and offshore."], BBOX[-23.8, -36, 4.19,

## -29.99]], ID["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

## Candidate coordinate operations found: 1

## Strict containment: FALSE

## Visualization order: TRUE

## Source: BOUNDCRS[SOURCECRS[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["unknown"],

## AREA["Brazil - east of 36°W onshore"], BBOX[-10.1, -36,

## -4.99, -34.74]], ID["EPSG", 22525]]],

## 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["Corrego Alegre 1970-72

## to WGS 84 (3)", VERSION["PBS-Bra 1983"],

## METHOD["Geocentric translations (geog2D domain)",

## ID["EPSG", 9603]], PARAMETER["X-axis translation",

## -205.57, ID["EPSG", 8605]], PARAMETER["Y-axis

## translation", 168.77, ID["EPSG", 8606]],

## PARAMETER["Z-axis translation", -4.12, ID["EPSG",

## 8607]], USAGE[SCOPE["Medium and small scale mapping."],

## AREA["Brazil - Corrego Alegre 1970-1972"], BBOX[-33.78,

## -58.16, -2.68, -34.74]], ID["EPSG", 6192],

## REMARK["Formed by concatenation of tfms codes 6191 and

## 1877. Used by Petrobras and ANP until February 2005

## when replaced by Corrego Alegre 1970-72 to WGS 84 (4)

## (tfm code 6194)."]]]

## Target:

## BOUNDCRS[SOURCECRS[PROJCRS["SIRGAS 2000 / UTM zone 25S",

## BASEGEOGCRS["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]], ID["EPSG", 4674]],

## 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["unknown"],

## AREA["Brazil - 36°W to 30°W"], BBOX[-23.8, -36, 4.19,

## -29.99]], ID["EPSG", 31985]]], 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["Accuracy 1m."], AREA["Latin America -

## SIRGAS 2000 by country"], BBOX[-59.87, -122.19, 32.72,

## -25.28]], ID["EPSG", 15894]]]

## Best instantiable operation has only ballpark accuracy

## Description: Inverse of UTM zone 25S + Corrego Alegre 1970-72 to WGS 84 (3)

## + Inverse of SIRGAS 2000 to WGS 84 (1) + 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=-205.57 +y=168.77 +z=-4.12

## +step +inv +proj=cart +ellps=GRS80 +step +proj=pop

## +v_3 +step +proj=utm +zone=25 +south +ellps=GRS80

If we define the look-up terms directly, in this case and unlike that for the OSGB36 datum, we find more operations than when using WKT strings. Now we find one operation with known accuracy (5m), and that a further operation would be possible if a required grid had been present, this grid is not in the PROJ download archive, as no URL is given.

(x

## 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

## 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: CA7072_003.gsb

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"

## [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"

### 回答1: “kotlin-android-extensions” Gradle插件已经被弃用。请使用此迁移指南(https://goo.gle/kotlin-android-extensions-deprecation)开始使用视图绑定(https://developer.android.com/topic/libraries/view-binding)和“kotlin-parcelize”插件。 ### 回答2: 在 Android 开发中,我们通常使用 Kotlin 语言来编写应用程序。Kotlin-Android-Extensions 是一款使用 IntelliJ IDEA 来扩展 Android `View` 类型的插件,这种扩展可以让开发人员更加方便地使用 `View` 类型的属性和方法。 然而,Kotlin-Android-Extensions 插件在开发过程中存在一些问题。其中最大的问题是,它使用运行时反射机制来创建 `View` 对象,这不仅会影响应用程序的运行效果,还可能导致性能问题。为了解决这些问题,Google 官方发布了一个新的插件 —— View Binding。 View Binding 是一种类型安全、高效的方法,可替代 Kotlin-Android-Extensions 插件。使用 View Binding,您可以在编译时生成与布局文件中的每个视图对应的绑定类。这意味着您可以避免因视图引用而引起的错误,同时加快应用程序的启动速度和执行效率。 另一个插件是 Kotlin-Parcelize 插件,它可以轻松序列化和反序列化封装类。这个插件可以将您的数据类自动转换为可序列化类型,并且可以自动生成序列化方法。 所以,如果您正在使用 Kotlin-Android-Extensions,那么现在已经过时了,您应该迁移到 View Binding 和 Kotlin-Parcelize 插件上。使用迁移指南可以快速开发,同时获得更好的性能和可靠性。 ### 回答3: 'kotlin-android-extensions' gradle插件已经被弃用,因此我们需要改用新的View Binding插件(https://developer.android.com/topic/libraries/view-binding)并使用'kotlin-parcelize'插件。这个改动对于那些使用Kotlin编写Android应用程序的开发者来说是一个重大的改动,因为在过去,它可以使得我们快速而轻松地在代码中使用UI控件,而不需要通过任何findViewByID方法。 现在,当我们使用View Binding插件时,我们可以更加安全和可靠地与我们的UI组件进行交互,并且我们不需要担心类型转换和编译时的错误。 当我们将我们的应用程序从'kotlin-android-extensions'转移到View Binding插件时,我们需要使用迁移指南(https://goo.gle/kotlin-android-extensions-deprecation)并下载最新的Android插件和Kotlin插件版本。我们需要为每个布局文件生成一个绑定类,并使用findViewById方法的方式取代View Binding中的方法。 Kotlin Parcelize插件是另一个开发者应该使用的插件,它为我们提供了一个方便且易于使用的方式将我们的Kotlin类序列化和反序列化。这对于使用Kotlin的开发者来说是一个非常有用的功能,而'kotlin-android-extensions'插件则没有这样的功能。 因此,虽然我们需要花费一些额外的时间来迁移到View Binding和Kotlin Parcelize插件,但这样做是值得的,因为它可以使我们的代码更加可靠和类型安全,从而使得我们可以更容易地维护和更新我们的应用程序。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值