Skip to content

Commit

Permalink
parse SubCrs as Crs
Browse files Browse the repository at this point in the history
  • Loading branch information
ftoromanoff committed Oct 9, 2024
1 parent 4da07da commit 54a80c3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ function d2r(input) {
}

function cleanWKT(wkt) {
Object.keys(wkt).forEach(key => {
if (['PROJECTEDCRS', 'PROJCRS', 'GEOGCS', 'GEOCCS', 'PROJCS', 'LOCAL_CS', 'GEODCRS', 'GEODETICCRS',
'GEODETICDATUM', 'EDATUM', 'ENGINEERINGDATUM', 'VERT_CS', 'VERTCRS', 'VERTICALCRS', 'COMPD_CS',
'COMPOUNDCRS', 'ENGINEERINGCRS', 'ENGCRS', 'FITTED_CS', 'LOCAL_DATUM', 'DATUM'].includes(key)) {
cleanWKT(wkt[key]);
};
})
if (wkt.type === 'GEOGCS') {
wkt.projName = 'longlat';
} else if (wkt.type === 'LOCAL_CS') {
Expand Down
1 change: 1 addition & 0 deletions process.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function mapit(obj, key, value) {
}, thing);
if (key) {
obj[key] = out;
obj[key].type = key;
}
}

Expand Down

0 comments on commit 54a80c3

Please sign in to comment.