Comments (3)
This is not compliant to ISO 6709 (https://en.wikipedia.org/wiki/ISO_6709), which says that the order must always be "lat, lon"
That is an oversimplification. As you correctly quote the Wikipedia article:
Order, positive direction, and units of coordinates are supposed to be defined by the CRS.
Continuing:
When CRS identification is missing, the data must be interpreted by the following conventions: Latitude comes before longitude...`
I added emphasis to make my point. It is really a set of rules for how coordinate pairs are ordered. I would tend to think that the ordering of pairs would be for the storage and transmittal of coordinate pairs. I could see the point that this could also govern coordinate pairs for functions. I don't really know. This will make the code a bit more complicated. The underlying PROJ4 API's pj_transform() uses x, y, z.
PROJ4 as of version 4.8.0 supports a way to change axis order with the +axis parameter.
GDAL seems to have some support (and history) for switching Axis Order. I don't know of any other Python libraries that supports reordering parameters based on the CRS or use lat/long ordering for Geographic Coordinate System. There are Python libraries that don't know/care what CRS is being inputted.
Here is a way to get lat/long ordering for input. Output will always be lon/lat.
>>> from pyproj import Proj
>>> p = Proj(proj='utm',zone=10,ellps='WGS84')
# p(y=latitude, x=longitude)
>>> x,y = p(y=34.36116666, x=-120.108)
'x=765975.641 y=3805993.134'
All that being said, it would be great to have access to ISO 6709 to read what it actually says, but alas it is behind a paywall.
I think it could designed to switch coordinate ordering, but I think it should be designed to allows for backward compatibility of current coordinate ordering (x, y, z).
from pyproj.
I think the workaround @micahcochran provided is sufficient for this case. For backward compatibility sake, I think keeping it as is is probably better. If you have a backwards compatible solution and would like to continue the conversation, feel free to reopen.
from pyproj.
Apparently it was already swapped in the new version of PROJ for most projections. See #225.
from pyproj.
Related Issues (20)
- DeprecationWarning: pkg_resources is deprecated as an API. HOT 1
- Support for deprecated and non-deprecated objects HOT 3
- Invert lat lon "Transformer" HOT 1
- Internal Proj Error: proj_create: unrecognized format / unknown name HOT 4
- Inverted x/y for transformation from WSG84 to LV95 (EPSG:2056) HOT 3
- muslinux wheel missing HOT 1
- test_azimuthal_equidistant fails with PROJ 9.4.0 HOT 1
- test failure in test_crs_cf.py HOT 2
- Add proj_query_geodetic_crs_from_datum HOT 2
- 3.6.1: pytest fails in `test/crs/test_crs_cf.py::test_azimuthal_equidistant` unit HOT 1
- A question about pyproj/_datadir.pyx HOT 2
- geometry_area_perimeter limitations not documented HOT 1
- Calculate area of arbitrary polygon on Earth's surface HOT 4
- Interrupted Mollweide gives wrong result on inverse projections of some lat/lons. HOT 1
- test_datum__from_epsg fails with PROJ 9.4.1 HOT 4
- Proj4 export from a bound CRS object fails HOT 4
- Antipodes don't match when calculated numerically HOT 7
- Bad_alloc with pyroj import in QGIS plugin
- Conversion of array to scalar when transforming 1 element arrays leads to DeprecationWarning HOT 3
- Small memory leak HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyproj.