From ca8b9072891064876fc6d4cb7bb9a5ce7169658a Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Fri, 18 Feb 2022 23:57:11 +0100 Subject: 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 --- scripts/build_db_from_esri.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3