Skip to content

Commit

Permalink
Merge pull request #29 from ftoromanoff/addTitleInProjDef
Browse files Browse the repository at this point in the history
add ProjectionDefinition.title from wkt.AUTHORITY
  • Loading branch information
ahocevar authored Oct 11, 2024
2 parents dde7c45 + d2c679c commit d61e880
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
6 changes: 6 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ function d2r(input) {
}

function cleanWKT(wkt) {
if (wkt.AUTHORITY) {
var authority = Object.keys(wkt.AUTHORITY)[0];
if (authority && authority in wkt.AUTHORITY) {
wkt.title = `${authority}:${wkt.AUTHORITY[authority]}`;
}
}
if (wkt.type === 'GEOGCS') {
wkt.projName = 'longlat';
} else if (wkt.type === 'LOCAL_CS') {
Expand Down
5 changes: 5 additions & 0 deletions test-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
["Easting", "EAST"],
["Northing", "NORTH"]
],
"title": "EPSG:27200",
"projName": "New_Zealand_Map_Grid",
"units": "meter",
"to_meter": 1,
Expand Down Expand Up @@ -142,6 +143,7 @@
["X", "EAST"],
["Y", "NORTH"]
],
"title": "EPSG:26986",
"projName": "Lambert_Conformal_Conic_2SP",
"units": "meter",
"to_meter": 1,
Expand Down Expand Up @@ -222,6 +224,7 @@
"NORTH"
]
],
"title": "EPSG:3035",
"projName": "Lambert_Azimuthal_Equal_Area",
"axis": "enu",
"units": "meter",
Expand Down Expand Up @@ -283,6 +286,7 @@
"AUTHORITY": {
"EPSG": "4258"
},
"title": "EPSG:4258",
"projName": "longlat",
"units": "degree",
"to_meter": 111319.4907932736,
Expand Down Expand Up @@ -454,6 +458,7 @@
"UNKNOWN"
]
],
"title": "EPSG:3031",
"projName": "Polar_Stereographic",
"axis": "enu",
"units": "meter",
Expand Down

0 comments on commit d61e880

Please sign in to comment.