From d2d10a2af0d90f4b856bcfac274c45a5288d3284 Mon Sep 17 00:00:00 2001 From: ftoromanoff Date: Mon, 14 Oct 2024 10:27:26 +0200 Subject: [PATCH] trial fix test --- process.js | 27 +++++++++++++++------------ test-fixtures.json | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/process.js b/process.js index a28fee4..b5b19cb 100644 --- a/process.js +++ b/process.js @@ -13,7 +13,6 @@ function mapit(obj, key, value) { }, thing); if (key) { obj[key] = out; - obj[key].type = key; } } @@ -78,15 +77,6 @@ export function sExpr(v, obj) { sExpr(v[3], obj[key]); } return; - case 'PROJECTEDCRS': - case 'PROJCRS': - case 'GEOGCS': - case 'GEOCCS': - case 'PROJCS': - case 'LOCAL_CS': - case 'GEODCRS': - case 'GEODETICCRS': - case 'GEODETICDATUM': case 'EDATUM': case 'ENGINEERINGDATUM': case 'VERT_CS': @@ -94,14 +84,27 @@ export function sExpr(v, obj) { case 'VERTICALCRS': case 'COMPD_CS': case 'COMPOUNDCRS': - case 'ENGINEERINGCRS': - case 'ENGCRS': case 'FITTED_CS': case 'LOCAL_DATUM': case 'DATUM': v[0] = ['name', v[0]]; mapit(obj, key, v); return; + case 'PROJECTEDCRS': + case 'PROJCRS': + case 'GEOGCS': + case 'GEOCCS': + case 'PROJCS': + case 'LOCAL_CS': + case 'GEODCRS': + case 'GEODETICCRS': + case 'GEODETICDATUM': + case 'ENGCRS': + case 'ENGINEERINGCRS': + v[0] = ['name', v[0]]; + mapit(obj, key, v); + obj[key].type = key; + return; default: i = -1; while (++i < v.length) { diff --git a/test-fixtures.json b/test-fixtures.json index f661e0e..69c4e78 100644 --- a/test-fixtures.json +++ b/test-fixtures.json @@ -4,6 +4,7 @@ "type": "PROJCS", "name": "NZGD49 / New Zealand Map Grid", "GEOGCS": { + "type": "GEOGCS", "name": "NZGD49", "DATUM": { "name": "New_Zealand_Geodetic_Datum_1949", @@ -41,7 +42,25 @@ }, "AUTHORITY": { "EPSG": "4272" - } + }, + "title": "EPSG:4272", + "projName": "longlat", + "units": "degree", + "to_meter": 111323.87156969598, + "datumCode": "nzgd49", + "ellps": "intl", + "a": 6378388, + "rf": 297, + "datum_params": [ + 59.47, + -5.04, + 187.44, + 0.47, + -0.1, + 1.024, + -4.5993 + ], + "srsCode": "NZGD49" }, "UNIT": { "name": "metre", @@ -89,6 +108,7 @@ "type": "PROJCS", "name": "NAD83 / Massachusetts Mainland", "GEOGCS": { + "type": "GEOGCS", "name": "NAD83", "DATUM": { "name": "North_American_Datum_1983", @@ -120,7 +140,16 @@ }, "AUTHORITY": { "EPSG": "4269" - } + }, + "title": "4269", + "projName": "longlat", + "units": "degree", + "to_meter": 111319.49079327348, + "datumCode": "north_american_datum_1983", + "ellps": "GRS 1980", + "a": 6378137, + "rf": 298.257222101, + "srsCode": "NAD83" }, "UNIT": { "name": "metre",