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.

+R_A appears to have no effect in Geod() and CRS()

See original GitHub issue

Problem description

The +R_A option is not being honored in Pyproj, whereas it seems to work fine using the geod CLI tool.

This problem happens if I use pyproj.Geod() or pyproj.CRS().get_geod().

Code sample

My Python code:

import logging
import os

os.environ['PROJ_DEBUG'] = '3'
logging.basicConfig(level=logging.DEBUG)

import pyproj
# DEBUG:pyproj:PROJ_DEBUG: pj_open_lib(proj.ini): call fopen(/.../lib/python3.10/site-packages/pyproj/proj_dir/share/proj/proj.ini) - succeeded

geod1 = pyproj.Geod('+proj=lonlat +ellps=WGS84')
print(geod1.f)
# 0.0033528106647474805
geod1.fwd(-70, 40, 60, 10_000)
# (-69.89851793919364, 40.04498640681145, -119.93473805953444)

geod2 = pyproj.Geod('+proj=lonlat +ellps=WGS84 +R_A')
print(geod2.f)
# 0.0033528106647474805
geod2.fwd(-70, 40, 60, 10_000)
# (-69.89851793919364, 40.04498640681145, -119.93473805953444)

Equivalent CLI invocation using geod:

export PROJ_DEBUG=3

geod -f '%0.4f' +proj=lonlat +ellps=WGS84 <<< '-70E 40N 60d 10000m'
# pj_ellipsoid - final: a=6378137.000 f=1/298.257, errno=0
# pj_ellipsoid - final:    ellps=WGS84
# 70.0447	40.2273	-119.7864m

geod -f '%0.4f' +proj=lonlat +ellps=WGS84 +R_A <<< '-70E 40N 60d 10000m'
# pj_ellipsoid - final: a=6371007.181 f=1/  0.000, errno=0
# pj_ellipsoid - final:   R_A ellps=WGS84
# 70.0448	40.2282	-119.7855m

Expected Output

I expected the output from geod1 to be different from geod2, and that geod2.f should be 0.

I was also surprised to see that the output from the geod command line tool was different from the output from pyproj.Geod.fwd. Presumably the difference can be ascribed to different options when compiling the CLI tool (installed via MacPorts) and the Python package (installed via the wheels on PyPI).

I further expected to see “trace” logging output comparable to what the geod CLI tool emitted, but I suppose that’s a separate issue.

Environment Information

MacOS 12.4 on ARM64.

Versions

pyproj info:
    pyproj: 3.4.0
      PROJ: 9.1.0
  data dir: /.../lib/python3.10/site-packages/pyproj/proj_dir/share/proj
user_data_dir: /.../.local/share/proj
PROJ DATA (recommended version): 1.11
PROJ Database: 1.2
EPSG Database: v10.074 [2022-08-01]
ESRI Database: ArcGIS Pro 3.0 [2022-07-09]
IGNF Database: 3.1.0 [2019-05-24]

System:
    python: 3.10.6 (main, Sep 19 2022, 14:40:49) [Clang 13.1.6 (clang-1316.0.21.2.5)]
executable: /.../bin/python
   machine: macOS-12.4-arm64-arm-64bit

Python deps:
   certifi: 2022.9.14
    Cython: None
setuptools: 65.4.1
       pip: 22.2.2

Installation method

Installed using Pip in a Venv:

python -m venv venv
./venv/bin/pip install -U pyproj

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gwerbin-tivecommented, Oct 4, 2022

Thanks @snowman2, I’ll see about asking on their mailing list or issue tracker.

0reactions
gwerbin-tivecommented, Oct 4, 2022

Oops sorry, I meant to leave this open as an enhancement request for R_A in Geod!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to extract CRS ellipsiod info in correct format for pyproj ...
I am using pyproj inverse transform to add azimuth and distance "info" to an ordered geodataframe ( gdf ) ...
Read more >
Rearing cattle produces more greenhouse gases than driving ...
Rearing cattle produces more greenhouse gases than driving cars, UN report warns.
Read more >
Geod - pyproj 3.4.1 documentation
The forward computation (using the 'fwd' method) involves determining latitude, longitude and back azimuth of a terminus point given the latitude and longitude ......
Read more >
astro - CfA Harvard
IMCONTOUR - Contour plots with astronomical labeling (either RA,Dec or arc distance from the image center IMF() - Return values for a multi-component...
Read more >
MECHANICS OF WHEEL/ RAIL NOISE GENERATION - ROSA P
W HE E L / RA I L NO I SEA N D V I B RA TIC' N • ... the predictions...
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