aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-08-12 13:45:17 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-08-12 13:45:17 +0200
commit8d0500b325d12b047797a60e3c13d4b473fae987 (patch)
tree3537d416efd354bdfb7248034d912675d344ca9f /test
parent0a1261781de96d2bb8c76fbd905ebf8b0121d3a6 (diff)
downloadPROJ-8d0500b325d12b047797a60e3c13d4b473fae987.tar.gz
PROJ-8d0500b325d12b047797a60e3c13d4b473fae987.zip
PROJJSON: add support for importing 'ids'
Diffstat (limited to 'test')
-rw-r--r--test/unit/test_io.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/unit/test_io.cpp b/test/unit/test_io.cpp
index 74ef82f3..e1d424e9 100644
--- a/test/unit/test_io.cpp
+++ b/test/unit/test_io.cpp
@@ -11323,3 +11323,28 @@ TEST(json_import, derived_temporal_crs) {
ASSERT_TRUE(crs != nullptr);
EXPECT_EQ(crs->exportToJSON((JSONFormatter::create().get())), json);
}
+
+// ---------------------------------------------------------------------------
+
+TEST(json_import, multiple_ids) {
+ auto json = "{\n"
+ " \"type\": \"Ellipsoid\",\n"
+ " \"name\": \"WGS 84\",\n"
+ " \"semi_major_axis\": 6378137,\n"
+ " \"inverse_flattening\": 298.257223563,\n"
+ " \"ids\": [\n"
+ " {\n"
+ " \"authority\": \"EPSG\",\n"
+ " \"code\": 4326\n"
+ " },\n"
+ " {\n"
+ " \"authority\": \"FOO\",\n"
+ " \"code\": \"BAR\"\n"
+ " }\n"
+ " ]\n"
+ "}";
+ auto obj = createFromUserInput(json, nullptr);
+ auto ellps = nn_dynamic_pointer_cast<Ellipsoid>(obj);
+ ASSERT_TRUE(ellps != nullptr);
+ EXPECT_EQ(ellps->exportToJSON((JSONFormatter::create().get())), json);
+}