Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Database: update to EPSG v10.013 #2518

Merged
merged 1 commit into from
Feb 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions data/sql/alias_name.sql
Original file line number Diff line number Diff line change
Expand Up @@ -612,10 +612,14 @@ INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','1295','LTF2004','EPSG')
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','5215','EVRF2007','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1274','EVRF2019','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1287','EVRF2019mean','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1298','EH2000','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1299','LAS07','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1300','BGS2005','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1302','Pago Pago 2020','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1303','NVD 1992','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1301','CD Norway','EPSG');
INSERT INTO "alias_name" VALUES('vertical_datum','EPSG','1199','Greenland Vertical Reference 2000','EPSG');
INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','1304','REDGEOMIN','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','21100','Genuk / NEIEZ','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','2140','NAD83(CSRS98) / SCoPQ zone 3','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','2141','NAD83(CSRS98) / SCoPQ zone 4','EPSG');
Expand Down Expand Up @@ -7191,6 +7195,8 @@ INSERT INTO "alias_name" VALUES('vertical_crs','EPSG','5711','AHD71 height','EPS
INSERT INTO "alias_name" VALUES('vertical_crs','EPSG','5711','AHD-TAS83 height','EPSG');
INSERT INTO "alias_name" VALUES('vertical_crs','EPSG','5711','339','EPSG');
INSERT INTO "alias_name" VALUES('vertical_crs','EPSG','5711','AHD - NOHt','EPSG');
INSERT INTO "alias_name" VALUES('compound_crs','EPSG','9502','CIGD11 + CBVD61 height','EPSG');
INSERT INTO "alias_name" VALUES('compound_crs','EPSG','9504','CIGD11 + LCVD61 height','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','29873','Timbalai / Borneo (m)','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','29873','BT68 / RSO Borneo (m)','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','29873','Timbalai 1968 / RSO Borneo (m)','EPSG');
Expand All @@ -7208,6 +7214,7 @@ INSERT INTO "alias_name" VALUES('projected_crs','EPSG','6875','RDN2008 / Fuso It
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','6875','ETRF2000 epoca 2008.0 fuso Italia','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','6876','RDN2008 / Fuso 12 (N-E)','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','6876','ETRF2000 epoca 2008.0 fuso 12','EPSG');
INSERT INTO "alias_name" VALUES('compound_crs','EPSG','9503','CIGD11 + GCVD54 height','EPSG');
INSERT INTO "alias_name" VALUES('projected_crs','EPSG','9498','CABA-P07','EPSG');
INSERT INTO "alias_name" VALUES('vertical_crs','EPSG','9389','EVRF2019_AMST / NH','EPSG');
INSERT INTO "alias_name" VALUES('vertical_crs','EPSG','9390','EVRF2019mean_AMST / NH','EPSG');
Expand All @@ -7221,3 +7228,10 @@ INSERT INTO "alias_name" VALUES('projected_crs','EPSG','9680','WGS 84 / BUTM 201
INSERT INTO "alias_name" VALUES('compound_crs','EPSG','6893','WGS 84 / World Mercator + EGM2008 height','EPSG');
INSERT INTO "alias_name" VALUES('compound_crs','EPSG','7955','St. Helena Tritan / UTM zone 30S + Tritan 2011 height','EPSG');
INSERT INTO "alias_name" VALUES('compound_crs','EPSG','7956','SHMG2015 + SHVD2015 height','EPSG');
INSERT INTO "alias_name" VALUES('geodetic_crs','EPSG','8401','748','EPSG');
INSERT INTO "alias_name" VALUES('geodetic_crs','EPSG','8401','ETRF2014 - XYZ','EPSG');
INSERT INTO "alias_name" VALUES('geodetic_crs','EPSG','8403','747','EPSG');
INSERT INTO "alias_name" VALUES('geodetic_crs','EPSG','8403','ETRF2014 - LatLonEHt','EPSG');
INSERT INTO "alias_name" VALUES('geodetic_crs','EPSG','9069','746','EPSG');
INSERT INTO "alias_name" VALUES('geodetic_crs','EPSG','9069','ETRF2014- LatLon','EPSG');
INSERT INTO "alias_name" VALUES('vertical_crs','EPSG','9672','CD Norway','EPSG');
4 changes: 2 additions & 2 deletions data/sql/axis.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
--- This file has been generated by scripts/build_db.py. DO NOT EDIT !

INSERT INTO "axis" VALUES('EPSG','1039','Easting','M','east','EPSG','1024',1,'EPSG','9001');
INSERT INTO "axis" VALUES('EPSG','1040','Northing','P','north','EPSG','1024',2,'EPSG','9001');
INSERT INTO "axis" VALUES('EPSG','32773','Easting','M','east','EPSG','1024',1,'EPSG','9001');
INSERT INTO "axis" VALUES('EPSG','32774','Northing','P','north','EPSG','1024',2,'EPSG','9001');
INSERT INTO "axis" VALUES('EPSG','1062','Easting','X','North along 130°W','EPSG','1025',1,'EPSG','9001');
INSERT INTO "axis" VALUES('EPSG','1063','Northing','Y','North along 140°E','EPSG','1025',2,'EPSG','9001');
INSERT INTO "axis" VALUES('EPSG','1065','Easting','E','South along 90°E','EPSG','1026',1,'EPSG','9001');
Expand Down
13 changes: 11 additions & 2 deletions data/sql/commit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -75,14 +75,14 @@ FOR EACH ROW BEGIN
AND g1.source_crs_code = g2.source_crs_code
AND g1.target_crs_auth_name = g2.target_crs_auth_name
AND g1.target_crs_code = g2.target_crs_code
WHERE g1.auth_name = 'PROJ' AND g2.auth_name = 'EPSG')
WHERE g1.auth_name = 'PROJ' AND g1.code NOT LIKE '%_RESTRICTED_TO_VERTCRS%' AND g2.auth_name = 'EPSG')
OR EXISTS (SELECT 1 FROM grid_transformation g1
JOIN grid_transformation g2
ON g1.source_crs_auth_name = g2.target_crs_auth_name
AND g1.source_crs_code = g2.target_crs_code
AND g1.target_crs_auth_name = g1.source_crs_auth_name
AND g1.target_crs_code = g1.source_crs_code
WHERE g1.auth_name = 'PROJ' AND g2.auth_name = 'EPSG');
WHERE g1.auth_name = 'PROJ' AND g1.code NOT LIKE '%_RESTRICTED_TO_VERTCRS%' AND g2.auth_name = 'EPSG');

SELECT RAISE(ABORT, 'Arg! there is now a EPSG:102100 object. Hack in createFromUserInput() will no longer work')
WHERE EXISTS(SELECT 1 FROM crs_view WHERE auth_name = 'EPSG' AND code = '102100');
Expand Down Expand Up @@ -184,6 +184,15 @@ FOR EACH ROW BEGIN
SELECT RAISE(ABORT, 'missing au_ga_AUSGeoid98.tif')
WHERE NOT EXISTS(SELECT 1 FROM grid_alternatives WHERE proj_grid_name = 'au_ga_AUSGeoid98.tif');

-- clause because of buggy entries in EPSG 10.013
SELECT RAISE(ABORT, 'invalid Geog3D to Geog2D + GravityRelatedHeight (foo) entries: target CRS is not a compound CRS')
WHERE EXISTS (SELECT 1 FROM grid_transformation gt WHERE
method_auth_name = 'EPSG' AND method_code IN ('1088', '1089', '1090', '1091', '1092', '1093', '1094', '1095', '1096', '1097', '1098', '1103') AND
gt.deprecated = 0 AND
NOT EXISTS (SELECT 1 FROM compound_crs c WHERE gt.target_crs_code = c.code AND gt.target_crs_auth_name = c.auth_name) AND
NOT (gt.auth_name = 'EPSG' AND gt.code IN ('9610', '9613', '9619', '9633'))
);

END;
INSERT INTO dummy DEFAULT VALUES;
DROP TRIGGER final_checks;
Expand Down
94 changes: 94 additions & 0 deletions data/sql/compound_crs.sql
Original file line number Diff line number Diff line change
Expand Up @@ -600,3 +600,97 @@ INSERT INTO "compound_crs" VALUES('EPSG','9463','GDA2020 + AHD height',NULL,'EPS
INSERT INTO "usage" VALUES('EPSG','14143','compound_crs','EPSG','9463','EPSG','4493','EPSG','1263');
INSERT INTO "compound_crs" VALUES('EPSG','9464','GDA94 + AHD height',NULL,'EPSG','4283','EPSG','5711',0);
INSERT INTO "usage" VALUES('EPSG','14144','compound_crs','EPSG','9464','EPSG','4493','EPSG','1263');
INSERT INTO "compound_crs" VALUES('EPSG','9500','ETRS89 + EVRF2000 Austria height',NULL,'EPSG','4258','EPSG','9274',0);
INSERT INTO "usage" VALUES('EPSG','14431','compound_crs','EPSG','9500','EPSG','1037','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9501','MGI + EVRF2000 Austria height',NULL,'EPSG','4312','EPSG','9274',0);
INSERT INTO "usage" VALUES('EPSG','14432','compound_crs','EPSG','9501','EPSG','1037','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9502','CIGD11 + CBVD61 height (ft)',NULL,'EPSG','6135','EPSG','6132',0);
INSERT INTO "usage" VALUES('EPSG','14265','compound_crs','EPSG','9502','EPSG','3207','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9503','CIGD11 + GCVD54 height (ft)',NULL,'EPSG','6135','EPSG','6130',0);
INSERT INTO "usage" VALUES('EPSG','14435','compound_crs','EPSG','9503','EPSG','3185','EPSG','1270');
INSERT INTO "compound_crs" VALUES('EPSG','9504','CIGD11 + LCVD61 height (ft)',NULL,'EPSG','6135','EPSG','6131',0);
INSERT INTO "usage" VALUES('EPSG','14267','compound_crs','EPSG','9504','EPSG','4121','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9505','ETRS89 + Alicante height',NULL,'EPSG','4258','EPSG','5782',0);
INSERT INTO "usage" VALUES('EPSG','14270','compound_crs','EPSG','9505','EPSG','4188','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9506','ETRS89 + Ceuta 2 height',NULL,'EPSG','4258','EPSG','9402',0);
INSERT INTO "usage" VALUES('EPSG','14273','compound_crs','EPSG','9506','EPSG','4590','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9507','ETRS89 + Ibiza height',NULL,'EPSG','4258','EPSG','9394',0);
INSERT INTO "usage" VALUES('EPSG','14276','compound_crs','EPSG','9507','EPSG','4604','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9508','ETRS89 + Mallorca height',NULL,'EPSG','4258','EPSG','9392',0);
INSERT INTO "usage" VALUES('EPSG','14440','compound_crs','EPSG','9508','EPSG','4602','EPSG','1270');
INSERT INTO "compound_crs" VALUES('EPSG','9509','ETRS89 + Menorca height',NULL,'EPSG','4258','EPSG','9393',0);
INSERT INTO "usage" VALUES('EPSG','14283','compound_crs','EPSG','9509','EPSG','4603','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9510','REGCAN95 + El Hierro height',NULL,'EPSG','4081','EPSG','9401',0);
INSERT INTO "usage" VALUES('EPSG','14286','compound_crs','EPSG','9510','EPSG','4597','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9511','REGCAN95 + Fuerteventura height',NULL,'EPSG','4081','EPSG','9396',0);
INSERT INTO "usage" VALUES('EPSG','14929','compound_crs','EPSG','9511','EPSG','4592','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9512','REGCAN95 + Gran Canaria height',NULL,'EPSG','4081','EPSG','9397',0);
INSERT INTO "usage" VALUES('EPSG','14930','compound_crs','EPSG','9512','EPSG','4593','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9513','REGCAN95 + La Gomera height',NULL,'EPSG','4081','EPSG','9399',0);
INSERT INTO "usage" VALUES('EPSG','14931','compound_crs','EPSG','9513','EPSG','4595','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9514','REGCAN95 + La Palma height',NULL,'EPSG','4081','EPSG','9400',0);
INSERT INTO "usage" VALUES('EPSG','14302','compound_crs','EPSG','9514','EPSG','4596','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9515','REGCAN95 + Lanzarote height',NULL,'EPSG','4081','EPSG','9395',0);
INSERT INTO "usage" VALUES('EPSG','14305','compound_crs','EPSG','9515','EPSG','4591','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9516','REGCAN95 + Tenerife height',NULL,'EPSG','4081','EPSG','9398',0);
INSERT INTO "usage" VALUES('EPSG','14308','compound_crs','EPSG','9516','EPSG','4594','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9517','SHGD2015 + SHVD2015 height',NULL,'EPSG','7886','EPSG','7890',0);
INSERT INTO "usage" VALUES('EPSG','14319','compound_crs','EPSG','9517','EPSG','3183','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9518','WGS 84 + EGM2008 height',NULL,'EPSG','4326','EPSG','3855',0);
INSERT INTO "usage" VALUES('EPSG','14320','compound_crs','EPSG','9518','EPSG','1262','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9519','FEH2010 + FCSVR10 height',NULL,'EPSG','5593','EPSG','5597',0);
INSERT INTO "usage" VALUES('EPSG','14325','compound_crs','EPSG','9519','EPSG','3890','EPSG','1139');
INSERT INTO "compound_crs" VALUES('EPSG','9520','KSA-GRF17 + KSA-VRF14 height',NULL,'EPSG','9333','EPSG','9335',0);
INSERT INTO "usage" VALUES('EPSG','14336','compound_crs','EPSG','9520','EPSG','3303','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9521','POSGAR 2007 + SRVN16 height',NULL,'EPSG','5340','EPSG','9255',0);
INSERT INTO "usage" VALUES('EPSG','14340','compound_crs','EPSG','9521','EPSG','4573','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9522','NAD83(2011) + PRVD02 height',NULL,'EPSG','6318','EPSG','6641',0);
INSERT INTO "usage" VALUES('EPSG','14357','compound_crs','EPSG','9522','EPSG','3294','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9523','NAD83(2011) + VIVD09 height',NULL,'EPSG','6318','EPSG','6642',0);
INSERT INTO "usage" VALUES('EPSG','14356','compound_crs','EPSG','9523','EPSG','3330','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9524','NAD83(MA11) + GUVD04 height',NULL,'EPSG','6325','EPSG','6644',0);
INSERT INTO "usage" VALUES('EPSG','14364','compound_crs','EPSG','9524','EPSG','3255','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9525','NAD83(MA11) + NMVD03 height',NULL,'EPSG','6325','EPSG','6640',0);
INSERT INTO "usage" VALUES('EPSG','14367','compound_crs','EPSG','9525','EPSG','4521','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9526','NAD83(PA11) + ASVD02 height',NULL,'EPSG','6322','EPSG','6643',0);
INSERT INTO "usage" VALUES('EPSG','14462','compound_crs','EPSG','9526','EPSG','2288','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9527','NZGD2000 + NZVD2009 height',NULL,'EPSG','4167','EPSG','4440',0);
INSERT INTO "usage" VALUES('EPSG','14377','compound_crs','EPSG','9527','EPSG','1175','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9528','NZGD2000 + NZVD2016 height',NULL,'EPSG','4167','EPSG','7839',0);
INSERT INTO "usage" VALUES('EPSG','14380','compound_crs','EPSG','9528','EPSG','1175','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9529','SRGI2013 + INAGeoid2020 height',NULL,'EPSG','9470','EPSG','9471',0);
INSERT INTO "usage" VALUES('EPSG','14383','compound_crs','EPSG','9529','EPSG','1122','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9530','RGFG95 + NGG1977 height',NULL,'EPSG','4624','EPSG','5755',0);
INSERT INTO "usage" VALUES('EPSG','14420','compound_crs','EPSG','9530','EPSG','3146','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9531','RGAF09 + Guadeloupe 1988 height',NULL,'EPSG','5489','EPSG','5757',0);
INSERT INTO "usage" VALUES('EPSG','14936','compound_crs','EPSG','9531','EPSG','2892','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9532','RGAF09 + IGN 1988 LS height',NULL,'EPSG','5489','EPSG','5616',0);
INSERT INTO "usage" VALUES('EPSG','14471','compound_crs','EPSG','9532','EPSG','2895','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9533','RGAF09 + IGN 1988 MG height',NULL,'EPSG','5489','EPSG','5617',0);
INSERT INTO "usage" VALUES('EPSG','14473','compound_crs','EPSG','9533','EPSG','2894','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9534','RGAF09 + IGN 1988 SB height',NULL,'EPSG','5489','EPSG','5619',0);
INSERT INTO "usage" VALUES('EPSG','14478','compound_crs','EPSG','9534','EPSG','2891','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9535','RGAF09 + IGN 1988 SM height',NULL,'EPSG','5489','EPSG','5620',0);
INSERT INTO "usage" VALUES('EPSG','14481','compound_crs','EPSG','9535','EPSG','2890','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9536','RGAF09 + IGN 2008 LD height',NULL,'EPSG','5489','EPSG','9130',0);
INSERT INTO "usage" VALUES('EPSG','14484','compound_crs','EPSG','9536','EPSG','2893','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9537','RGAF09 + Martinique 1987 height',NULL,'EPSG','5489','EPSG','5756',0);
INSERT INTO "usage" VALUES('EPSG','14486','compound_crs','EPSG','9537','EPSG','3276','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9538','RGF93 + NGF-IGN69 height',NULL,'EPSG','4171','EPSG','5720',0);
INSERT INTO "usage" VALUES('EPSG','14489','compound_crs','EPSG','9538','EPSG','1326','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9539','RGF93 + NGF-IGN78 height',NULL,'EPSG','4171','EPSG','5721',0);
INSERT INTO "usage" VALUES('EPSG','14490','compound_crs','EPSG','9539','EPSG','1327','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9540','RGNC91-93 + NGNC08 height',NULL,'EPSG','4749','EPSG','9351',0);
INSERT INTO "usage" VALUES('EPSG','14495','compound_crs','EPSG','9540','EPSG','3430','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9541','RGSPM06 + Danger 1950 height',NULL,'EPSG','4463','EPSG','5792',0);
INSERT INTO "usage" VALUES('EPSG','14498','compound_crs','EPSG','9541','EPSG','3299','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9542','RRAF 1991 + IGN 2008 LD height',NULL,'EPSG','4558','EPSG','9130',0);
INSERT INTO "usage" VALUES('EPSG','14501','compound_crs','EPSG','9542','EPSG','2893','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9543','ITRF2005 + SA LLD height',NULL,'EPSG','8998','EPSG','9279',0);
INSERT INTO "usage" VALUES('EPSG','14522','compound_crs','EPSG','9543','EPSG','3309','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9544','NAD83(CSRS)v6 + CGVD2013(CGG2013a) height',NULL,'EPSG','8252','EPSG','9245',0);
INSERT INTO "usage" VALUES('EPSG','14525','compound_crs','EPSG','9544','EPSG','1061','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9705','WGS 84 + MSL height',NULL,'EPSG','4326','EPSG','5714',0);
INSERT INTO "usage" VALUES('EPSG','15089','compound_crs','EPSG','9705','EPSG','1262','EPSG','1026');
INSERT INTO "compound_crs" VALUES('EPSG','9707','WGS 84 + EGM96 height',NULL,'EPSG','4326','EPSG','5773',0);
INSERT INTO "usage" VALUES('EPSG','15091','compound_crs','EPSG','9707','EPSG','1262','EPSG','1026');
7 changes: 5 additions & 2 deletions data/sql/customizations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ INSERT INTO "unit_of_measure" VALUES('PROJ','US_YD','US survey yard','length',0.
INSERT INTO "unit_of_measure" VALUES('PROJ','IND_CH','Indian chain','length',20.11669506,'ind-ch',0);

-- Deal with grid_transformation using EPSG:1088 'Geog3D to Geog2D+GravityRelatedHeight (gtx)' method
-- and similar ones
-- We derive records using the more classic 'Geographic3D to GravityRelatedHeight' method
-- We could probably do that at runtime too, but more simple and efficient to create records

Expand Down Expand Up @@ -340,7 +341,7 @@ FROM grid_transformation gt
JOIN compound_crs c ON gt.target_crs_code = c.code AND gt.target_crs_auth_name = c.auth_name
JOIN geodetic_crs gcrs ON gt.source_crs_auth_name = gcrs.auth_name AND gt.source_crs_code = gcrs.code
JOIN vertical_crs vcrs on vcrs.auth_name = c.vertical_crs_auth_name AND vcrs.code = c.vertical_crs_code
WHERE method_auth_name = 'EPSG' AND method_code = '1088' AND gt.deprecated = 0;
WHERE method_auth_name = 'EPSG' AND method_code IN ('1088', '1089', '1090', '1091', '1092', '1093', '1094', '1095', '1096', '1097', '1098', '1103') AND gt.deprecated = 0;

INSERT INTO "usage"
SELECT
Expand All @@ -355,4 +356,6 @@ SELECT
u.scope_code
FROM grid_transformation gt
JOIN usage u ON u.object_auth_name = gt.auth_name AND u.object_code = gt.code AND u.object_table_name = 'grid_transformation'
WHERE method_auth_name = 'EPSG' AND method_code = '1088' AND gt.deprecated = 0;
WHERE method_auth_name = 'EPSG' AND method_code IN ('1088', '1089', '1090', '1091', '1092', '1093', '1094', '1095', '1096', '1097', '1098', '1103') AND gt.deprecated = 0
AND EXISTS (SELECT 1 FROM compound_crs c WHERE target_crs_code = c.code AND target_crs_auth_name = c.auth_name) -- clause because of buggy entries in EPSG 10.013
;
Loading