aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-10-11 19:50:09 +0200
committerEven Rouault <even.rouault@spatialys.com>2020-10-11 19:50:09 +0200
commitad80dc88a70032e1d96812b574b2d4d22e223394 (patch)
treebe61efbce545fc2940861e218e2e1f448f1bb66f /scripts
parentacd1cf3278a532b56f3f621e27a8895b3db3cb75 (diff)
downloadPROJ-ad80dc88a70032e1d96812b574b2d4d22e223394.tar.gz
PROJ-ad80dc88a70032e1d96812b574b2d4d22e223394.zip
Database: add a frame_reference_epoch column in vertical_datum to be able to handle dynamic vertical datums, and instanciate them properly from database
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build_db.py6
-rwxr-xr-xscripts/build_db_create_ignf_from_xml.py2
-rwxr-xr-xscripts/build_db_from_esri.py2
3 files changed, 5 insertions, 5 deletions
diff --git a/scripts/build_db.py b/scripts/build_db.py
index 113ee3fd..7346d210 100755
--- a/scripts/build_db.py
+++ b/scripts/build_db.py
@@ -177,7 +177,7 @@ def fill_vertical_datum(proj_db_cursor):
for (datum_code, datum_name, publication_date, frame_reference_epoch, deprecated) in res:
publication_date = compute_publication_date(datum_code, datum_name, frame_reference_epoch, publication_date)
proj_db_cursor.execute(
- "INSERT INTO vertical_datum VALUES (?, ?, ?, NULL, ?, NULL, ?)", (EPSG_AUTHORITY, datum_code, datum_name,publication_date, deprecated))
+ "INSERT INTO vertical_datum VALUES (?, ?, ?, NULL, ?, ?, NULL, ?)", (EPSG_AUTHORITY, datum_code, datum_name, publication_date, frame_reference_epoch, deprecated))
def fill_datumensemble(proj_db_cursor):
@@ -192,7 +192,7 @@ def fill_datumensemble(proj_db_cursor):
datum_type = subrows[0][0]
if datum_type == 'vertical':
datum_ensemble_member_table = 'vertical_datum_ensemble_member'
- proj_db_cursor.execute("INSERT INTO vertical_datum (auth_name, code, name, description, publication_date, ensemble_accuracy, deprecated) VALUES (?, ?, ?, ?, ?, ?, ?)", (EPSG_AUTHORITY, datum_code, datum_name, None, None, ensemble_accuracy, deprecated))
+ proj_db_cursor.execute("INSERT INTO vertical_datum (auth_name, code, name, description, publication_date, frame_reference_epoch, ensemble_accuracy, deprecated) VALUES (?, ?, ?, ?, ?, ?, ?, ?)", (EPSG_AUTHORITY, datum_code, datum_name, None, None, None, ensemble_accuracy, deprecated))
else:
datum_ensemble_member_table = 'geodetic_datum_ensemble_member'
assert datum_type in ('dynamic geodetic', 'geodetic'), datum_code
@@ -201,7 +201,7 @@ def fill_datumensemble(proj_db_cursor):
assert ellipsoid_code, datum_code
assert prime_meridian_code, datum_code
proj_db_cursor.execute(
- "INSERT INTO geodetic_datum (auth_name, code, name, description, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, publication_date , ensemble_accuracy, deprecated) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", (EPSG_AUTHORITY, datum_code, datum_name, None, EPSG_AUTHORITY, ellipsoid_code, EPSG_AUTHORITY, prime_meridian_code, None, ensemble_accuracy, deprecated))
+ "INSERT INTO geodetic_datum (auth_name, code, name, description, ellipsoid_auth_name, ellipsoid_code, prime_meridian_auth_name, prime_meridian_code, publication_date, frame_reference_epoch, ensemble_accuracy, deprecated) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", (EPSG_AUTHORITY, datum_code, datum_name, None, EPSG_AUTHORITY, ellipsoid_code, EPSG_AUTHORITY, prime_meridian_code, None, None, ensemble_accuracy, deprecated))
proj_db_cursor.execute("SELECT datum_code, datum_sequence FROM epsg.epsg_datumensemblemember WHERE datum_ensemble_code = ? ORDER by datum_sequence", (datum_code,))
for member_code, sequence in proj_db_cursor.fetchall():
diff --git a/scripts/build_db_create_ignf_from_xml.py b/scripts/build_db_create_ignf_from_xml.py
index dcc9cd4c..d908c8e5 100755
--- a/scripts/build_db_create_ignf_from_xml.py
+++ b/scripts/build_db_create_ignf_from_xml.py
@@ -154,7 +154,7 @@ def ingest_datums(root, all_sql, mapEllpsId, mapPmId):
id = node.attrib['id']
names = [_name.text for _name in node.iter('name')]
- sql = """INSERT INTO "vertical_datum" VALUES('IGNF','%s','%s',NULL,NULL,NULL,0);"""% (id, names[0])
+ sql = """INSERT INTO "vertical_datum" VALUES('IGNF','%s','%s',NULL,NULL,NULL,NULL,0);"""% (id, names[0])
all_sql.append(sql)
mapVerticalDatumId[id] = ('IGNF', id)
diff --git a/scripts/build_db_from_esri.py b/scripts/build_db_from_esri.py
index dbef495e..2c1c5883 100755
--- a/scripts/build_db_from_esri.py
+++ b/scripts/build_db_from_esri.py
@@ -1259,7 +1259,7 @@ def import_vertcs():
datum_written.add(datum_code)
p = map_vdatum_esri_to_parameters[datum_code]
- sql = """INSERT INTO "vertical_datum" VALUES('ESRI','%s','%s',NULL,NULL,NULL,%d);""" % (
+ sql = """INSERT INTO "vertical_datum" VALUES('ESRI','%s','%s',NULL,NULL,NULL,NULL,%d);""" % (
datum_code, p['esri_name'], p['deprecated'])
all_sql.append(sql)
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')