Skip to content

Commit

Permalink
Fix setting from_name with None as auth_name (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 authored Jan 17, 2020
1 parent e7f7e27 commit 0aacc28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproj/_crs.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ cdef PJ * _from_name(
PJ *
"""
cdef PJ_TYPE[1] pj_types = [pj_type]
cdef char* c_auth_name = NULL
if auth_name is not None:
b_auth_name = cstrencode(auth_name)
c_auth_name = b_auth_name
Expand Down
5 changes: 3 additions & 2 deletions test/test_crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -833,10 +833,11 @@ def test_datum__from_name(input_name):
assert dd.name == "World Geodetic System 1984"


def test_datum_from_name__auth_type():
@pytest.mark.parametrize("auth_name", [None, "ESRI"])
def test_datum_from_name__auth_type(auth_name):
dd = Datum.from_name(
"WGS_1984_Geoid",
auth_name="ESRI",
auth_name=auth_name,
datum_type=DatumType.VERTICAL_REFERENCE_FRAME,
)
assert dd.name == "WGS_1984_Geoid"
Expand Down

0 comments on commit 0aacc28

Please sign in to comment.