Skip to content

Accept Datum and Ellipsoid objects for CRS datum= and ellps= constructor params #389

@zackw

Description

@zackw

Suppose you have a standard lon/lat CRS, e.g.

>>> wgs84_crs = pyproj.CRS("epsg:4326")

and you want to create a projected CRS with the same datum. The most obvious way to do that would be to use the 'datum' property of the first CRS as the 'datum' argument to the CRS constructor, but that doesn't work:

>>> aeqd_crs = pyproj.CRS(proj="aeqd", lon_0=-80, lat_0=40.5,
...                       datum=wgs84_crs.datum)
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/lib/python3/dist-packages/pyproj/crs.py", line 304, in __init__
    super(CRS, self).__init__(projstring)
  File "pyproj/_crs.pyx", line 1312, in pyproj._crs._CRS.__init__
pyproj.exceptions.CRSError: Invalid projection:
    +proj=aeqd +lon_0=-80 +lat_0=40.5 +datum=World Geodetic System 1984 +type=crs:
    (Internal Proj Error: proj_create: Error -9: unknown elliptical parameter name)

Can you make that work, please? Also for the 'ellps' argument and Ellipsoids.

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalIdea for a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions