Grid files¶
grids() lists the grid files the operations in
the active database read, and those PROJ’s grid_alternatives table knows that
no operation reads. Each says whether it is installed on this machine:
from geodetic_engine import catalog
catalog.grids(area_name="Norway").to_dataframe()[
["name", "kind", "format", "installed", "used_by"]
]
| name | kind | format | installed | used_by | |
|---|---|---|---|---|---|
| 0 | BSCD2000.txt | vertical | NaN | False | (EPSG:10680, EPSG:10681) |
| 1 | ChartDatum_above_Ellipsoid_EUREF89_v2021b.bin | vertical | NaN | False | (EPSG:10130, EPSG:10133, EPSG:11568, EPSG:11569) |
| 2 | ChartDatum_above_Ellipsoid_EUREF89_v2023a.bin | vertical | NaN | False | (EPSG:10504, EPSG:10505, EPSG:11570, EPSG:11571) |
| 3 | eur_nkg_nkgrf03vel_realigned.tif | velocity | GTiff | True | (NKG:ETRF00_TO_DK, NKG:ETRF00_TO_EE, NKG:ETRF0... |
| 4 | eur_nkg_nkgrf17vel.tif | velocity | GTiff | True | (EPSG:10808, EPSG:10809, EPSG:10810, EPSG:1081... |
| 5 | no_kv_CD_above_Ell_ETRS89_v2021a.tif | vertical | GTiff | True | (EPSG:9884, EPSG:9885, EPSG:11566, EPSG:11567) |
| 6 | no_kv_CD_above_Ell_ETRS89_v2023b.tif | vertical | GTiff | True | (EPSG:10509, EPSG:10510, EPSG:11572, EPSG:11573) |
| 7 | no_kv_ETRS89NO_NGO48_TIN.json | horizontal | JSON | True | (EPSG:10854, EPSG:11555) |
| 8 | no_kv_href2008a.tif | vertical | GTiff | True | (EPSG:9484, EPSG:9594, EPSG:11559, EPSG:11561) |
| 9 | no_kv_HREF2018B_NN2000_EUREF89.tif | vertical | GTiff | True | (EPSG:9485, EPSG:9593, EPSG:11398, EPSG:11556,... |
| 10 | no_kv_HREF2018B_NN54_NN2000.tif | vertical | GTiff | True | (EPSG:11156,) |
| 11 | no_kv_HREF2025A_NN2000_EUREF89.tif | vertical | GTiff | True | (EPSG:11395, EPSG:11396, EPSG:11398, EPSG:12092) |
| 12 | no_kv_NKGETRF14_EPSG7922_2000.tif | geocentric | GTiff | True | (EPSG:10811, EPSG:10817, EPSG:10870, NKG:ITRF2... |
One entry per file PROJ reads¶
Authorities name grids their own way, and PROJ maps each name to the file it reads. An entry is that file, with the names operations use for it:
conus = catalog.grids(operation="EPSG:15851").one()
print(conus.name)
print(conus.original_names)
print(conus.kind, conus.format, conus.proj_method)
print(conus.url)
us_noaa_conus.tif
('conus.las', 'conus.los')
horizontal GTiff hgridshift
https://cdn.proj.org/us_noaa_conus.tif
NADCON publishes a grid as two files, one of latitude and one of longitude shifts, where PROJ reads one file holding both. Both names are listed under that file, as above. A grid PROJ has no file of its own for is listed under the name the database states.
used_by lists the operations reading a grid, and operation turns that
round:
len(conus.used_by), "operations read", conus.name
(87, 'operations read', 'us_noaa_conus.tif')
Installed, or missing¶
installed is whether PROJ finds the file on this machine: under name, or
under old_proj_name, the name of PROJ’s older release of the grid, which
PROJ falls back to. It is looked for in the directories on PROJ’s search path
and in PROJ’s user data directory. A file under one of original_names does
not count: PROJ asks for its own file, and cannot read NADCON’s conus.las
and conus.los at all. It is checked each time a listing is read, so a grid
installed since shows at once:
from collections import Counter
Counter(grid.installed for grid in catalog.grids(used=True))
Counter({True: 331, False: 206})
missing_vertical = catalog.grids(kind="vertical", installed=False, area_name="Norway")
[(g.name, g.url) for g in missing_vertical]
[('BSCD2000.txt', None),
('ChartDatum_above_Ellipsoid_EUREF89_v2021b.bin', None),
('ChartDatum_above_Ellipsoid_EUREF89_v2023a.bin', None)]
Note
OperationEntry.grids_available
applies the same test to every file an operation reads, with one difference:
with PROJ networking enabled, a grid PROJ can download counts as available
there while it is not installed here. PROJ can download a grid the database
states a direct download and an open licence for; a URL alone is not enough.
On the content delivery network¶
check_remote=True asks PROJ’s content delivery network which grids it
publishes, and fills in remote_available. It is the only listing that uses
the network, and reads the list once per process:
for grid in catalog.grids(kind="vertical", installed=False, check_remote=True):
print(grid.name, grid.remote_available)
remote_available=True keeps only the grids it publishes, and implies
check_remote. A network failure raises
GridIndexUnavailableError.
Kinds¶
GridKind says what a grid corrects, from how
PROJ applies it or, where PROJ does not say, from the method of an operation
reading it:
Counter(grid.kind.value for grid in catalog.grids())
Counter({'vertical': 300,
'horizontal': 248,
'geocentric': 8,
'velocity': 8,
'deformation': 7,
'unknown': 3})