From b8f8a708c2299ba55b3d4754aa75633e3ee5897b Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Wed, 25 Dec 2019 16:23:31 +0100
Subject: Database: tune accuracy of Canadian NTv1 file w.r.t NTv2

As on import of EPSG, we remove the supersession of Canadian NTv1 file w.r.t NTv2
(because the default behaviour of PROJ is to ignore superseded operations). However
the NTv1 operation is advertized with an accuracy of 1m, whereas NTv2 is advertized
with 1.5m. Consequently on areas where both files are valid, and if both files are
available, NTv1 would be selected. So as a workaround, worsen the NTv1 accuracy to
2m so that NTv2 is used in priority.
---
 data/sql/customizations.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)

(limited to 'data/sql/customizations.sql')

diff --git a/data/sql/customizations.sql b/data/sql/customizations.sql
index 8003c921..86d49b09 100644
--- a/data/sql/customizations.sql
+++ b/data/sql/customizations.sql
@@ -26,6 +26,17 @@ UPDATE grid_transformation SET interpolation_crs_auth_name = 'EPSG',
                                interpolation_crs_code = '4289'
                            WHERE auth_name = 'EPSG' AND code = '7001';
 
+-- EPSG:1312 'NAD27 to NAD83 (3)' / NTv1_0.gsb has a accuracy of 1m whereas
+-- EPSG:1313 'NAD27 to NAD83 (4)' / NTv2_0.gsb has a accuracy of 1.5m
+-- so we will never select automatically NTv2_0.gsb. Worse the advertize
+-- accuracy of the NTv1 method
+
+UPDATE grid_transformation SET accuracy = 2.0 WHERE auth_name = 'EPSG' AND code = '1312';
+
+-- Same for EPSG:1462 vs EPSG:1573
+
+UPDATE grid_transformation SET accuracy = 2.0 WHERE auth_name = 'EPSG' AND code = '1462';
+
 -- Define the allowed authorities, and their precedence, when researching a
 -- coordinate operation
 
-- 
cgit v1.2.3


From 206a45de20b4936efa0e216fce6addd768881508 Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Tue, 7 Jan 2020 12:27:19 +0100
Subject: Database: insert PROJ.4 +datum values in alias_name table under PROJ
 authority

---
 data/sql/customizations.sql | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'data/sql/customizations.sql')

diff --git a/data/sql/customizations.sql b/data/sql/customizations.sql
index 86d49b09..503a1fe0 100644
--- a/data/sql/customizations.sql
+++ b/data/sql/customizations.sql
@@ -101,3 +101,16 @@ INSERT INTO "geoid_model" SELECT 'GEOID12A', auth_name, code FROM grid_transform
 INSERT INTO "geoid_model" SELECT 'GEOID12B', auth_name, code FROM grid_transformation WHERE auth_name = 'EPSG' AND grid_name LIKE 'g2012b%' AND deprecated = 0;
 
 INSERT INTO "geoid_model" SELECT 'GEOID18', auth_name, code FROM grid_transformation WHERE auth_name = 'EPSG' AND grid_name LIKE 'g2018%' AND deprecated = 0;
+
+---- PROJ historic +datum aliases -----
+
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6326','WGS84','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6121','GGRS87','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6269','NAD83','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6267','NAD27','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6314','potsdam','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6223','carthage','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6312','hermannskogel','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6299','ire65','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6272','nzgd49','PROJ');
+INSERT INTO "alias_name" VALUES('geodetic_datum','EPSG','6277','OSGB36','PROJ');
-- 
cgit v1.2.3

