aboutsummaryrefslogtreecommitdiff
path: root/data/sql
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2018-12-06 16:23:07 +0100
committerEven Rouault <even.rouault@spatialys.com>2018-12-06 16:31:25 +0100
commita9ef3a229c6fef5ef8a05ba521a0237f2ffa6aa6 (patch)
tree8b2cee3e3a7466ff914d705c3fb05cb126c83138 /data/sql
parent25fa18055f43d0881a1a2bf9990c99fecfcbdbb7 (diff)
downloadPROJ-a9ef3a229c6fef5ef8a05ba521a0237f2ffa6aa6.tar.gz
PROJ-a9ef3a229c6fef5ef8a05ba521a0237f2ffa6aa6.zip
Coordinate operation search: add a authority_to_authority_preference table to restrict and prioritize searches
Diffstat (limited to 'data/sql')
-rw-r--r--data/sql/customizations.sql18
-rw-r--r--data/sql/proj_db_table_defs.sql9
2 files changed, 27 insertions, 0 deletions
diff --git a/data/sql/customizations.sql b/data/sql/customizations.sql
index 2181cc2b..8e31c233 100644
--- a/data/sql/customizations.sql
+++ b/data/sql/customizations.sql
@@ -6,3 +6,21 @@ INSERT INTO "other_transformation" VALUES('PROJ','CRS84_TO_EPSG_4326','OGC:CRS84
-- alias of EPSG:3857
INSERT INTO "projected_crs" VALUES('EPSG','900913','Google Maps Global Mercator',NULL,NULL,'EPSG','4499','EPSG','4326','EPSG','3856','EPSG','3544',NULL,1);
+
+-- Define the allowed authorities, and their precedence, when researching a
+-- coordinate operation
+
+INSERT INTO authority_to_authority_preference(source_auth_name, target_auth_name, allowed_authorities) VALUES
+ ('any', 'EPSG', 'PROJ,EPSG,any' );
+
+INSERT INTO authority_to_authority_preference(source_auth_name, target_auth_name, allowed_authorities) VALUES
+ ('EPSG', 'EPSG', 'PROJ,EPSG' );
+
+INSERT INTO authority_to_authority_preference(source_auth_name, target_auth_name, allowed_authorities) VALUES
+ ('PROJ', 'EPSG', 'PROJ,EPSG' );
+
+INSERT INTO authority_to_authority_preference(source_auth_name, target_auth_name, allowed_authorities) VALUES
+ ('IGNF', 'EPSG', 'PROJ,IGNF,EPSG' );
+
+INSERT INTO authority_to_authority_preference(source_auth_name, target_auth_name, allowed_authorities) VALUES
+ ('ESRI', 'EPSG', 'PROJ,ESRI,EPSG' ); \ No newline at end of file
diff --git a/data/sql/proj_db_table_defs.sql b/data/sql/proj_db_table_defs.sql
index 553dab38..c63637cf 100644
--- a/data/sql/proj_db_table_defs.sql
+++ b/data/sql/proj_db_table_defs.sql
@@ -1048,3 +1048,12 @@ CREATE VIEW authority_list AS
UNION
SELECT DISTINCT auth_name FROM coordinate_operation_view
;
+
+-- Define the allowed authorities, and their precedence, when researching a
+-- coordinate operation
+CREATE TABLE authority_to_authority_preference(
+ source_auth_name TEXT NOT NULL, -- 'any' for any source
+ target_auth_name TEXT NOT NULL, -- 'any' for any target
+ allowed_authorities TEXT NOT NULL, -- for example 'PROJ,EPSG,any'
+ CONSTRAINT unique_authority_to_authority_preference UNIQUE (source_auth_name, target_auth_name)
+);