Finding operations¶
operations() lists the coordinate operations
the active database holds: conversions such as map projections,
transformations between datums, and the chains an authority publishes as
concatenated operations.
Transformations between two CRSs¶
source_crs and target_crs find the operations registered between two
CRSs. Each entry states its method, accuracy, version and area of use:
from geodetic_engine import catalog
ed50_to_wgs84 = catalog.operations(source_crs="EPSG:4230", target_crs="EPSG:4326")
print(len(ed50_to_wgs84), "transformations from ED50 to WGS 84")
ed50_to_wgs84.to_dataframe()[
["authority_code", "name", "method", "accuracy", "version", "area_of_use"]
].head(10)
44 transformations from ED50 to WGS 84
| authority_code | name | method | accuracy | version | area_of_use | |
|---|---|---|---|---|---|---|
| 0 | EPSG:1075 | ED50 to WGS 84 (38) | Geocentric translations (geog2D domain) (EPSG:... | 10 | TPAO-Tur | Israel and Palestine - offshore Mediterranean ... |
| 1 | EPSG:1087 | ED50 to WGS 84 (37) | Geocentric translations (geog2D domain) (EPSG:... | 2.5 | RJGC-Jor | Jordan. |
| 2 | EPSG:1133 | ED50 to WGS 84 (1) | Geocentric translations (geog2D domain) (EPSG:... | 10 | DMA-mean | Austria; Belgium; Denmark; Finland; Faroe isla... |
| 3 | EPSG:1134 | ED50 to WGS 84 (2) | Geocentric translations (geog2D domain) (EPSG:... | 6 | DMA-cenEur | Austria; Denmark; France; Germany (west); Neth... |
| 4 | EPSG:1135 | ED50 to WGS 84 (3) | Geocentric translations (geog2D domain) (EPSG:... | 999 | DMA-midEast | Iraq, Israel, Jordan, Lebanon, Kuwait, Saudi A... |
| 5 | EPSG:1136 | ED50 to WGS 84 (4) | Geocentric translations (geog2D domain) (EPSG:... | 26 | DMA-Cyp | Cyprus - onshore and offshore. |
| 6 | EPSG:1137 | ED50 to WGS 84 (5) | Geocentric translations (geog2D domain) (EPSG:... | 13 | DMA-Egy | Egypt - Western Desert. |
| 7 | EPSG:1138 | ED50 to WGS 84 (6) | Geocentric translations (geog2D domain) (EPSG:... | 6 | DMA-Irl Gbr | Channel islands - onshore. Ireland - onshore. ... |
| 8 | EPSG:1139 | ED50 to WGS 84 (7) | Geocentric translations (geog2D domain) (EPSG:... | 7 | DMA-Fin Nor | Finland and Norway - onshore. |
| 9 | EPSG:1140 | ED50 to WGS 84 (8) | Geocentric translations (geog2D domain) (EPSG:... | 44 | DMA-Grc | Greece - onshore. |
max_accuracy keeps only those stating an accuracy, in metres, no worse
than the bound. One that states none is left out, since a bound is a promise:
for entry in catalog.operations(
source_crs="EPSG:4230", target_crs="EPSG:4326",
max_accuracy=1.0, area_of_interest=(2.0, 60.0, 6.0, 64.0),
):
print(f"{entry.authority_code:10} {entry.accuracy} m {entry.version} {entry.area_of_use}")
EPSG:1311 1.0 m UKOOA-CO Denmark - offshore North Sea; Ireland - offshore; Netherlands - offshore; United Kingdom - UKCS offshore.
EPSG:1612 1.0 m EPSG-Nor N62 2001 Norway - offshore north of 62°N. Also Svalbard - onshore and offshore.
EPSG:1613 1.0 m EPSG-Nor S62 2001 Norway - offshore south of 62°N - North Sea.
PROJ applies a transformation in either direction, but registers it in one.
either_direction=True finds it whichever way round you ask:
backwards = catalog.operations(source_crs="EPSG:4326", target_crs="EPSG:4230")
either = catalog.operations(
source_crs="EPSG:4326", target_crs="EPSG:4230", either_direction=True
)
len(backwards), len(either)
(0, 44)
The CRSs can be given as anything
CoordinateReferenceSystem resolves: a code,
a name, an entry, a pyproj CRS, a WKT string or an OSDU record id. A
bound CRS names the CRS it wraps, since operations are registered on
that.
Registered operations, or what PROJ would run¶
The catalog lists what the registry publishes. EPSG registers ED50 to WGS 84
transformations between the geographic CRSs, not between the projected CRSs
built on them. Asked for those, the catalog finds nothing registered, while
available_operations() shows the chains PROJ
would assemble, each projection included:
from geodetic_engine.geodesy import available_operations
registered = catalog.operations(source_crs="EPSG:23031", target_crs="EPSG:32631")
assembled = available_operations("EPSG:23031", "EPSG:32631")
print("registered:", len(registered), " assembled by PROJ:", len(assembled))
for candidate in assembled[:3]:
print(" ", candidate.references, candidate.accuracy)
registered: 0 assembled by PROJ: 43
('EPSG:16031', 'EPSG:1133', 'EPSG:16031') 10.0
('EPSG:16031', 'ESRI:108335', 'EPSG:16031') 10.0
('EPSG:16031', 'EPSG:1612', 'EPSG:16031') 1.0
Answers |
What does the registry publish? |
What would PROJ run between these two CRSs? |
Between |
The CRSs it was registered for |
Any two CRSs |
Chains |
Only those published as concatenated operations |
Also those PROJ assembles |
Deprecated operations |
On request |
Never |
Ballpark operations |
Never |
Listed, flagged |
Without a CRS pair |
Yes: by method, area, accuracy, grid, … |
No |
Either way, an entry’s authority code is a valid operation=:
from geodetic_engine.geodesy import transform
chosen = catalog.operations(code="EPSG:1612").one()
transform("EPSG:4230", "EPSG:4326", (2.5, 63.5), operation=chosen.authority_code).coordinates
((2.4981894757094416, 63.49961374934551),)
By method, kind and grid¶
method takes a method’s code, name or entry:
ntv2_in_europe = catalog.operations(
method="NTv2", area_of_interest=(-10, 35, 30, 72)
)
[str(entry) for entry in ntv2_in_europe][:8]
['OSGB36 to ETRS89 (1) (EPSG:5338)',
'OSGB36 to WGS 84 (7) (EPSG:5339)',
'ED50 to ETRS89 (14) (EPSG:5661)',
'MGI to ETRS89 (5) (EPSG:5891)',
'Lisbon to ETRS89 (4) (EPSG:6188)',
'Datum 73 to ETRS89 (6) (EPSG:6189)',
'TM75 to ETRS89 (3) (EPSG:6946)',
'TM75 to WGS 84 (4) (EPSG:6947)']
kind picks conversions, transformations, concatenated operations or point
motion operations. A conversion is registered without source and target; a
concatenated operation lists its steps:
utm = catalog.operations(code="EPSG:16032").one()
print(utm.kind, utm.method, utm.source_crs)
chain = catalog.operations(code="EPSG:8047").one()
print(chain.kind, [str(step) for step in chain.steps])
conversion Transverse Mercator (EPSG:9807) None
concatenated_operation ['ED50 to ED87 (2) (EPSG:1147)', 'ED87 to WGS 84 (1) (EPSG:1146)']
grid_based keeps the operations that read grid files, and grids_available
those whose every grid PROJ can read now: the file is on this machine or,
with PROJ networking enabled, the database states a direct download under an
open licence for it, as it does for the grids PROJ’s network serves.
grid_names are the names the database states, which are often not the
files PROJ reads:
norway_grids = catalog.operations(grid_based=True, area_name="Norway")
for entry in norway_grids:
print(f"{entry.authority_code:10} {entry.grids_available()!s:5} {entry.grid_names}")
EPSG:10680 False ('BSCD2000.txt',)
EPSG:10681 False ('BSCD2000.txt',)
EPSG:10808 True ('NKG_RF17vel_N.GRI',)
EPSG:10809 True ('NKG_RF17vel.tif',)
EPSG:10811 True ('no_kv_NKGETRF14_EPSG7922_2000.tif', 'NKG_RF17vel.tif')
EPSG:10815 True ('NKG_RF17vel.tif',)
EPSG:10817 True ('NKG_RF17vel.tif', 'no_kv_NKGETRF14_EPSG7922_2000.tif')
EPSG:10854 True ('no_kv_ETRS89NO_NGO48_TIN.json',)
EPSG:10870 True ('NKG_RF17vel.tif', 'no_kv_NKGETRF14_EPSG7922_2000.tif')
EPSG:11156 True ('NNTrans2018B.gtx',)
EPSG:11395 True ('HREF2025A_NN2000_EUREF89.bin',)
EPSG:11396 True ('HREF2025A_NN2000_EUREF89.bin',)
EPSG:11555 True ('no_kv_ETRS89NO_NGO48_TIN.json',)
EPSG:11556 True ('HREF2018B_NN2000_EUREF89.bin',)
EPSG:11557 True ('HREF2018B_NN2000_EUREF89.bin',)
EPSG:11559 True ('href2008a.bin',)
EPSG:11561 True ('href2008a.bin',)
EPSG:11566 True ('ChartDatum_above_Ellipsoid_EUREF89_v2021a.bin',)
EPSG:11567 True ('ChartDatum_above_Ellipsoid_EUREF89_v2021a.bin',)
EPSG:11568 False ('ChartDatum_above_Ellipsoid_EUREF89_v2021b.bin',)
EPSG:11569 False ('ChartDatum_above_Ellipsoid_EUREF89_v2021b.bin',)
EPSG:11570 False ('ChartDatum_above_Ellipsoid_EUREF89_v2023a.bin',)
EPSG:11571 False ('ChartDatum_above_Ellipsoid_EUREF89_v2023a.bin',)
EPSG:11572 True ('ChartDatum_above_Ellipsoid_EUREF89_v2023b.bin',)
EPSG:11573 True ('ChartDatum_above_Ellipsoid_EUREF89_v2023b.bin',)
EPSG:12092 True ('HREF2018B_NN2000_EUREF89.bin', 'HREF2025A_NN2000_EUREF89.bin')
NKG:ETRF00_TO_NO True ('eur_nkg_nkgrf03vel_realigned.tif',)
NKG:ETRF14_TO_NO True ('eur_nkg_nkgrf17vel.tif',)
NKG:ETRF93_2000_TO_ETRF93_1995 True ('eur_nkg_nkgrf03vel_realigned.tif',)
NKG:ITRF2000_TO_NKG_ETRF00 True ('eur_nkg_nkgrf03vel_realigned.tif',)
NKG:ITRF2000_TO_NO True ('eur_nkg_nkgrf03vel_realigned.tif',)
NKG:ITRF2014_TO_NKG_ETRF14 True ('eur_nkg_nkgrf17vel.tif',)
NKG:ITRF2014_TO_NO True ('eur_nkg_nkgrf17vel.tif', 'no_kv_NKGETRF14_EPSG7922_2000.tif')
NKG:NKG_ETRF00_TO_ETRF2000 True ('eur_nkg_nkgrf03vel_realigned.tif',)
NKG:NKG_ETRF14_ETRF93_2000 True ('no_kv_NKGETRF14_EPSG7922_2000.tif',)
NKG:NKG_ETRF14_TO_ETRF2014 True ('eur_nkg_nkgrf17vel.tif',)
NKG:NO_2020_INTRAPLATE True ('eur_nkg_nkgrf17vel.tif',)
missing = catalog.operations(authority="EPSG", grids_available=False, area_name="Norway")
[str(entry) for entry in missing]
['ETRS89 to BSCD2000 depth (1) (EPSG:10680)',
'ETRS89 to ETRS89 + BSCD2000 depth (1) (EPSG:10681)',
'ETRS89-NOR [EUREF89] to CD Norway depth (2) (EPSG:11568)',
'ETRS89-NOR [EUREF89] to ETRS89-NOR [EUREF89] + CD Norway depth (2) (EPSG:11569)',
'ETRS89-NOR [EUREF89] to CD Norway depth (3) (EPSG:11570)',
'ETRS89-NOR [EUREF89] to ETRS89-NOR [EUREF89] + CD Norway depth (3) (EPSG:11571)']
grids() names the files PROJ
reads for an operation, and where each was found, as
GridUsage:
for grid in catalog.operations(code="EPSG:15851").one().grids():
print(grid.name, grid.available, grid.url)
us_noaa_conus.tif True https://cdn.proj.org/us_noaa_conus.tif
The files are looked for on disk. PROJ’s own account of a registered
operation is not used, because it tests the names the authority published
and so reports a grid missing that PROJ reads under its own name
(Known issues and workarounds). The grid files themselves are listed by
grids(); see Grid files.
An operation written as a PROJ string can mark a grid as optional, with @
before its name: PROJ reads it where it is installed, and goes without it
otherwise. Such a grid is in grid_names and also in optional_grid_names,
and grids_available does not ask for it. PROJ’s null grid, which shifts
nothing, is no file and is not listed.
Deprecated and superseded operations¶
PROJ never offers a deprecated operation, so
available_operations() cannot list one. The
catalog can:
deprecated = catalog.operations(
source_crs="EPSG:4230", target_crs="EPSG:4326", deprecated=True
)
for entry in deprecated:
print(entry, "-> replaced by", entry.replaced_by or "nothing stated")
ED50 to WGS 84 (32) (EPSG:1961) -> replaced by nothing stated
ED50 to WGS 84 (32) (EPSG:1999) -> replaced by nothing stated
ED50 to WGS 84 (40) (EPSG:15907) -> replaced by nothing stated
A superseded operation is still valid and still offered. superseded
filters on it, and each entry names its successors:
for entry in catalog.operations(
source_crs="EPSG:4230", target_crs="EPSG:4326", superseded=True
):
print(entry, "-> superseded by", entry.superseded_by)
ED50 to WGS 84 (15) (EPSG:8047) -> superseded by ('EPSG:8569', 'EPSG:1612')
ED50 to WGS 84 (21) (EPSG:8569) -> superseded by ('EPSG:1612',)
Exporting an operation¶
to_json_dict() is the
operation’s PROJJSON as PROJ exports it from the registry, parameters
included:
definition = chosen.to_json_dict()
[(p["name"], p["value"]) for p in definition["parameters"]]
[('X-axis translation', -116.641),
('Y-axis translation', -56.931),
('Z-axis translation', -110.559),
('X-axis rotation', 0.893),
('Y-axis rotation', 0.921),
('Z-axis rotation', -0.917),
('Scale difference', -3.52)]