Skip to content

Commit b9b84c9

Browse files
committed
Database: replicate EGM2008 grid transformation record to WGS 84 realizations
Fixes #4362
1 parent 4bacf90 commit b9b84c9

File tree

3 files changed

+64
-1
lines changed

3 files changed

+64
-1
lines changed

data/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set(ALL_SQL_IN "${CMAKE_CURRENT_BINARY_DIR}/all.sql.in")
3131
set(PROJ_DB "${CMAKE_CURRENT_BINARY_DIR}/proj.db")
3232
include(sql_filelist.cmake)
3333

34-
set(PROJ_DB_SQL_EXPECTED_MD5 "648183209a519b679cca32c4cec988e2")
34+
set(PROJ_DB_SQL_EXPECTED_MD5 "5e23b08c318cecbd9cace26233f8f5d4")
3535

3636
add_custom_command(
3737
OUTPUT ${PROJ_DB}

data/sql/customizations.sql

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,3 +581,51 @@ FROM grid_transformation gt
581581
JOIN usage u ON u.object_auth_name = gt.auth_name AND u.object_code = gt.code AND u.object_table_name = 'grid_transformation'
582582
WHERE method_auth_name = 'EPSG' AND method_name LIKE 'Geog3D to Geog2D+%'
583583
AND EXISTS (SELECT 1 FROM grid_transformation gt2 WHERE gt2.auth_name = 'PROJ' AND gt2.code = gt.auth_name || '_' || gt.code || '_RESTRICTED_TO_VERTCRS');
584+
585+
-- Add records corresponding to EGM2008 grid for WGS 84 realizations
586+
587+
INSERT INTO "grid_transformation"
588+
SELECT
589+
'PROJ' AS auth_name,
590+
replace(replace(replace(gcrs.name, ' ', '_'), '(', ''), ')', '') || '_TO_EGM2008',
591+
gcrs.name || ' to EGM2008 height (from ' || gt.name || ')' AS name,
592+
gt.description,
593+
gt.method_auth_name,
594+
gt.method_code,
595+
gt.method_name,
596+
gcrs.auth_name,
597+
gcrs.code,
598+
gt.target_crs_auth_name,
599+
gt.target_crs_code,
600+
gt.accuracy,
601+
gt.grid_param_auth_name,
602+
gt.grid_param_code,
603+
gt.grid_param_name,
604+
gt.grid_name,
605+
gt.grid2_param_auth_name,
606+
gt.grid2_param_code,
607+
gt.grid2_param_name,
608+
gt.grid2_name,
609+
gt.interpolation_crs_auth_name,
610+
gt.interpolation_crs_code,
611+
gt.operation_version,
612+
gt.deprecated
613+
FROM grid_transformation gt, geodetic_crs gcrs
614+
WHERE gt.name = 'WGS 84 to EGM2008 height (1)'
615+
AND gcrs.auth_name = 'EPSG' AND gcrs.name LIKE 'WGS 84 (G%' AND gcrs.type='geographic 3D' and gcrs.deprecated=0;
616+
617+
INSERT INTO "usage"
618+
SELECT
619+
'PROJ' AS auth_name,
620+
'USAGE_' || replace(replace(replace(gcrs.name, ' ', '_'), '(', ''), ')', '') || '_TO_EGM2008' AS code,
621+
'grid_transformation' AS object_table_name,
622+
'PROJ' AS object_auth_name,
623+
replace(replace(replace(gcrs.name, ' ', '_'), '(', ''), ')', '') || '_TO_EGM2008' AS object_code,
624+
u.extent_auth_name,
625+
u.extent_code,
626+
u.scope_auth_name,
627+
u.scope_code
628+
FROM grid_transformation gt, geodetic_crs gcrs
629+
JOIN usage u ON u.object_auth_name = gt.auth_name AND u.object_code = gt.code AND u.object_table_name = 'grid_transformation'
630+
WHERE gt.name = 'WGS 84 to EGM2008 height (1)'
631+
AND gcrs.auth_name = 'EPSG' AND gcrs.name LIKE 'WGS 84 (G%' AND gcrs.type='geographic 3D' and gcrs.deprecated=0;

test/cli/test_projinfo.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1838,3 +1838,18 @@ tests:
18381838
Test that "CGVD28 height" to "CGVD28(HTv2.0) height" is a no-op
18391839
args: -s "CGVD28 height" -t "CGVD28(HTv2.0) height" -o PROJ -q
18401840
out: +proj=noop
1841+
- comment: >
1842+
Test custom records for WGS 84 realizations to EGM2008 (https://github.com/OSGeo/PROJ/issues/4362)
1843+
args: -s "WGS 84 (G1150) + EGM2008 height" -t "WGS 84 (G1674)" --3d -o PROJ -q
1844+
out: |
1845+
+proj=pipeline
1846+
+step +proj=axisswap +order=2,1
1847+
+step +proj=unitconvert +xy_in=deg +xy_out=rad
1848+
+step +proj=vgridshift +grids=us_nga_egm08_25.tif +multiplier=1
1849+
+step +proj=cart +ellps=WGS84
1850+
+step +proj=helmert +x=-0.0024 +y=0.0016 +z=0.0232 +rx=-0.00027 +ry=0.00027
1851+
+rz=-0.00038 +s=0.00208 +dx=-0.0001 +dy=-0.0001 +dz=0.0018 +drx=0 +dry=0
1852+
+drz=0 +ds=-8e-05 +t_epoch=2005 +convention=coordinate_frame
1853+
+step +inv +proj=cart +ellps=WGS84
1854+
+step +proj=unitconvert +xy_in=rad +xy_out=deg
1855+
+step +proj=axisswap +order=2,1

0 commit comments

Comments
 (0)