aboutsummaryrefslogtreecommitdiff
path: root/scripts/build_db_create_ignf_from_xml.py
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-04-21 21:51:43 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-04-22 15:49:31 +0200
commite63f206d994658995505ce322d644fba0b807d5b (patch)
treed66d9a82904ca534d77de1204fe70a27ac1f6d4d /scripts/build_db_create_ignf_from_xml.py
parentebf77064c0ffb0082e4ddf97ae9c5c3cbe3c0411 (diff)
downloadPROJ-e63f206d994658995505ce322d644fba0b807d5b.tar.gz
PROJ-e63f206d994658995505ce322d644fba0b807d5b.zip
Database: make conversion & helmert_transformation updatable views
- Transform conversion as a view, and when inserting into it, actually insert into 3 tables: conversion_table, conversion_method and conversion_param, so that method and parameter names are not repeated each time. - Similarly for helmert_tranformation, insert into helmert_transformation_tabl and coordinate_operation_method. This reduces the db size from 6 344 704 bytes to 5 853 184 bytes, without significant slowdown for queries.
Diffstat (limited to 'scripts/build_db_create_ignf_from_xml.py')
-rwxr-xr-xscripts/build_db_create_ignf_from_xml.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/build_db_create_ignf_from_xml.py b/scripts/build_db_create_ignf_from_xml.py
index 79863eba..b797477f 100755
--- a/scripts/build_db_create_ignf_from_xml.py
+++ b/scripts/build_db_create_ignf_from_xml.py
@@ -923,7 +923,7 @@ for node in root.iterfind('.//Conversion'):
#sql = """INSERT INTO "coordinate_operation" VALUES('IGNF','%s','conversion');""" % (id)
#all_sql.append(sql)
- sql = """INSERT INTO "conversion" VALUES('IGNF','%s','%s',NULL,NULL,'EPSG','1262',NULL,NULL,'Gauss Schreiber Transverse Mercator','EPSG','8801','Latitude of natural origin',%s,'EPSG','9102','EPSG','8802','Longitude of natural origin',%s,'EPSG','9102','EPSG','8805','Scale factor at natural origin',%s,'EPSG','9201','EPSG','8806','False easting',%s,'EPSG','9001','EPSG','8807','False northing',%s,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);""" % (id, name, d['lat_0'], d['lon_0'], d['k_0'], d['x_0'], d['y_0'])
+ sql = """INSERT INTO "conversion" VALUES('IGNF','%s','%s',NULL,NULL,'EPSG','1262','PROJ','gstm','Gauss Schreiber Transverse Mercator','EPSG','8801','Latitude of natural origin',%s,'EPSG','9102','EPSG','8802','Longitude of natural origin',%s,'EPSG','9102','EPSG','8805','Scale factor at natural origin',%s,'EPSG','9201','EPSG','8806','False easting',%s,'EPSG','9001','EPSG','8807','False northing',%s,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);""" % (id, name, d['lat_0'], d['lon_0'], d['k_0'], d['x_0'], d['y_0'])
all_sql.append(sql)
mapConversionId[id] = ('IGNF', id)
@@ -963,7 +963,7 @@ for node in root.iterfind('.//Conversion'):
#sql = """INSERT INTO "coordinate_operation" VALUES('IGNF','%s','conversion');""" % (id)
#all_sql.append(sql)
- sql = """INSERT INTO "conversion" VALUES('IGNF','%s','%s',NULL,NULL,'EPSG','1262',NULL,NULL,'PROJ mill',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);""" % (id,name)
+ sql = """INSERT INTO "conversion" VALUES('IGNF','%s','%s',NULL,NULL,'EPSG','1262','PROJ','mill','PROJ mill',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);""" % (id,name)
all_sql.append(sql)
mapConversionId[id] = ('IGNF', id)