aboutsummaryrefslogtreecommitdiff
path: root/src/iso19111/factory.cpp
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-04-04 22:44:07 +0200
committerEven Rouault <even.rouault@spatialys.com>2021-04-06 23:30:19 +0200
commit950ce787b26b3b3afd0ff76151fdf72d1381b7a1 (patch)
treeb2d70e6c7151361c6cf9e99592ada7386c4a1d95 /src/iso19111/factory.cpp
parentf85b0723136eed9891569b988607f07ef185d504 (diff)
downloadPROJ-950ce787b26b3b3afd0ff76151fdf72d1381b7a1.tar.gz
PROJ-950ce787b26b3b3afd0ff76151fdf72d1381b7a1.zip
Database: nullify auth_name, code of usage table
We never select by those columns, so don't set them. Reduce from 8.4 to 7.9 MB. Upgrade the minor version of the database layout. (that database can still be read by PROJ 8.0)
Diffstat (limited to 'src/iso19111/factory.cpp')
-rw-r--r--src/iso19111/factory.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp
index 2da09d27..b59cc1ab 100644
--- a/src/iso19111/factory.cpp
+++ b/src/iso19111/factory.cpp
@@ -101,7 +101,7 @@ namespace io {
constexpr int DATABASE_LAYOUT_VERSION_MAJOR = 1;
// If the code depends on the new additions, then DATABASE_LAYOUT_VERSION_MINOR
// must be incremented.
-constexpr int DATABASE_LAYOUT_VERSION_MINOR = 0;
+constexpr int DATABASE_LAYOUT_VERSION_MINOR = 1;
constexpr size_t N_MAX_PARAMS = 7;
@@ -735,7 +735,7 @@ void DatabaseContext::Private::checkDatabaseLayout(
// cppcheck-suppress knownConditionTrueFalse
DATABASE_LAYOUT_VERSION_MAJOR == 1 &&
// cppcheck-suppress knownConditionTrueFalse
- DATABASE_LAYOUT_VERSION_MINOR == 0,
+ DATABASE_LAYOUT_VERSION_MINOR == 1,
"remove that assertion and below lines next time we upgrade "
"database structure");
res = run("SELECT 1 FROM metadata WHERE key = 'EPSG.VERSION' AND "
@@ -766,6 +766,15 @@ void DatabaseContext::Private::checkDatabaseLayout(
" is expected. "
"It comes from another PROJ installation.");
}
+ // Database layout v1.0 of PROJ 8.0 is forward compatible with v1.1
+ static_assert(
+ // cppcheck-suppress knownConditionTrueFalse
+ DATABASE_LAYOUT_VERSION_MAJOR == 1 &&
+ // cppcheck-suppress knownConditionTrueFalse
+ DATABASE_LAYOUT_VERSION_MINOR == 1,
+ "re-enable the check below if database layout v1.0 and v1.1 is no "
+ "longer compatible");
+#if 0
if (minor < DATABASE_LAYOUT_VERSION_MINOR) {
throw FactoryException(
path +
@@ -774,6 +783,7 @@ void DatabaseContext::Private::checkDatabaseLayout(
" is expected. "
"It comes from another PROJ installation.");
}
+#endif
if (dbNamePrefix.empty()) {
nLayoutVersionMajor_ = major;
nLayoutVersionMinor_ = minor;