diff --git a/CHANGELOG.md b/CHANGELOG.md index 25b3216..9b90cbf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +## [0.4.1] - 2023-04-14 + +### Changed + +- Round `proj:centroid` values to one decimal place, since they'll always be in 0.5 degree increments([#28](https://github.com/stactools-packages/cop-dem/pull/28)) + ## [0.4.0] - 2023-04-14 ## Added @@ -48,7 +54,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - remove python 3.7 support -[Unreleased]: https://github.com/stactools-packages/cop-dem/compare/v0.4.0..main +[Unreleased]: https://github.com/stactools-packages/cop-dem/compare/v0.4.1..main +[0.4.1]: https://github.com/stactools-packages/cop-dem/compare/v0.4.0..v0.4.1 [0.4.0]: https://github.com/stactools-packages/cop-dem/compare/v0.3.0..v0.4.0 [0.3.0]: https://github.com/stactools-packages/cop-dem/compare/v0.2.0..v0.3.0 [0.2.0]: https://github.com/stactools-packages/cop-dem/compare/v0.1.1..v0.2.0 diff --git a/setup.cfg b/setup.cfg index 615c4d9..2652e5f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -32,7 +32,7 @@ package_dir = = src packages = find_namespace: install_requires = - stactools[s3] >= 0.4.0 + stactools[s3] >= 0.4.1 [options.packages.find] where = src diff --git a/src/stactools/cop_dem/__init__.py b/src/stactools/cop_dem/__init__.py index cf6a307..493c4ea 100644 --- a/src/stactools/cop_dem/__init__.py +++ b/src/stactools/cop_dem/__init__.py @@ -8,4 +8,4 @@ def register_plugin(registry): registry.register_subcommand(commands.create_cop_dem_command) -__version__ = "0.4.0" +__version__ = "0.4.1" diff --git a/src/stactools/cop_dem/stac.py b/src/stactools/cop_dem/stac.py index 00a0702..1c16324 100644 --- a/src/stactools/cop_dem/stac.py +++ b/src/stactools/cop_dem/stac.py @@ -114,7 +114,10 @@ def create_item( projection.shape = shape centroid = make_shape(item.geometry).centroid - projection.centroid = {"lat": centroid.y, "lon": centroid.x} + projection.centroid = { + "lat": round(centroid.y, 1), + "lon": round(centroid.x, 1) + } grid = GridExtension.ext(item, add_if_missing=True) grid.code = f"CDEM-{northing}{easting}" diff --git a/tests/test_stac.py b/tests/test_stac.py index 3c1ed4d..8e24fda 100644 --- a/tests/test_stac.py +++ b/tests/test_stac.py @@ -126,8 +126,8 @@ def test_create_glo90_item(self): 0.00125, 0.0, -115.000625, 0.0, -0.0008333333333333334, 54.000416666666666 ]) - self.assertEqual(round(projection.centroid["lat"], 5), 53.50042) - self.assertEqual(round(projection.centroid["lon"], 5), -114.50062) + self.assertEqual(round(projection.centroid["lat"], 5), 53.5) + self.assertEqual(round(projection.centroid["lon"], 5), -114.5) grid = GridExtension.ext(item) self.assertEqual(grid.code, "CDEM-N53W115")