diff --git a/CHANGELOG.md b/CHANGELOG.md index e1656cea0..d9149839d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ ## [Unreleased] - ### Added - Top-level `item_assets` dict on `Collection`s ([#1476](https://github.com/stac-utils/pystac/pull/1476)) @@ -14,6 +13,10 @@ - Correctly detect absolute file path ref on windows, reflecting change in python 3.13 ([#1475](https://github.com/stac-utils/pystac/pull/14750)) (only effects python 3.13) - Deprecated `ItemAssetExtension` ([#1476](https://github.com/stac-utils/pystac/pull/1476)) +### Fixed + +- Use `application/geo+json` for `item` links ([#1495](https://github.com/stac-utils/pystac/pull/1495)) + ## [v1.11.0] - 2024-09-26 ### Added diff --git a/pystac/link.py b/pystac/link.py index f88061090..2459c7452 100644 --- a/pystac/link.py +++ b/pystac/link.py @@ -475,7 +475,7 @@ def child(cls: type[L], c: Catalog, title: str | None = None) -> L: def item(cls: type[L], item: Item, title: str | None = None) -> L: """Creates a link to an Item.""" return cls( - pystac.RelType.ITEM, item, title=title, media_type=pystac.MediaType.JSON + pystac.RelType.ITEM, item, title=title, media_type=pystac.MediaType.GEOJSON ) @classmethod diff --git a/tests/test_link.py b/tests/test_link.py index c7ecdb6cc..0461a2598 100644 --- a/tests/test_link.py +++ b/tests/test_link.py @@ -346,3 +346,9 @@ def test_is_hierarchical(rel: str) -> None: ) def test_is_not_hierarchical(rel: str) -> None: assert not Link(rel, "a-target").is_hierarchical() + + +def test_item_link_type(item: Item) -> None: + # https://github.com/stac-utils/pystac/issues/1494 + link = Link.item(item) + assert link.media_type == "application/geo+json"