Skip to content

Commit

Permalink
Less datum code modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ahocevar committed Oct 28, 2024
1 parent e1c270c commit 87ff240
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
10 changes: 2 additions & 8 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand All @@ -115,13 +115,7 @@ 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 (geogcs.DATUM && geogcs.DATUM.SPHEROID) {
Expand Down
4 changes: 2 additions & 2 deletions test-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"projName": "longlat",
"units": "degree",
"to_meter": 111323.87156969598,
"datumCode": "nzgd49",
"datumCode": "new_zealand_geodetic_datum_1949",
"ellps": "intl",
"a": 6378388,
"rf": 297,
Expand Down Expand Up @@ -85,7 +85,7 @@
"projName": "New_Zealand_Map_Grid",
"units": "meter",
"to_meter": 1,
"datumCode": "nzgd49",
"datumCode": "new_zealand_geodetic_datum_1949",
"datum_params": [
59.47, -5.04,
187.44, 0.47,
Expand Down

0 comments on commit 87ff240

Please sign in to comment.