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

Bugfix raster.set_crs #659

Merged
merged 2 commits into from
Nov 21, 2023
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ The format is based on `Keep a Changelog`_, and this project adheres to
Unreleased
==========

Added
-----

Changed
-------

Fixed
-----
- Bug in `raster.set_crs` if input_crs is of type CRS. (#659)

Deprecated
----------

v0.9.1 (2023-11-16)
===================
This release contains several bugfixes to 0.9.0 as well two new CLI methods and support for STAC.

Added
-----
- Support for exporting data catalogs to STAC catalog formats. (#617)
Expand All @@ -30,9 +47,6 @@ Fixed
- Bug in zoom level detection in `RasterDatasetAdapter` for Tifs without overviews and paths with placeholders. (#642)
- Bug in gis_utils.meridian_offset for grids with rounding errors. (#649)

Deprecated
----------

v0.9.0 (2023-10-19)
===================
This release contains several new features, here we highlight a few:
Expand Down
2 changes: 1 addition & 1 deletion hydromt/raster.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ def set_crs(self, input_crs=None, write_crs=True) -> CRS:
# look in grid_mapping and data variable attributes
elif input_crs is not None and not isinstance(input_crs, CRS):
raise ValueError(f"Invalid CRS type: {type(input_crs)}")
else:
elif not isinstance(input_crs, CRS):
crs = None
for name in crs_names:
# check default > GEO_MAP_COORDS attrs, then global attrs
Expand Down
1 change: 1 addition & 0 deletions tests/test_vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ def test_vector(geoda, geodf):
da1 = geoda.vector.to_crs(3857)
gdf1 = geodf.to_crs(3857)
assert np.all(da1.vector.geometry == gdf1.geometry)
assert da1.vector.crs == gdf1.crs


def test_from_gdf(geoda, geodf):
Expand Down