aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-08-08 20:04:20 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-08-09 13:22:25 +0200
commit89f2cc7ec4178a369e73e9cd115a2552a55d870a (patch)
treeb5a96d4248a0bb866477ed3c865fdb5648dc0a06 /test
parentec49c9cd0aa9de24623920b8de226daf05a0e90f (diff)
downloadPROJ-89f2cc7ec4178a369e73e9cd115a2552a55d870a.tar.gz
PROJ-89f2cc7ec4178a369e73e9cd115a2552a55d870a.zip
PROJJSON export: use more compact form
Diffstat (limited to 'test')
-rw-r--r--test/cli/testprojinfo_out.dist37
-rw-r--r--test/unit/test_datum.cpp27
2 files changed, 22 insertions, 42 deletions
diff --git a/test/cli/testprojinfo_out.dist b/test/cli/testprojinfo_out.dist
index 530a0426..73751b99 100644
--- a/test/cli/testprojinfo_out.dist
+++ b/test/cli/testprojinfo_out.dist
@@ -143,56 +143,25 @@ PROJJSON:
"type": "GeodeticReferenceFrame",
"name": "World Geodetic System 1984",
"ellipsoid": {
- "type": "Ellipsoid",
"name": "WGS 84",
- "semi_major_axis": {
- "value": 6378137,
- "unit": {
- "type": "LinearUnit",
- "name": "metre",
- "conversion_factor": 1
- }
- },
+ "semi_major_axis": 6378137,
"inverse_flattening": 298.257223563
- },
- "prime_meridian": {
- "type": "PrimeMeridian",
- "name": "Greenwich",
- "longitude": {
- "value": 0,
- "unit": {
- "type": "AngularUnit",
- "name": "degree",
- "conversion_factor": 0.0174532925199433
- }
- }
}
},
"coordinate_system": {
- "type": "CoordinateSystem",
"subtype": "ellipsoidal",
"axis": [
{
- "type": "Axis",
"name": "Geodetic latitude",
"abbreviation": "Lat",
"direction": "north",
- "unit": {
- "type": "AngularUnit",
- "name": "degree",
- "conversion_factor": 0.0174532925199433
- }
+ "unit": "degree"
},
{
- "type": "Axis",
"name": "Geodetic longitude",
"abbreviation": "Lon",
"direction": "east",
- "unit": {
- "type": "AngularUnit",
- "name": "degree",
- "conversion_factor": 0.0174532925199433
- }
+ "unit": "degree"
}
]
},
diff --git a/test/unit/test_datum.cpp b/test/unit/test_datum.cpp
index cf2e2f3a..d8fab1f0 100644
--- a/test/unit/test_datum.cpp
+++ b/test/unit/test_datum.cpp
@@ -212,19 +212,30 @@ TEST(datum, prime_meridian_to_JSON) {
"{\n"
" \"type\": \"PrimeMeridian\",\n"
" \"name\": \"Greenwich\",\n"
- " \"longitude\": {\n"
- " \"value\": 0,\n"
- " \"unit\": {\n"
- " \"type\": \"AngularUnit\",\n"
- " \"name\": \"degree\",\n"
- " \"conversion_factor\": 0.0174532925199433\n"
- " }\n"
- " },\n"
+ " \"longitude\": 0,\n"
" \"id\": {\n"
" \"authority\": \"EPSG\",\n"
" \"code\": 8901\n"
" }\n"
"}");
+
+ EXPECT_EQ(PrimeMeridian::PARIS->exportToJSON(JSONFormatter::create().get()),
+ "{\n"
+ " \"type\": \"PrimeMeridian\",\n"
+ " \"name\": \"Paris\",\n"
+ " \"longitude\": {\n"
+ " \"value\": 2.5969213,\n"
+ " \"unit\": {\n"
+ " \"type\": \"AngularUnit\",\n"
+ " \"name\": \"grad\",\n"
+ " \"conversion_factor\": 0.015707963267949\n"
+ " }\n"
+ " },\n"
+ " \"id\": {\n"
+ " \"authority\": \"EPSG\",\n"
+ " \"code\": 8903\n"
+ " }\n"
+ "}");
}
// ---------------------------------------------------------------------------