diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2022-02-18 23:57:11 +0100 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2022-02-19 00:01:00 +0100 |
| commit | ca8b9072891064876fc6d4cb7bb9a5ce7169658a (patch) | |
| tree | 17fbb920d74b0aeb5440d2e26074e19b0237d20c /scripts/build_db_from_esri.py | |
| parent | 524b76f2e9f4bb8e4a8d2a4287c23e67c67fce07 (diff) | |
| download | PROJ-ca8b9072891064876fc6d4cb7bb9a5ce7169658a.tar.gz PROJ-ca8b9072891064876fc6d4cb7bb9a5ce7169658a.zip | |
Database: insert entries in the alias_name for ESRI transformations that match a EPSG entry
Make it possible to query them by name. e.g. `projinfo "NAD_1927_To_WGS_1984_3"` will return
EPSG:1172 transformation "NAD27 to WGS 84 (3)"
Partially helps use case of https://lists.osgeo.org/pipermail/gdal-dev/2022-February/055480.html
Diffstat (limited to 'scripts/build_db_from_esri.py')
| -rwxr-xr-x | scripts/build_db_from_esri.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/build_db_from_esri.py b/scripts/build_db_from_esri.py index aaf975fb..72b07400 100755 --- a/scripts/build_db_from_esri.py +++ b/scripts/build_db_from_esri.py @@ -1886,7 +1886,7 @@ def import_geogtran(): 'EPSG', wkid] cursor.execute( - "SELECT name FROM coordinate_operation_view WHERE auth_name = 'EPSG' AND code = ?", (wkid,)) + "SELECT name, table_name FROM coordinate_operation_view WHERE auth_name = 'EPSG' AND code = ?", (wkid,)) src_row = cursor.fetchone() if not src_row: @@ -1897,9 +1897,13 @@ def import_geogtran(): print('Skipping NADCON5 %s (EPSG source) since it uses a non-supported yet suported method' % esri_name) continue - # Don't do anything particular except checking we know it assert src_row, row + _, table_name = src_row + # Insert alias + sql = f"INSERT INTO \"alias_name\" VALUES('{table_name}','EPSG',{wkid},'{esri_name}','ESRI');" + all_sql.append(sql) + else: # We don't want to import ESRI deprecated transformations |
