Comments (5)
I tried to replicate this on the command line with cs2cs:
$ cs2cs -f "%.14f" +proj=latlong +datum=WGS84 +to +proj=latlong +datum=NAD27
-127.9 50.98
-127.89840687790534 50.98018566035922 0.00000000000000
$ cs2cs -f "%.14f" +proj=latlong +datum=NAD27 +to +proj=latlong +datum=WGS84
-127.89840687790534 50.98018566035922
-127.90000000000006 50.98000000000003 0.00000000000000
The round trip result was -127.90000000000006 50.98000000000003
. Those right-most digits are simply the limits of 64-bit double math.
I used pyproj.Geod for the distance calculation and got: 6.0880917533296244e-09 meters. Close enough to your last result.
This bug could be problematic.
from pyproj.
That is (kind of) good news.
What else can I do to figure out what is causing this?
from pyproj.
Sorry, I didn't replicated your example fully. Here is the version with the error. Using -128.0 longitude.
C:\...>cs2cs -f "%.14f" +proj=latlong +datum=WGS84 +to +proj=latlong +datum=NAD27
-128.0 50.98
-127.99845565740137 50.98025249402806 0.00000000000000
C:\...>cs2cs -I -f "%.14f" +proj=latlong +datum=WGS84 +to +proj=latlong +datum=NAD27
# Inverse of last
-127.99845565740137 50.98025249402806
-128.00005191895048 50.98006355013496 0.00000000000000
And the distance calculation:
>>> from pyproj import Geod
>>> wgs84_geod = Geod(ellps='WGS84')
>>> angle1, angle2, distance = wgs84_geod.inv(-128.0, 50.98, -128.00005191895048, 50.98006355013496)
>>> distance
7.954670001528683
That is similar to your results, about 8 meters off.
Base on that I don't think pyproj is at fault, it is just using what the underlying PROJ.4 C library is giving it. Please report this issue to proj.4.
from pyproj.
Sorry.
I didn't notice that you were using -127.9
in your tests.
From my local tests I already noticed that some values around -128.0 don't trigger the issue.
Examples:
-127.9
doesn't trigger the issue.-127.99
doesn't trigger the issue.-127.999
doesn't trigger the issue.-127.999999
doesn't trigger the issue.-127.99999999999
doesn't trigger the issue.-127.999999999999
triggers the issue.-128.0
triggers the issue.-128.001
triggers the issue.-128.01
doesn't trigger the issue.-128.1
doesn't trigger the issue.
from pyproj.
This seems to be an issue of OSGeo/proj.4. Reported here.
Closing.
from pyproj.
Related Issues (20)
- Functions of `loxodrome` or `rhumb line` is needed HOT 6
- Help with PROJ 9.3 CRS comparison issue HOT 26
- Request: release a patch version that pins cython<3.0 HOT 24
- error installl pyproj==3.2.1 on debian:12 HOT 3
- UserWarning: Valid PROJ data directory not found HOT 16
- What happened to the `pyproj/aoi.py` module in releases? HOT 1
- Deprecation warning when transforming a single point enclosed in numpy array HOT 1
- LibTiff Vulnerabilities and Dependencies HOT 4
- DOC: Converting from fiona CRS to pyproj.crs.CRS HOT 7
- Add JSON serializeability with PROJJSON? HOT 7
- to_CF for polar_stereographic, with latitude_true_scale, should include latitude_of_projection_origin HOT 2
- Reverse transformation does not produce initial coordinates
- 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
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.