Skip to content

Commit 4d4f646

Browse files
authored
Merge pull request #4071 from rouault/db_unique_names
Database: add constraint for unicity of CRS and operation names
2 parents ca6d011 + 642b527 commit 4d4f646

File tree

6 files changed

+102
-21
lines changed

6 files changed

+102
-21
lines changed

data/sql/commit.sql

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ FOR EACH ROW BEGIN
2828
SELECT RAISE(ABORT, 'corrupt definition of authority_list')
2929
WHERE (SELECT 1 FROM authority_list LIMIT 1) = 0;
3030

31+
-- check that the auth_name of all objects in object_view is recorded in builtin_authorities
32+
SELECT RAISE(ABORT, 'One or several authorities referenced in object_view are missing in builtin_authorities')
33+
WHERE EXISTS (
34+
SELECT DISTINCT o.auth_name FROM object_view o WHERE NOT EXISTS (
35+
SELECT 1 FROM builtin_authorities b WHERE o.auth_name = b.auth_name)
36+
);
37+
3138
-- check that a usage is registered for most objects where this is needed
3239
SELECT RAISE(ABORT, 'One or several objects lack a corresponding record in the usage table')
3340
WHERE EXISTS (

data/sql/metadata.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
-- DATABASE_LAYOUT_VERSION_MINOR constants in src/iso19111/factory.cpp must be
88
-- updated as well.
99
INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MAJOR', 1);
10-
INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MINOR', 3);
10+
INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MINOR', 4);
1111

1212
INSERT INTO "metadata" VALUES('EPSG.VERSION', 'v11.004');
1313
INSERT INTO "metadata" VALUES('EPSG.DATE', '2024-02-24');

data/sql/proj_db_table_defs.sql

Lines changed: 64 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,33 @@ CREATE TABLE vertical_crs(
306306
CONSTRAINT fk_vertical_crs_datum FOREIGN KEY (datum_auth_name, datum_code) REFERENCES vertical_datum(auth_name, code) ON DELETE CASCADE
307307
) WITHOUT ROWID;
308308

309+
-- Authorities provided by the upstream PROJ
310+
-- This is used to check unicity of object names
311+
CREATE TABLE builtin_authorities(auth_name TEXT NOT NULL PRIMARY KEY) WITHOUT ROWID;
312+
INSERT INTO builtin_authorities VALUES
313+
('EPSG'),
314+
('ESRI'),
315+
('IAU_2015'),
316+
('IGNF'),
317+
('NKG'),
318+
('NRCAN'),
319+
('OGC'),
320+
('PROJ')
321+
;
322+
309323
CREATE TRIGGER vertical_crs_insert_trigger
310324
BEFORE INSERT ON vertical_crs
311325
FOR EACH ROW BEGIN
312326

313327
SELECT RAISE(ABORT, 'insert on vertical_crs violates constraint: (auth_name, code) must not already exist in crs_view')
314328
WHERE EXISTS (SELECT 1 FROM crs_view WHERE crs_view.auth_name = NEW.auth_name AND crs_view.code = NEW.code);
315329

330+
SELECT RAISE(ABORT, 'insert on vertical_crs violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) crs_view')
331+
WHERE EXISTS (SELECT 1 FROM crs_view WHERE crs_view.name = NEW.name AND crs_view.deprecated = 0 AND NEW.deprecated = 0
332+
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
333+
AND NOT(NEW.auth_name = 'ESRI' and crs_view.table_name = 'geodetic_crs') -- some ESRI vertical CRS are an ellipsoidal height CRS derived from a geodetic CRS
334+
);
335+
316336
SELECT RAISE(ABORT, 'insert on vertical_crs violates constraint: datum must not be deprecated when vertical_crs is not deprecated')
317337
WHERE EXISTS(SELECT 1 FROM vertical_crs datum WHERE datum.auth_name = NEW.datum_auth_name AND datum.code = NEW.datum_code AND datum.deprecated != 0) AND NEW.deprecated = 0;
318338

@@ -723,6 +743,11 @@ FOR EACH ROW BEGIN
723743
SELECT RAISE(ABORT, 'insert on projected_crs violates constraint: (auth_name, code) must not already exist in crs_view')
724744
WHERE EXISTS (SELECT 1 FROM crs_view WHERE crs_view.auth_name = NEW.auth_name AND crs_view.code = NEW.code);
725745

746+
SELECT RAISE(ABORT, 'insert on projected_crs violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) crs_view')
747+
WHERE EXISTS (SELECT 1 FROM crs_view WHERE crs_view.name = NEW.name AND crs_view.deprecated = 0 AND NEW.deprecated = 0
748+
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
749+
);
750+
726751
SELECT RAISE(ABORT, 'insert on projected_crs violates constraint: geodetic_crs must not be deprecated when projected_crs is not deprecated')
727752
WHERE EXISTS(SELECT 1 FROM geodetic_crs WHERE geodetic_crs.auth_name = NEW.geodetic_crs_auth_name AND geodetic_crs.code = NEW.geodetic_crs_code AND geodetic_crs.deprecated != 0 AND geodetic_crs.name NOT LIKE 'Unknown datum%' AND geodetic_crs.name NOT LIKE 'Unspecified datum%') AND NEW.deprecated = 0 AND NOT (NEW.auth_name = 'ESRI' AND NEW.geodetic_crs_auth_name != 'ESRI');
728753

@@ -764,6 +789,11 @@ FOR EACH ROW BEGIN
764789
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: (auth_name, code) must not already exist in crs_view')
765790
WHERE EXISTS (SELECT 1 FROM crs_view WHERE crs_view.auth_name = NEW.auth_name AND crs_view.code = NEW.code);
766791

792+
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) crs_view')
793+
WHERE EXISTS (SELECT 1 FROM crs_view WHERE crs_view.name = NEW.name AND crs_view.deprecated = 0 AND NEW.deprecated = 0
794+
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
795+
);
796+
767797
SELECT RAISE(ABORT, 'insert on compound_crs violates constraint: horiz_crs(auth_name, code) not found')
768798
WHERE NOT EXISTS (SELECT 1 FROM crs_view WHERE crs_view.auth_name = NEW.horiz_crs_auth_name AND crs_view.code = NEW.horiz_crs_code);
769799

@@ -1026,6 +1056,13 @@ FOR EACH ROW BEGIN
10261056
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
10271057
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.auth_name = NEW.auth_name AND covwv.code = NEW.code);
10281058

1059+
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1060+
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.name = NEW.name AND covwv.deprecated = 0 AND NEW.deprecated = 0
1061+
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
1062+
AND NEW.name != 'NKG_ETRF00 to [email protected]' -- NKG:P1_2008_EE and NKG:P1_2008_FI have the same name
1063+
AND NEW.name != 'NKG_ETRF14 to [email protected]' -- NKG:PAR_2020_EE and NKG:PAR_2020_FI have the same name
1064+
);
1065+
10291066
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: translation_uom.type must be ''length''')
10301067
WHERE (SELECT type FROM unit_of_measure WHERE unit_of_measure.auth_name = NEW.translation_uom_auth_name AND unit_of_measure.code = NEW.translation_uom_code) != 'length';
10311068
SELECT RAISE(ABORT, 'insert on helmert_transformation violates constraint: rotation_uom.type must be ''angle''')
@@ -1096,6 +1133,15 @@ FOR EACH ROW BEGIN
10961133
SELECT RAISE(ABORT, 'insert on grid_transformation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
10971134
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.auth_name = NEW.auth_name AND covwv.code = NEW.code);
10981135

1136+
SELECT RAISE(ABORT, 'insert on grid_transformation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1137+
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.name = NEW.name AND covwv.deprecated = 0 AND NEW.deprecated = 0
1138+
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
1139+
AND NEW.name != 'NAD83(CSRS)v2 to NAD83(CSRS)v3 (1)' -- duplicate entry in EPSG
1140+
AND NEW.name != 'ETRS89 to ETRS89 + Baltic 1957 height (1)' -- duplicate entry in EPSG
1141+
AND NOT (NEW.description LIKE 'Reversible alternative to%' AND covwv.description NOT LIKE 'Reversible alternative to%')
1142+
AND NEW.code NOT LIKE '%_WITH_NAD83CSRSV7_INTERPOLATION'
1143+
);
1144+
10991145
SELECT RAISE(ABORT, 'insert on grid_transformation violates constraint: source_crs(auth_name, code) not found')
11001146
WHERE NOT EXISTS (SELECT 1 FROM crs_view WHERE crs_view.auth_name = NEW.source_crs_auth_name AND crs_view.code = NEW.source_crs_code);
11011147

@@ -1266,6 +1312,17 @@ FOR EACH ROW BEGIN
12661312
SELECT RAISE(ABORT, 'insert on other_transformation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
12671313
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.auth_name = NEW.auth_name AND covwv.code = NEW.code);
12681314

1315+
SELECT RAISE(ABORT, 'insert on other_transformation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1316+
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.name = NEW.name AND covwv.deprecated = 0 AND NEW.deprecated = 0
1317+
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
1318+
AND NEW.name != 'NKG_ETRF14 to [email protected]' -- NKG:PAR_2020_NO and NKG:NKG_ETRF14_ETRF93_2000 have the same name
1319+
AND NEW.name != '[email protected] to [email protected]' -- NKG:ETRF96_2000_TO_ETRF96_1997_56 and NKG:EE_2020_INTRAPLATE have the same name
1320+
AND NEW.name != '[email protected] to [email protected]' -- NKG:ETRF93_2000_TO_ETRF93_1995 and NKG:NO_2020_INTRAPLATE have the same name
1321+
AND NEW.name != '[email protected] to [email protected]' -- NKG:ETRF92_2000_TO_ETRF92_1994 and NKG:DK_2020_INTRAPLATE have the same name
1322+
AND NEW.name != '[email protected] to [email protected]' -- NKG:ETRF96_2000_TO_ETRF96_1997 AND NKG:FI_2020_INTRAPLATE have the same name
1323+
AND NEW.name != '[email protected] to [email protected]' -- NKG:ETRF97_2000_TO_ETRF97_1999 and NKG:SE_2020_INTRAPLATE have the same name
1324+
);
1325+
12691326
SELECT RAISE(ABORT, 'insert on other_transformation violates constraint: source_crs(auth_name, code) not found')
12701327
WHERE NOT EXISTS (SELECT 1 FROM crs_view WHERE crs_view.auth_name = NEW.source_crs_auth_name AND crs_view.code = NEW.source_crs_code);
12711328

@@ -1311,6 +1368,11 @@ FOR EACH ROW BEGIN
13111368
SELECT RAISE(ABORT, 'insert on concatenated_operation violates constraint: (auth_name, code) must not already exist in coordinate_operation_with_conversion_view')
13121369
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.auth_name = NEW.auth_name AND covwv.code = NEW.code);
13131370

1371+
SELECT RAISE(ABORT, 'insert on concatenated_operation violates constraint: name (of a non-deprecated entry) must not already exist in (a non-deprecated entry of) coordinate_operation_with_conversion_view')
1372+
WHERE EXISTS (SELECT 1 FROM coordinate_operation_with_conversion_view covwv WHERE covwv.name = NEW.name AND covwv.deprecated = 0 AND NEW.deprecated = 0
1373+
AND NEW.auth_name IN (SELECT auth_name FROM builtin_authorities WHERE auth_name != 'IGNF')
1374+
);
1375+
13141376
SELECT RAISE(ABORT, 'insert on concatenated_operation violates constraint: source_crs(auth_name, code) not found')
13151377
WHERE NOT EXISTS (SELECT 1 FROM crs_view WHERE crs_view.auth_name = NEW.source_crs_auth_name AND crs_view.code = NEW.source_crs_code);
13161378

@@ -1469,8 +1531,8 @@ CREATE VIEW coordinate_operation_view AS
14691531
;
14701532

14711533
CREATE VIEW coordinate_operation_with_conversion_view AS
1472-
SELECT auth_name, code, table_name AS type FROM coordinate_operation_view UNION ALL
1473-
SELECT auth_name, code, CAST('conversion' AS TEXT) FROM conversion_table;
1534+
SELECT auth_name, code, name, description, table_name AS type, deprecated FROM coordinate_operation_view UNION ALL
1535+
SELECT auth_name, code, name, description, CAST('conversion' AS TEXT) AS type, deprecated FROM conversion_table;
14741536

14751537
CREATE VIEW crs_view AS
14761538
SELECT CAST('geodetic_crs' AS TEXT) AS table_name, auth_name, code, name, type,

src/iso19111/factory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ constexpr const char *CS_TYPE_ORDINAL = cs::OrdinalCS::WKT2_TYPE;
126126
constexpr int DATABASE_LAYOUT_VERSION_MAJOR = 1;
127127
// If the code depends on the new additions, then DATABASE_LAYOUT_VERSION_MINOR
128128
// must be incremented.
129-
constexpr int DATABASE_LAYOUT_VERSION_MINOR = 3;
129+
constexpr int DATABASE_LAYOUT_VERSION_MINOR = 4;
130130

131131
constexpr size_t N_MAX_PARAMS = 7;
132132

test/cli/testprojinfo_out.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1593,7 +1593,7 @@ CREATE TABLE unit_of_measure(
15931593

15941594
Testing projinfo --dump-db-structure --output-id HOBU:XXXX EPSG:4326 | tail -n 4
15951595
INSERT INTO metadata VALUES('DATABASE.LAYOUT.VERSION.MAJOR',1);
1596-
INSERT INTO metadata VALUES('DATABASE.LAYOUT.VERSION.MINOR',3);
1596+
INSERT INTO metadata VALUES('DATABASE.LAYOUT.VERSION.MINOR',4);
15971597
INSERT INTO geodetic_crs VALUES('HOBU','XXXX','WGS 84','','geographic 2D','EPSG','6422','EPSG','6326',NULL,0);
15981598
INSERT INTO usage VALUES('HOBU','USAGE_GEODETIC_CRS_XXXX','geodetic_crs','HOBU','XXXX','EPSG','1262','EPSG','1183');
15991599

test/unit/test_factory.cpp

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,7 @@ class FactoryWithTmpDatabase : public ::testing::Test {
18981898

18991899
ASSERT_TRUE(execute(
19001900
"INSERT INTO helmert_transformation "
1901-
"VALUES('EPSG','DUMMY_HELMERT','name',NULL,'EPSG','9603','"
1901+
"VALUES('EPSG','DUMMY_HELMERT','dummy_helmert',NULL,'EPSG','9603','"
19021902
"Geocentric translations (geog2D domain)','EPSG','4326',"
19031903
"'EPSG','4326',44.0,-143."
19041904
"0,-90.0,-294.0,'EPSG','9001',NULL,NULL,NULL,NULL,NULL,NULL,"
@@ -1914,7 +1914,8 @@ class FactoryWithTmpDatabase : public ::testing::Test {
19141914

19151915
ASSERT_TRUE(execute(
19161916
"INSERT INTO grid_transformation "
1917-
"VALUES('EPSG','DUMMY_GRID_TRANSFORMATION','name',NULL,"
1917+
"VALUES('EPSG','DUMMY_GRID_TRANSFORMATION',"
1918+
"'dummy_grid_transformation',NULL,"
19181919
"'EPSG','9615'"
19191920
",'NTv2','EPSG','4326','EPSG','4326',1.0,'EPSG','"
19201921
"8656','Latitude and longitude difference "
@@ -1936,7 +1937,8 @@ class FactoryWithTmpDatabase : public ::testing::Test {
19361937

19371938
ASSERT_TRUE(execute(
19381939
"INSERT INTO other_transformation "
1939-
"VALUES('EPSG','DUMMY_OTHER_TRANSFORMATION','name',NULL,"
1940+
"VALUES('EPSG','DUMMY_OTHER_TRANSFORMATION',"
1941+
"'dummy_other_transformation',NULL,"
19401942
"'EPSG','9601','Longitude rotation',"
19411943
"'EPSG','4326','EPSG','4326',0.0,'EPSG'"
19421944
",'8602','Longitude "
@@ -1954,7 +1956,8 @@ class FactoryWithTmpDatabase : public ::testing::Test {
19541956
<< last_error();
19551957

19561958
ASSERT_TRUE(execute("INSERT INTO concatenated_operation "
1957-
"VALUES('EPSG','DUMMY_CONCATENATED','name',NULL,"
1959+
"VALUES('EPSG','DUMMY_CONCATENATED',"
1960+
"'dummy_concatenated',NULL,"
19581961
"'EPSG','4326','EPSG'"
19591962
",'4326',NULL,NULL,0);"))
19601963
<< last_error();
@@ -2381,7 +2384,8 @@ TEST_F(FactoryWithTmpDatabase,
23812384
<< last_error();
23822385
ASSERT_TRUE(
23832386
execute("INSERT INTO other_transformation "
2384-
"VALUES('EPSG','4326_TO_OTHER_GEOG_CRS','name',NULL,"
2387+
"VALUES('EPSG','4326_TO_OTHER_GEOG_CRS',"
2388+
"'4326_to_other_geog_crs',NULL,"
23852389
"'EPSG','9601','Longitude rotation',"
23862390
"'EPSG','4326','EPSG','OTHER_GEOG_CRS',0.0,'EPSG'"
23872391
",'8602','Longitude "
@@ -2392,7 +2396,8 @@ TEST_F(FactoryWithTmpDatabase,
23922396
<< last_error();
23932397
ASSERT_TRUE(
23942398
execute("INSERT INTO other_transformation "
2395-
"VALUES('EPSG','OTHER_GEOG_CRS_TO_4326','name',NULL,"
2399+
"VALUES('EPSG','OTHER_GEOG_CRS_TO_4326',"
2400+
"'other_geog_crs_to_4326',NULL,"
23962401
"'EPSG','9601','Longitude rotation',"
23972402
"'EPSG','OTHER_GEOG_CRS','EPSG','4326',0.0,'EPSG'"
23982403
",'8602','Longitude "
@@ -2402,7 +2407,8 @@ TEST_F(FactoryWithTmpDatabase,
24022407
"NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0);"))
24032408
<< last_error();
24042409
ASSERT_TRUE(execute("INSERT INTO concatenated_operation "
2405-
"VALUES('EPSG','DUMMY_CONCATENATED_2','name',NULL,"
2410+
"VALUES('EPSG','DUMMY_CONCATENATED_2',"
2411+
"'dummy_concatenated_2',NULL,"
24062412
"'EPSG','4326','EPSG'"
24072413
",'4326',NULL,NULL,0);"))
24082414
<< last_error();
@@ -2441,7 +2447,7 @@ TEST_F(FactoryWithTmpDatabase,
24412447
<< last_error();
24422448

24432449
ASSERT_TRUE(execute("INSERT INTO projected_crs "
2444-
"VALUES('OTHER','OTHER_32631','WGS 84 / UTM zone "
2450+
"VALUES('OTHER','OTHER_32631','my WGS 84 / UTM zone "
24452451
"31N',NULL,'EPSG','4400','OTHER','OTHER_4326',"
24462452
"'EPSG','16031',NULL,0);"))
24472453
<< last_error();
@@ -2478,7 +2484,8 @@ TEST_F(FactoryWithTmpDatabase,
24782484

24792485
ASSERT_TRUE(execute(
24802486
"INSERT INTO grid_transformation "
2481-
"VALUES('OTHER','OTHER_GRID_TRANSFORMATION','name',NULL,"
2487+
"VALUES('OTHER','OTHER_GRID_TRANSFORMATION',"
2488+
"'other_grid_transformation_2',NULL,"
24822489
"'EPSG','9615'"
24832490
",'NTv2','EPSG','4326','OTHER','OTHER_4326',1.0,'EPSG','"
24842491
"8656','Latitude and longitude difference "
@@ -3035,19 +3042,22 @@ TEST_F(FactoryWithTmpDatabase, custom_projected_crs) {
30353042
populateWithFakeEPSG();
30363043

30373044
ASSERT_TRUE(execute("INSERT INTO projected_crs "
3038-
"VALUES('TEST_NS','TEST','my name',NULL,NULL,"
3045+
"VALUES('TEST_NS','TEST',"
3046+
"'custom_projected_crs',NULL,NULL,"
30393047
"NULL,NULL,NULL,NULL,NULL,"
30403048
"'+proj=mbt_s +unused_flag',0);"))
30413049
<< last_error();
30423050

30433051
ASSERT_TRUE(execute("INSERT INTO projected_crs "
3044-
"VALUES('TEST_NS','TEST_BOUND','my name',NULL,"
3052+
"VALUES('TEST_NS','TEST_BOUND',"
3053+
"'custom_projected_crs2',NULL,"
30453054
"NULL,NULL,NULL,NULL,NULL,NULL,"
30463055
"'+proj=mbt_s +unused_flag +towgs84=1,2,3',0);"))
30473056
<< last_error();
30483057

30493058
ASSERT_TRUE(execute("INSERT INTO projected_crs "
3050-
"VALUES('TEST_NS','TEST_WRONG','my name',NULL,"
3059+
"VALUES('TEST_NS','TEST_WRONG',"
3060+
"'custom_projected_crs3',NULL,"
30513061
"NULL,NULL,NULL,NULL,NULL,NULL,"
30523062
"'+proj=longlat',0);"))
30533063
<< last_error();
@@ -3097,7 +3107,7 @@ TEST_F(FactoryWithTmpDatabase, custom_projected_crs) {
30973107
AuthorityFactory::create(DatabaseContext::create(m_ctxt), "TEST_NS");
30983108
{
30993109
auto crs = factory->createProjectedCRS("TEST");
3100-
EXPECT_EQ(*(crs->name()->description()), "my name");
3110+
EXPECT_EQ(*(crs->name()->description()), "custom_projected_crs");
31013111
EXPECT_EQ(crs->identifiers().size(), 1U);
31023112
EXPECT_EQ(crs->derivingConversion()->targetCRS().get(), crs.get());
31033113
EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()),
@@ -3106,7 +3116,7 @@ TEST_F(FactoryWithTmpDatabase, custom_projected_crs) {
31063116
}
31073117
{
31083118
auto crs = factory->createProjectedCRS("TEST_BOUND");
3109-
EXPECT_EQ(*(crs->name()->description()), "my name");
3119+
EXPECT_EQ(*(crs->name()->description()), "custom_projected_crs2");
31103120
EXPECT_EQ(crs->identifiers().size(), 1U);
31113121
EXPECT_EQ(crs->derivingConversion()->targetCRS().get(), crs.get());
31123122
EXPECT_EQ(crs->exportToPROJString(PROJStringFormatter::create().get()),
@@ -3487,7 +3497,8 @@ TEST_F(FactoryWithTmpDatabase,
34873497

34883498
ASSERT_TRUE(execute(
34893499
"INSERT INTO other_transformation "
3490-
"VALUES('EPSG','NOOP_TRANSFORMATION_32631','name',NULL,"
3500+
"VALUES('EPSG','NOOP_TRANSFORMATION_32631',"
3501+
"'NOOP_TRANSFORMATION_32631',NULL,"
34913502
"'PROJ','PROJString','+proj=noop',"
34923503
"'EPSG','32631','EPSG','32631',0.0,"
34933504
"NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,"
@@ -3506,7 +3517,8 @@ TEST_F(FactoryWithTmpDatabase,
35063517

35073518
ASSERT_TRUE(execute(
35083519
"INSERT INTO other_transformation "
3509-
"VALUES('EPSG','NOOP_TRANSFORMATION_4326','name',NULL,"
3520+
"VALUES('EPSG','NOOP_TRANSFORMATION_4326',"
3521+
"'NOOP_TRANSFORMATION_4326',NULL,"
35103522
"'PROJ','PROJString','+proj=noop',"
35113523
"'EPSG','4326','EPSG','4326',0.0,"
35123524
"NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,"

0 commit comments

Comments
 (0)