@@ -581,3 +581,51 @@ FROM grid_transformation gt
581581JOIN usage u ON u .object_auth_name = gt .auth_name AND u .object_code = gt .code AND u .object_table_name = ' grid_transformation'
582582WHERE method_auth_name = ' EPSG' AND method_name LIKE ' Geog3D to Geog2D+%'
583583AND 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 ;
0 commit comments