From 23c44387d104b1d5c16c9f583d975ea4d895b534 Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Tue, 28 Sep 2021 14:47:06 +0200
Subject: Database: add some hand made entries early

---
 data/sql/proj_db_table_defs.sql | 2 --
 1 file changed, 2 deletions(-)

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

diff --git a/data/sql/proj_db_table_defs.sql b/data/sql/proj_db_table_defs.sql
index 9155fd8f..560cd59e 100644
--- a/data/sql/proj_db_table_defs.sql
+++ b/data/sql/proj_db_table_defs.sql
@@ -35,8 +35,6 @@ CREATE TABLE celestial_body (
     CONSTRAINT pk_celestial_body PRIMARY KEY (auth_name, code)
 ) WITHOUT ROWID;
 
-INSERT INTO celestial_body VALUES('PROJ', 'EARTH', 'Earth', 6378137.0);
-
 CREATE TABLE ellipsoid (
     auth_name TEXT NOT NULL CHECK (length(auth_name) >= 1),
     code INTEGER_OR_TEXT NOT NULL CHECK (length(code) >= 1),
-- 
cgit v1.2.3


From bc30adc7d84aa07a551391f722c1ab7bcaae60ee Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Tue, 28 Sep 2021 14:47:08 +0200
Subject: Database: add check for Orthographic conversion

---
 data/sql/proj_db_table_defs.sql | 1 +
 1 file changed, 1 insertion(+)

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

diff --git a/data/sql/proj_db_table_defs.sql b/data/sql/proj_db_table_defs.sql
index 560cd59e..bf7afca0 100644
--- a/data/sql/proj_db_table_defs.sql
+++ b/data/sql/proj_db_table_defs.sql
@@ -539,6 +539,7 @@ BEGIN
             'EPSG_9836_Geocentric/topocentric conversions',
             'EPSG_9837_Geographic/topocentric conversions',
             'EPSG_9838_Vertical Perspective',
+            'EPSG_9840_Orthographic',
             'EPSG_9841_Mercator (1SP) (Spherical)',
             'EPSG_9842_Equidistant Cylindrical',
             'EPSG_9843_Axis Order Reversal (2D)',
-- 
cgit v1.2.3


From e6e6e4ca345e774910afa5bbe485c3d9f7851cd4 Mon Sep 17 00:00:00 2001
From: Even Rouault <even.rouault@spatialys.com>
Date: Tue, 28 Sep 2021 14:47:09 +0200
Subject: Add a mapping for versioned authorities, so that one can use IAU:xxxx
 or IAU_2015:xxxx transparently

---
 data/sql/proj_db_table_defs.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)

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

diff --git a/data/sql/proj_db_table_defs.sql b/data/sql/proj_db_table_defs.sql
index bf7afca0..20ce940e 100644
--- a/data/sql/proj_db_table_defs.sql
+++ b/data/sql/proj_db_table_defs.sql
@@ -1515,3 +1515,14 @@ CREATE TABLE authority_to_authority_preference(
     allowed_authorities TEXT NOT NULL,  -- for example 'PROJ,EPSG,any'
     CONSTRAINT unique_authority_to_authority_preference UNIQUE (source_auth_name, target_auth_name)
 );
+
+-- Map 'IAU_2015' to auth_name=IAU and version=2015
+CREATE TABLE versioned_auth_name_mapping(
+    versioned_auth_name    TEXT NOT NULL PRIMARY KEY,
+    auth_name              TEXT NOT NULL,
+    version                TEXT NOT NULL,
+    priority               INTEGER NOT NULL,
+    CONSTRAINT unique_auth_name_version UNIQUE (auth_name, version),
+    CONSTRAINT unique_auth_name_priority UNIQUE (auth_name, priority)
+);
+
-- 
cgit v1.2.3

