Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ function setPropertiesFromWkt(wkt) {
geogcs = wkt;
}
if (geogcs) {
//if(wkt.GEOGCS.PRIMEM&&wkt.GEOGCS.PRIMEM.convert){
// wkt.from_greenwich=wkt.GEOGCS.PRIMEM.convert*D2R;
//}
if (geogcs.PRIMEM && geogcs.PRIMEM.convert) {
wkt.from_greenwich = d2r(geogcs.PRIMEM.convert);
}
if (geogcs.DATUM) {
wkt.datumCode = geogcs.DATUM.name.toLowerCase();
} else {
Expand Down
6 changes: 6 additions & 0 deletions test-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,7 @@
"x0": 600000,
"y0": 200000,
"longc": 0.12984522414316144,
"long0": 0.12984522414316144,
"lat0": 0.8194740686761227,
"alpha": 1.570796326794897,
"rectified_grid_angle": 1.570796326794897,
Expand All @@ -745,6 +746,7 @@
"x0": 600000,
"y0": 200000,
"longc": 0.12984522414316635,
"long0": 0.12984522414316635,
"lat0": 0.8194740686761263,
"alpha": 1.570796326794897,
"rectified_grid_angle": 1.570796326794897,
Expand All @@ -767,6 +769,7 @@
"x0": 600000,
"y0": 200000,
"longc": 0.1298452241431614,
"long0": 0.1298452241431614,
"lat0": 0.8194740686761226,
"alpha": 1.5707963267948966,
"rectified_grid_angle": 1.5707963267948966,
Expand All @@ -793,6 +796,7 @@
"x0": 600000,
"y0": 200000,
"longc": 0.12984522414316146,
"long0": 0.12984522414316146,
"lat0": 0.8194740686761218,
"alpha": 1.5707963267948966,
"rectified_grid_angle": 1.5707963267948966,
Expand Down Expand Up @@ -929,6 +933,7 @@
"x0": 804671,
"y0": 0,
"longc": 1.784599160164202,
"long0": 1.784599160164202,
"lat0": 0.06981317007977318,
"alpha": 5.637863717220397,
"rectified_grid_angle": 5.639684198507691,
Expand Down Expand Up @@ -1093,6 +1098,7 @@
"x0": 804671,
"y0": 0,
"longc": 1.784599160164202,
"long0": 1.784599160164202,
"lat0": 0.06981317007977318,
"alpha": 5.637863717220403,
"rectified_grid_angle": 5.63968419850769,
Expand Down
4 changes: 2 additions & 2 deletions util.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export function applyProjectionDefaults(wkt) {
// Normalize projName for WKT2 compatibility
const normalizedProjName = (wkt.projName || '').toLowerCase().replace(/_/g, ' ');

if (!wkt.long0 && wkt.longc && (normalizedProjName === 'albers conic equal area' || normalizedProjName === 'lambert azimuthal equal area')) {
wkt.long0 = wkt.longc;
if (wkt.long0 === undefined && wkt.longc !== undefined) {
wkt.long0 = wkt.longc; // keep in the projection's native prime meridian frame
}
if (!wkt.lat_ts && wkt.lat1 && (normalizedProjName === 'stereographic south pole' || normalizedProjName === 'polar stereographic (variant b)')) {
wkt.lat0 = d2r(wkt.lat1 > 0 ? 90 : -90);
Expand Down
Loading