@@ -15133,8 +15133,14 @@ TEST(json_import, projected_crs) {
1513315133 auto obj = createFromUserInput(json, nullptr);
1513415134 auto pcrs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
1513515135 ASSERT_TRUE(pcrs != nullptr);
15136- EXPECT_EQ(pcrs->exportToJSON(&(JSONFormatter::create()->setSchema("foo"))),
15137- json);
15136+ std::string got_json =
15137+ pcrs->exportToJSON(&(JSONFormatter::create()->setSchema("foo")));
15138+ const char *typeGeogCRS = " \"type\": \"GeographicCRS\",\n";
15139+ const auto posTypeGeogCRS = got_json.find(typeGeogCRS);
15140+ EXPECT_TRUE(posTypeGeogCRS != std::string::npos) << got_json;
15141+ got_json = got_json.substr(0, posTypeGeogCRS) +
15142+ got_json.substr(posTypeGeogCRS + strlen(typeGeogCRS));
15143+ EXPECT_STREQ(got_json.c_str(), json);
1513815144}
1513915145
1514015146// ---------------------------------------------------------------------------
@@ -15363,8 +15369,14 @@ TEST(json_import, projected_crs_with_geocentric_base) {
1536315369 auto pcrs = nn_dynamic_pointer_cast<ProjectedCRS>(obj);
1536415370 ASSERT_TRUE(pcrs != nullptr);
1536515371 EXPECT_TRUE(pcrs->baseCRS()->isGeocentric());
15366- EXPECT_EQ(pcrs->exportToJSON(&(JSONFormatter::create()->setSchema("foo"))),
15367- json);
15372+ std::string got_json =
15373+ pcrs->exportToJSON(&(JSONFormatter::create()->setSchema("foo")));
15374+ const char *typeGeodCRS = " \"type\": \"GeodeticCRS\",\n";
15375+ const auto posTypeGeodCRS = got_json.find(typeGeodCRS);
15376+ EXPECT_TRUE(posTypeGeodCRS != std::string::npos) << got_json;
15377+ got_json = got_json.substr(0, posTypeGeodCRS) +
15378+ got_json.substr(posTypeGeodCRS + strlen(typeGeodCRS));
15379+ EXPECT_STREQ(got_json.c_str(), json);
1536815380}
1536915381
1537015382// ---------------------------------------------------------------------------
@@ -16153,6 +16165,7 @@ TEST(json_import, concatenated_operation) {
1615316165 " \"type\": \"ProjectedCRS\",\n"
1615416166 " \"name\": \"GDA94 / Vicgrid\",\n"
1615516167 " \"base_crs\": {\n"
16168+ " \"type\": \"GeographicCRS\",\n"
1615616169 " \"name\": \"GDA94\",\n"
1615716170 " \"datum\": {\n"
1615816171 " \"type\": \"GeodeticReferenceFrame\",\n"
@@ -17371,6 +17384,7 @@ TEST(json_import, derived_projected_crs) {
1737117384 " \"type\": \"ProjectedCRS\",\n"
1737217385 " \"name\": \"WGS 84 / UTM zone 31N\",\n"
1737317386 " \"base_crs\": {\n"
17387+ " \"type\": \"GeographicCRS\",\n"
1737417388 " \"name\": \"WGS 84\",\n"
1737517389 " \"datum\": {\n"
1737617390 " \"type\": \"GeodeticReferenceFrame\",\n"
0 commit comments