question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incorrect result and unable to build PROJ string for MGA 55 to WGS 84 transform in pyproj v3.1

See original GitHub issue

I’m getting different results between PyProj v3.0.1 and v3.1 for the MGA 55 (EPSG 28355) to WGS 84 (EPSG 4326) transformation; in addition, the transformer in v3.1 can’t produce a PROJ string

I feel like this is an issue with PROJ v8

Code sample

import pyproj
t = pyproj.Transformer.from_crs("epsg:28355", "epsg:4326")
print(repr(t))
print(str(t))
print(t.transform(800000,6000000))

Problem description

The output from PyProj v3.1 is incorrect (as far as I can tell)

Expected output

Output from PyProj v3.0.1

<Concatenated Operation Transformer: pipeline>
Description: Inverse of Map Grid of Australia zone 55 + GDA94 to WGS 84 (1)
Area of Use:
- name: Australia including Lord Howe Island, Macquarie Islands, Ashmore and Cartier Islands, Christmas Island, Cocos (Keeling) Islands, Norfolk Island. All onshore and offshore.
- bounds: (93.41, -60.56, 173.35, -8.47)

proj=pipeline step inv proj=utm zone=55 south ellps=GRS80 step proj=unitconvert xy_in=rad xy_out=deg step proj=axisswap order=2,1

(-36.098349196454585, 150.33217717123762)

Actual output

Output from PyProj v3.1

<Unknown Transformer: unknown>
Description: unavailable until proj_trans is called
Area of Use:
- undefined

unavailable until proj_trans is called

(-36.09833644723916, 150.33218243077053)

Environment information

PyProj v3.1
  • pyproj version: 3.1.0
  • PROJ version: 8.0.1
  • PROJ data directory: /media/linux-data/venvs/eggs/lib/python3.8/site-packages/pyproj/proj_dir/share/proj
PyProj v3.0.1
  • pyproj version: 3.0.1
  • PROJ version: 7.2.1
  • PROJ data directory: /media/linux-data/venvs/spam/lib/python3.8/site-packages/pyproj/proj_dir/share/proj
Common
  • Python version: 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]
  • Operation System Information: Linux-5.11.0-38-generic-x86_64-with-glibc2.29

Installation method

pip wheel

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
onewhaleidcommented, Dec 1, 2021

I believe this issue is related to changes in the Geocentric Datum of Australia (GDA94 -> GDA2020). There is more information available here: https://www.spatial.nsw.gov.au/surveying/geodesy/gda2020

The specific issue with transformations to and from WGS84 is discussed here: https://www.spatial.nsw.gov.au/__data/assets/pdf_file/0008/224396/WGS84_and_Australias_misaligned_web-maps_Information_Sheet.pdf

1reaction
snowman2commented, Nov 19, 2021

@EpicWink, I am going to close this as I think the issue has been resolved.

If you want to ensure a specific operation is used instead of relying on the order determined by PROJ, you can always use Transformer.from_pipeline:

>>> tr = Transformer.from_pipeline("+proj=pipeline +step +inv +proj=utm +zone=55 +south +ellps=GRS80 +step +proj=unitconvert +xy_in=rad +xy_out=deg +step +proj=axisswap +order=2,1")
>>> tr.transform(800000, 6000000)
(-36.098349196454585, 150.33217717123762)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Transformer - pyproj 3.4.1.dev1 documentation - GitHub Pages
Transformer#. The pyproj.Transformer has the capabilities of performing 2D, 3D, and 4D (time) transformations. It can do anything that the PROJ command line ......
Read more >
Converting projected coordinates to lat/lon using Python
The simplest way to transform coordinates in Python is pyproj, i.e. the Python interface to PROJ.4 library. In fact: from pyproj import Proj...
Read more >
transforming to EPSG:31370 is wrong / inconsistent. · Issue #422
In the code sample I first transform to EU west, via both EPSG and proj.4 notation. Both give equal results, as expected. In...
Read more >
OSGeo/proj.4 - Gitter
What is wrong with this proj4 string based on the rotation and projection ... to ITRF2008 (1) + Conversion from WGS 84 (G1762)...
Read more >
Error creating Transformer from CRS: Source and target ...
I believe that the a and b parameters defined in your projection are in the incorrect units. They appear to be in kilometers...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found