aboutsummaryrefslogtreecommitdiff
path: root/scripts/build_db.py
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2020-01-29 16:28:07 +0100
committerEven Rouault <even.rouault@spatialys.com>2020-01-29 16:28:07 +0100
commit6f6c53c8553541690a16775ab2c92f7703196e59 (patch)
tree329e634213191dc3d834f8254133a4222eeb61aa /scripts/build_db.py
parent9f6ab28f1d26561a547802a18b3a2f7877834ca8 (diff)
downloadPROJ-6f6c53c8553541690a16775ab2c92f7703196e59.tar.gz
PROJ-6f6c53c8553541690a16775ab2c92f7703196e59.zip
Add EPSG records for 'Geocentric translation by Grid Interpolation (IGN)' (gr3df97a.txt) and map them to new +proj=xyzgridshift
Diffstat (limited to 'scripts/build_db.py')
-rwxr-xr-xscripts/build_db.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/build_db.py b/scripts/build_db.py
index c2203ecf..6eed3867 100755
--- a/scripts/build_db.py
+++ b/scripts/build_db.py
@@ -348,10 +348,10 @@ def fill_helmert_transformation(proj_db_cursor):
'?,?,?, ?,?, ?,?,?, ?,?, ?,?, ?,?, ?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?, ?,?,?,?,?, ?,?,?,?,?, ?,?,?, ?,?,?, ?,?,?,?,?, ?,?)', arg)
def fill_grid_transformation(proj_db_cursor):
- proj_db_cursor.execute("SELECT coord_op_code, coord_op_name, coord_op_method_code, coord_op_method_name, source_crs_code, target_crs_code, area_of_use_code, coord_op_accuracy, coord_tfm_version, epsg_coordoperation.deprecated, coord_op_scope, epsg_coordoperation.remarks FROM epsg.epsg_coordoperation LEFT JOIN epsg.epsg_coordoperationmethod USING (coord_op_method_code) WHERE coord_op_type = 'transformation' AND (coord_op_method_name LIKE 'Geographic3D to%' OR coord_op_method_name LIKE 'Geog3D to%' OR coord_op_method_name LIKE 'Point motion by grid%' OR coord_op_method_name LIKE 'Vertical Offset by Grid Interpolation%' OR coord_op_method_name IN ('NADCON', 'NADCON5 (2D)', 'NTv1', 'NTv2', 'VERTCON'))")
+ proj_db_cursor.execute("SELECT coord_op_code, coord_op_name, coord_op_method_code, coord_op_method_name, source_crs_code, target_crs_code, area_of_use_code, coord_op_accuracy, coord_tfm_version, epsg_coordoperation.deprecated, coord_op_scope, epsg_coordoperation.remarks FROM epsg.epsg_coordoperation LEFT JOIN epsg.epsg_coordoperationmethod USING (coord_op_method_code) WHERE coord_op_type = 'transformation' AND (coord_op_method_name LIKE 'Geographic3D to%' OR coord_op_method_name LIKE 'Geog3D to%' OR coord_op_method_name LIKE 'Point motion by grid%' OR coord_op_method_name LIKE 'Vertical Offset by Grid Interpolation%' OR coord_op_method_name IN ('NADCON', 'NADCON5 (2D)', 'NTv1', 'NTv2', 'VERTCON', 'Geocentric translation by Grid Interpolation (IGN)'))")
for (code, name, method_code, method_name, source_crs_code, target_crs_code, area_of_use_code, coord_op_accuracy, coord_tfm_version, deprecated, scope, remarks) in proj_db_cursor.fetchall():
expected_order = 1
- max_n_params = 2
+ max_n_params = 3 if method_name == 'Geocentric translation by Grid Interpolation (IGN)' else 2
param_auth_name = [None for i in range(max_n_params)]
param_code = [None for i in range(max_n_params)]
param_name = [None for i in range(max_n_params)]
@@ -374,7 +374,7 @@ def fill_grid_transformation(proj_db_cursor):
expected_order += 1
n_params = expected_order - 1
- assert param_code[0] in (1050, 8656, 8657, 8666, 8732), (code, param_code[0])
+ assert param_code[0] in (1050, 8656, 8657, 8666, 8732, 8727), (code, param_code[0])
grid2_param_auth_name = None
grid2_param_code = None
@@ -403,6 +403,10 @@ def fill_grid_transformation(proj_db_cursor):
assert param_code[1] == 1048, (code, method_code, param_code[1])
interpolation_crs_auth_name = EPSG_AUTHORITY
interpolation_crs_code = str(int(param_value[1])) # needed to avoid codes like XXXX.0
+ elif method_name == 'Geocentric translation by Grid Interpolation (IGN)':
+ assert param_code[1] == 1048, (code, method_code, param_code[1])
+ interpolation_crs_auth_name = EPSG_AUTHORITY
+ interpolation_crs_code = str(int(param_value[1])) # needed to avoid codes like XXXX.0
else:
assert n_params == 1, (code, method_code)