Skip to content

Commit

Permalink
Merge pull request OSGeo#4286 from rouault/backport_pr_4282
Browse files Browse the repository at this point in the history
[Backport 9.5] Database: ingest deprecated ESRI names to be able to better import old WKT ESRI
  • Loading branch information
rouault authored Oct 27, 2024
2 parents 56ee326 + dfb1805 commit 2ed68be
Show file tree
Hide file tree
Showing 4 changed files with 249 additions and 7 deletions.
2 changes: 1 addition & 1 deletion data/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ set(ALL_SQL_IN "${CMAKE_CURRENT_BINARY_DIR}/all.sql.in")
set(PROJ_DB "${CMAKE_CURRENT_BINARY_DIR}/proj.db")
include(sql_filelist.cmake)

set(PROJ_DB_SQL_EXPECTED_MD5 "9e3a1467df1fcfccd029ecfcc676803d")
set(PROJ_DB_SQL_EXPECTED_MD5 "e79756a676944c797df968346c3016fd")

add_custom_command(
OUTPUT ${PROJ_DB}
Expand Down
109 changes: 109 additions & 0 deletions data/sql/esri.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3557,6 +3557,46 @@ INSERT INTO "geodetic_crs" VALUES('ESRI','104999','Charon_2015',NULL,'geographic
INSERT INTO "usage" VALUES('ESRI', '104999_USAGE','geodetic_crs','ESRI','104999','EPSG','1262','EPSG','1024');
INSERT INTO "deprecation" VALUES('geodetic_crs','ESRI','4305','ESRI','104026','ESRI');
INSERT INTO "deprecation" VALUES('geodetic_crs','ESRI','4812','ESRI','104025','ESRI');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6314','D_Deutsche_Hauptdreiecksnetz','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','ESRI','106234','D_K0_1949','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6696','D_Kasai_1955','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6737','D_Korea_2000','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6181','D_Luxembourg_1930','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6140','D_North_American_1983_CSRS98','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','ESRI','106245','D_Observ_Meteorological_1939','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6683','D_Phillipine_Reference_System_1992','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','ESRI','106235','D_Piton_des_Neiges','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','ESRI','106235','D_Reunion','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','1064','D_SIRGAS-Chile','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6629','D_Tahaa','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_datum','EPSG','6628','D_Tahiti','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9308','ATRF2014_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9701','ETRF2000-PL_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4223','GCS_Carthage_Degree','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4314','GCS_Deutsche_Hauptdreiecksnetz','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4698','GCS_K0_1949','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4696','GCS_Kasai_1955','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4737','GCS_Korea_2000','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4181','GCS_Luxembourg_1930','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4617','GCS_North_American_1983_CSRS98','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','ESRI','37245','GCS_Observ_Meteorologico_1939','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4626','GCS_Piton_des_Neiges','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4626','GCS_Reunion','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','5360','GCS_SIRGAS-Chile','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','5359','GCS_SIRGAS-Chile_3D','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4629','GCS_Tahaa','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4628','GCS_Tahiti','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','4304','GCS_Voirol_1875_Degree','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9379','IGb14_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9332','KSA-GRF17_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9546','LTF2004(G)_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9893','LUREF_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','5342','POSGAR_3D','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9695','REDGEOMIN_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','20040','SIRGAS-Chile_2021_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9469','SRGI2013_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9754','WGS_1984_(G2139)_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('geodetic_crs','EPSG','9754','WGS_84_(G2139)_(3D)','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2000','Anguilla_1957_British_West_Indies_Grid','ESRI');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2001','Antigua_1943_British_West_Indies_Grid','ESRI');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2002','Dominica_1945_British_West_Indies_Grid','ESRI');
Expand Down Expand Up @@ -17168,6 +17208,60 @@ INSERT INTO "deprecation" VALUES('projected_crs','ESRI','103873','EPSG','22615',
INSERT INTO "deprecation" VALUES('projected_crs','ESRI','103874','EPSG','22616','ESRI');
INSERT INTO "deprecation" VALUES('projected_crs','ESRI','103875','EPSG','22617','ESRI');
INSERT INTO "deprecation" VALUES('projected_crs','ESRI','103876','EPSG','22618','ESRI');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3461','Dabola_UTM_Zone_28N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3462','Dabola_UTM_Zone_29N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3119','Douala_1948_AOF_West','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3378','GDM_2000_State_Cassini_Negeri_Sembilan_&_Melaka','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3382','GDM_2000_State_Cassini_Pulau_Pinang_&_Seberang_Perai','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','29902','Irish_National_Grid','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3336','K0_1949_UTM_42S','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','5181','Korea_2000_Korea_Central_Belt','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102082','Korea_2000_Korea_Central_Belt_2010','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','5182','Korea_2000_Korea_Central_Belt_Jeju','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','5183','Korea_2000_Korea_East_Belt','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102083','Korea_2000_Korea_East_Belt_2010','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','5184','Korea_2000_Korea_East_Sea_Belt','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102084','Korea_2000_Korea_East_Sea_Belt_2010','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102080','Korea_2000_Korea_Unified_Coordinate_System','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','5180','Korea_2000_Korea_West_Belt','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102081','Korea_2000_Korea_West_Belt_2010','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3346','Lietuvos_Koordinaciu_Sistema','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2169','Luxembourg_1930_Gauss','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','8677','MGI_1901_Balkans_5','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','8678','MGI_1901_Balkans_6','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','6316','MGI_1901_Balkans_7','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','8679','MGI_1901_Balkans_8','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','32045','NAD_1927_StatePlane_Vermont_FIPS_3400','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2952','NAD_1983_CRS98_MTM_10','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2945','NAD_1983_CRS98_MTM_3','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2946','NAD_1983_CRS98_MTM_4','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2947','NAD_1983_CRS98_MTM_5','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2948','NAD_1983_CRS98_MTM_6','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2949','NAD_1983_CRS98_MTM_7','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2950','NAD_1983_CRS98_MTM_8','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2951','NAD_1983_CRS98_MTM_9','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2944','NAD_1983_CSRS98_MTM_2_SCoPQ','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2953','NAD_1983_CSRS98_New_Brunswick_Stereographic','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2954','NAD_1983_CSRS98_Prince_Edward_Island','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2955','NAD_1983_CSRS98_UTM_Zone_11N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2956','NAD_1983_CSRS98_UTM_Zone_12N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2957','NAD_1983_CSRS98_UTM_Zone_13N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102234','NAD_1983_CSRS98_UTM_Zone_14N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102235','NAD_1983_CSRS98_UTM_Zone_15N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102236','NAD_1983_CSRS98_UTM_Zone_16N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2958','NAD_1983_CSRS98_UTM_Zone_17N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2959','NAD_1983_CSRS98_UTM_Zone_18N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2960','NAD_1983_CSRS98_UTM_Zone_19N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2961','NAD_1983_CSRS98_UTM_Zone_20N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2962','NAD_1983_CSRS98_UTM_Zone_21N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','ESRI','102166','Observ_Meteorologico_1939_UTM_Zone_25N','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3727','Piton_des_Neiges_TM_Reunion','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3350','Pulkovo_1942_CS63_Zone_K0','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','3351','Pulkovo_1942_CS63_Zone_K1','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','5362','SIRGAS-Chile_UTM_Zone_18S','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','5361','SIRGAS-Chile_UTM_Zone_19S','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2977','Tahaa_UTM_5S','ESRI_OLD');
INSERT INTO alias_name VALUES('projected_crs','EPSG','2976','Tahiti_UTM_6S','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_datum','EPSG','1027','EGM2008_Geoid','ESRI');
INSERT INTO alias_name VALUES('vertical_datum','EPSG','1028','Fao_1979','ESRI');
INSERT INTO alias_name VALUES('vertical_datum','EPSG','1039','New_Zealand_Vertical_Datum_2009','ESRI');
Expand Down Expand Up @@ -18612,6 +18706,18 @@ INSERT INTO "vertical_datum" VALUES('ESRI','from_geogdatum_EPSG_1365','North_Ame
INSERT INTO "usage" VALUES('ESRI', 'from_geogdatum_EPSG_1365_USAGE','vertical_datum','ESRI','from_geogdatum_EPSG_1365','EPSG','1061','EPSG','1024');
INSERT INTO "vertical_crs" VALUES('ESRI','115931','NAD83(CSRS)v8',NULL,'ESRI','ELLPS_HEIGHT_METRE','ESRI','from_geogdatum_EPSG_1365',0);
INSERT INTO "usage" VALUES('ESRI', '115931_USAGE','vertical_crs','ESRI','115931','EPSG','1061','EPSG','1024');
INSERT INTO alias_name VALUES('vertical_datum','EPSG','1049','Incheon','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_datum','EPSG','5122','Japanese_Standard_Levelling_Datum_1949','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_datum','EPSG','5161','Lyttleton','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_datum','EPSG','5177','National_Vertical_Network_1999','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','EPSG','5193','Incheon_Height','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','EPSG','5723','Japanese_Standard_Levelling_Datum_1949','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','ESRI','115742','Korea_2000','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','EPSG','5763','Lyttleton','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','EPSG','5774','NG_L','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','EPSG','5779','NVN99','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','EPSG','5779','NVN99 height','ESRI_OLD');
INSERT INTO alias_name VALUES('vertical_crs','ESRI','115790','SIRGAS-Chile','ESRI_OLD');
INSERT INTO alias_name VALUES('compound_crs','EPSG','3901','KKJ_Finland_Uniform_Coordinate_System_and_N60_height','ESRI');
INSERT INTO alias_name VALUES('compound_crs','EPSG','3902','ETRS_1989_TM35FIN_and_N60_height','ESRI');
INSERT INTO alias_name VALUES('compound_crs','EPSG','3903','ETRS_1989_TM35FIN_and_N2000_height','ESRI');
Expand Down Expand Up @@ -19031,6 +19137,9 @@ INSERT INTO alias_name VALUES('compound_crs','EPSG','20003','MWC18_Grid_and_ODN_
INSERT INTO alias_name VALUES('compound_crs','EPSG','20037','NAD_1983_CSRS_v4_and_CGVD2013a(2002)_height','ESRI');
INSERT INTO alias_name VALUES('compound_crs','EPSG','20038','NAD_1983_CSRS_v3_and_CGVD2013a(1997)_height','ESRI');
INSERT INTO alias_name VALUES('compound_crs','EPSG','20043','SRGI2013_and_INAGeoid2020_v2_height','ESRI');
INSERT INTO alias_name VALUES('compound_crs','EPSG','9463','GDA2020_+_AHD_height','ESRI_OLD');
INSERT INTO alias_name VALUES('compound_crs','EPSG','9462','GDA2020_+_AVWS_height','ESRI_OLD');
INSERT INTO alias_name VALUES('compound_crs','EPSG','9464','GDA94_+_AHD_height','ESRI_OLD');
INSERT INTO "alias_name" VALUES('helmert_transformation','EPSG',1024,'MGI_To_ETRS_1989_4','ESRI');
INSERT INTO "alias_name" VALUES('helmert_transformation','EPSG',1055,'Ain_el_Abd_To_WGS_1984_3','ESRI');
INSERT INTO "alias_name" VALUES('helmert_transformation','EPSG',1056,'Ain_El_Abd_To_WGS_1984_4','ESRI');
Expand Down
90 changes: 84 additions & 6 deletions scripts/build_db_from_esri.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,45 @@
from typing import Optional, List, Dict

parser = argparse.ArgumentParser()
parser.add_argument('esri_csv_dir', help='Path to ESRI CSV dir, typically the path '
'to the "csv" directory of a "git clone '
'https://github.com/Esri/projection-engine-db-doc',
parser.add_argument('esri_dir', help='Path to ESRI projection-engine-db-doc dir,'
'typically the path to a "git clone '
'https://github.com/Esri/projection-engine-db-doc"',
type=Path)
parser.add_argument('proj_db', help='Path to current proj.db file', type=Path)
parser.add_argument('version', help='ArcMap version string, e.g. "ArcMap 10.8.1"')
parser.add_argument('date', help='ArcMap version date as a yyyy-MM-dd string, e.g. "2020-05-24"')
args = parser.parse_args()

path_to_csv = args.esri_csv_dir
path_to_csv = args.esri_dir / "csv"
path_to_objedit = args.esri_dir / "objedit"
proj_db = args.proj_db
version = args.version
date = args.date


########################

def import_syn(filename):

lst = []
with open(filename, "rt", encoding="UTF-8") as f:
lines = f.readlines()
for idx in range(len(lines)):
line = lines[idx][0:-1]
if line.startswith('"') and line.endswith('", \\'):
old_name = line[1:-4]
idx += 1
line = lines[idx][0:-1]
assert line.startswith(' "')
assert line.endswith('", \\')
new_name = line[4:-4]
idx += 1
line = lines[idx][0:-1]
assert line in (' TRUE, \\', ' FALSE, \\')
if line == ' TRUE, \\':
lst.append((new_name, old_name))
return lst

conn = sqlite3.connect(proj_db)
cursor = conn.cursor()

Expand Down Expand Up @@ -394,7 +419,6 @@ def import_prime_meridian():
code, esri_name, value, deprecated)
all_sql.append(sql)


########################

map_datum_esri_name_to_auth_code = {}
Expand Down Expand Up @@ -422,6 +446,7 @@ def get_old_esri_name(s):
return s

def import_datum():

with open(path_to_csv / 'pe_list_datum.csv', 'rt') as csvfile:
reader = csv.reader(csvfile)
header = next(reader)
Expand Down Expand Up @@ -753,6 +778,24 @@ def import_geogcs():
code, map_code_to_authority[replacement_code], replacement_code)
all_sql.append(sql)

aliases = import_syn(path_to_objedit / "datum_syn.txt")
for (new_name, old_name) in aliases:

(auth, code) = map_datum_esri_name_to_auth_code[new_name]

sql = """INSERT INTO alias_name VALUES('geodetic_datum','%s','%s','%s','ESRI_OLD');""" % (
auth, code, escape_literal(old_name))
all_sql.append(sql)

aliases = import_syn(path_to_objedit / "geogcs_syn.txt")
for (new_name, old_name) in aliases:

(auth, code) = map_geogcs_esri_name_to_auth_code[new_name]

sql = """INSERT INTO alias_name VALUES('geodetic_crs','%s','%s','%s','ESRI_OLD');""" % (
auth, code, escape_literal(old_name))
all_sql.append(sql)

########################


Expand Down Expand Up @@ -1560,6 +1603,15 @@ def import_projcs():
code, latestWkid)
all_sql.append(sql)

aliases = import_syn(path_to_objedit / "projcs_syn.txt")
for (new_name, old_name) in aliases:

(auth, code) = map_projcs_esri_name_to_auth_code[new_name]

sql = """INSERT INTO alias_name VALUES('projected_crs','%s','%s','%s','ESRI_OLD');""" % (
auth, code, escape_literal(old_name))
all_sql.append(sql)


########################

Expand Down Expand Up @@ -1830,7 +1882,7 @@ def import_vertcs():
sql = """INSERT INTO "usage" VALUES('ESRI', '%s_USAGE','vertical_datum','ESRI','%s','%s','%s','%s','%s');""" % (datum_code, datum_code, extent_auth_name, extent_code, 'EPSG', '1024')
all_sql.append(sql)

#map_vertcs_esri_name_to_auth_code[esri_name] = ['ESRI', code]
map_vertcs_esri_name_to_auth_code[esri_name] = ['ESRI', code]

parsed_wkt2 = parse_wkt_array(wkt2)

Expand Down Expand Up @@ -1883,6 +1935,24 @@ def import_vertcs():
code, map_code_to_authority[replacement_code], replacement_code)
all_sql.append(sql)

aliases = import_syn(path_to_objedit / "vdatum_syn.txt")
for (new_name, old_name) in aliases:

(auth, code) = map_vdatum_esri_name_to_auth_code[new_name]

sql = """INSERT INTO alias_name VALUES('vertical_datum','%s','%s','%s','ESRI_OLD');""" % (
auth, code, escape_literal(old_name))
all_sql.append(sql)

aliases = import_syn(path_to_objedit / "vertcs_syn.txt")
for (new_name, old_name) in aliases:

(auth, code) = map_vertcs_esri_name_to_auth_code[new_name]

sql = """INSERT INTO alias_name VALUES('vertical_crs','%s','%s','%s','ESRI_OLD');""" % (
auth, code, escape_literal(old_name))
all_sql.append(sql)


########################

Expand Down Expand Up @@ -1972,6 +2042,14 @@ def import_hvcoordsys():
else:
assert False, row # no ESRI specific entries at that time !

aliases = import_syn(path_to_objedit / "hvcoordsys_syn.txt")
for (new_name, old_name) in aliases:

(auth, code) = map_compoundcrs_esri_name_to_auth_code[new_name]

sql = """INSERT INTO alias_name VALUES('compound_crs','%s','%s','%s','ESRI_OLD');""" % (
auth, code, escape_literal(old_name))
all_sql.append(sql)

########################

Expand Down
Loading

0 comments on commit 2ed68be

Please sign in to comment.