-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Axis order not correctly extracted from EPSG:4326 #28
Comments
proj4js does not really make use of the axis property, unless you use it like described here. Is that what you're doing? If so, would you be able to sumit a pull request to add support for axis in wkt-parser? |
I can do it by relaxing the check like this: diff --git a/index.js b/index.js
index 7cd2316..bc186b2 100644
--- a/index.js
+++ b/index.js
@@ -36,13 +36,13 @@ function cleanWKT(wkt) {
var axisOrder = '';
for (var i = 0, ii = wkt.AXIS.length; i < ii; ++i) {
var axis = [wkt.AXIS[i][0].toLowerCase(), wkt.AXIS[i][1].toLowerCase()];
- if (axis[0].indexOf('north') !== -1 || ((axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'north')) {
+ if (axis[0].indexOf('north') !== -1 || ((axis[0] === 'y' || axis[0].indexOf('lat') !== -1) && axis[1] === 'north')) {
axisOrder += 'n';
- } else if (axis[0].indexOf('south') !== -1 || ((axis[0] === 'y' || axis[0] === 'lat') && axis[1] === 'south')) {
+ } else if (axis[0].indexOf('south') !== -1 || ((axis[0] === 'y' || axis[0].indexOf('lat') !== -1) && axis[1] === 'south')) {
axisOrder += 's';
- } else if (axis[0].indexOf('east') !== -1 || ((axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'east')) {
+ } else if (axis[0].indexOf('east') !== -1 || ((axis[0] === 'x' || axis[0].indexOf('lon') !== -1) && axis[1] === 'east')) {
axisOrder += 'e';
- } else if (axis[0].indexOf('west') !== -1 || ((axis[0] === 'x' || axis[0] === 'lon') && axis[1] === 'west')) {
+ } else if (axis[0].indexOf('west') !== -1 || ((axis[0] === 'x' || axis[0].indexOf('lon') !== -1) && axis[1] === 'west')) {
axisOrder += 'w';
}
} or by entirely removing the but the question is why the code is done like it is now |
I'd rather do |
using this definition from gdalsrsinfo:
we can see the axis order is NE (lat/long) however wkt-parser fails to extract it:
the missing
axis
key then later on lets proj4js setaxis: 'enu'
https://github.com/proj4js/proj4js/blob/a8bdc85b7c5804d0c05d99c95a8c165287c3c362/lib/Proj.js#L38
resulting in a mess
The text was updated successfully, but these errors were encountered: