Skip to content

Commit

Permalink
BUG: Make datum name match exact in query_utm_crs_info (#887)
Browse files Browse the repository at this point in the history
  • Loading branch information
snowman2 committed Aug 4, 2021
1 parent aeb1e62 commit b4bfaa1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Latest
- BUG: Fix spelling for
:class:`pyproj.crs.coordinate_operation.AzimuthalEquidistantConversion`
and :class:`pyproj.crs.coordinate_operation.LambertAzimuthalEqualAreaConversion` (issue #882)
- BUG: Make datum name match exact in :func:`pyproj.database.query_utm_crs_info` (pull #887)

3.1.0
-----
Expand Down
5 changes: 4 additions & 1 deletion pyproj/database.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,10 @@ def query_utm_crs_info(
if datum_name is None:
return utm_crs
datum_name = datum_name.replace(" ", "")
return [crs for crs in utm_crs if datum_name in crs.name.replace(" ", "")]
return [
crs for crs in utm_crs
if datum_name == crs.name.split("/")[0].replace(" ", "")
]


Unit = namedtuple(
Expand Down
2 changes: 1 addition & 1 deletion test/test_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ def test_query_crs_info__aoi_contains():
assert not crs_info.deprecated


@pytest.mark.parametrize("datum_name", ["WGS 84", "WGS84", "NAD27"])
@pytest.mark.parametrize("datum_name", ["WGS 84", "WGS84", "NAD27", "NAD83"])
def test_query_utm_crs_info__aoi_datum_name(datum_name):
aoi = BBox(west=-93.581543, south=42.032974, east=-93.581543, north=42.032974)
crs_info_list = query_utm_crs_info(
Expand Down

0 comments on commit b4bfaa1

Please sign in to comment.