Skip to content
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

Swapped X and Y coordinates when reading shapefiles #176

Open
Dave-Allured opened this issue Oct 31, 2021 · 2 comments
Open

Swapped X and Y coordinates when reading shapefiles #176

Dave-Allured opened this issue Oct 31, 2021 · 2 comments

Comments

@Dave-Allured
Copy link
Contributor

There are several reports of swapped X and Y coordinates (longitudes and latitudes) when reading shapefiles. The main symptom is usually missing shapes on a map plot, such as state and country outlines. Sometimes the symptom is shapes plotted on a different part of the earth's surface, and rotated or flipped (the pattern is predictable). There also may be console messages about invalid coordinates.

Affected versions seem to be the latest release, NCL 6.6.2, and recent Conda builds from late 2020 onward. Besides Conda, other recent packager builds may also be affected. This problem is likely to affect all platforms and OS versions.

The cause is speculated to be a change in recent versions of underlying geography support libraries, GDAL in particular. Package managers such as Conda and Macports try to keep updated with the latest library releases. This can cause a behavioral change like this in a downloaded package, even when the NCL version number stays the same.

There is a possible temporary workaround by modifying the support file shapefile_utils.ncl to swap the X and Y coordinates. Please try this modified version: shapefile_utils.ncl.txt. Load this version in your main program, instead of the standard version from the NCL website.

This workaround was first suggested by Kathleen Holman on 2021 January 25 .

I created this Github issue as a place to share further research on this problem. Please feel free to add more problem reports and related information, such as platform, relevant library versions, dylib/so identifiers, and possible solutions.

@Dave-Allured
Copy link
Contributor Author

There is more specific information in issue #151.

@Dave-Allured
Copy link
Contributor Author

The cause is tentatively identified as the GDAL library update from version 2.4.x to 3.0.0 on 2019 May 5. A patch is needed for NCL source code. Please see #151 for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant