Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Make datum name match exact in query_utm_crs_info #887

Merged
merged 1 commit into from
Aug 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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