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

Fix for is_empty vs non-empty area. #548

Merged
merged 1 commit into from
Oct 21, 2024
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
2 changes: 1 addition & 1 deletion sentinelhub/areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ def _make_split(self) -> tuple[list[BBox], list[dict[str, object]]]:
geo_object for geo_object in intersection if isinstance(geo_object, (Polygon, MultiPolygon))
)

if not intersection.is_empty:
if intersection.area > 0:
intersection = Geometry(intersection, CRS.WGS84).transform(utm_crs)

bbox_partition = self._align_bbox_to_size(intersection.bbox).get_partition(size_x=size_x, size_y=size_y)
Expand Down
1 change: 1 addition & 0 deletions tests/test_areas.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
(UtmGridSplitter, ([AREA], CRS.WGS84), dict(bbox_size=(1200, 1200)), 16),
(UtmZoneSplitter, ([AREA], CRS.WGS84), dict(bbox_size=(1000, 1000)), 19),
(UtmZoneSplitter, ([AREA], CRS.WGS84), dict(bbox_size=(1000, 1000), offset=(500, 500)), 21),
(UtmZoneSplitter, ([shapely.box(0, 0, 1, 1)], CRS.WGS84), dict(bbox_size=(10000, 10000)), 144),
pytest.param(
TileSplitter,
([AREA], CRS.WGS84, ("2017-10-01", "2018-03-01")),
Expand Down
Loading