From 2f92f5a880b89cad0cf35344d47857d1c7f8f77a Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Mon, 28 Oct 2024 17:21:00 +0100 Subject: [PATCH] Less datum code modifications --- index.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/index.js b/index.js index ba1c6c7..49625ea 100644 --- a/index.js +++ b/index.js @@ -106,7 +106,7 @@ function setPropertiesFromWkt(wkt) { if (wkt.datumCode.slice(0, 2) === 'd_') { wkt.datumCode = wkt.datumCode.slice(2); } - if (wkt.datumCode === 'new_zealand_geodetic_datum_1949' || wkt.datumCode === 'new_zealand_1949') { + if (wkt.datumCode === 'new_zealand_1949') { wkt.datumCode = 'nzgd49'; } if (wkt.datumCode === 'wgs_1984' || wkt.datumCode === 'world_geodetic_system_1984') { @@ -115,15 +115,12 @@ function setPropertiesFromWkt(wkt) { } wkt.datumCode = 'wgs84'; } - if (wkt.datumCode.slice(-6) === '_ferro') { - wkt.datumCode = wkt.datumCode.slice(0, - 6); - } - if (wkt.datumCode.slice(-8) === '_jakarta') { - wkt.datumCode = wkt.datumCode.slice(0, - 8); - } - if (~wkt.datumCode.indexOf('belge')) { + if (wkt.datumCode === 'belge_1972') { wkt.datumCode = 'rnb72'; } + if (wkt.datumCode === 'osgb_1936') { + wkt.datumCode = 'osgb36'; + } if (geogcs.DATUM && geogcs.DATUM.SPHEROID) { wkt.ellps = geogcs.DATUM.SPHEROID.name.replace('_19', '').replace(/[Cc]larke\_18/, 'clrk'); if (wkt.ellps.toLowerCase().slice(0, 13) === 'international') {