Skip to content

Commit 27766a2

Browse files
authored
Merge pull request #53 from opera-adt/dev
v1.0.6
2 parents a978a36 + 2242409 commit 27766a2

4 files changed

Lines changed: 34 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [PEP 440](https://www.python.org/dev/peps/pep-0440/)
77
and uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
88

9+
## [1.0.6] - 2025-10-09
10+
11+
### Added
12+
* Tests for MGRS tiles and burst geometries ensuring they overlap the antimeridian if and only if they are multipolygons.
13+
* Updated readme with information about these mgrs/burst geometries and the dateline.
14+
* Updated burst geometries using geopackage geometry from opera_adt/burst_db. See this issue: https://github.com/opera-adt/burst_db/issues/120 - some dateline geometries were cut off. The new geometries are larger and the table went from 24 MB to 37 MB. See this notebook: https://github.com/OPERA-Cal-Val/dist-s1-research/blob/dev/marshak/Zb_update_burst_table/Update%20Burst%20Geometries%20Using%20Geopackage.ipynb
15+
916
## [1.0.5] - 2025-09-29
1017

1118
### Fixed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,15 @@ There are two category of tests: unit tests and integration tests. The former ca
102102
The integration tests that are the most time consuming are represented by the notebooks and are run only upon a release PR.
103103
These notebook tests are tagged with `notebooks` and can be excluded from the other tests with `pytest tests -m 'not notebooks'`.
104104

105+
# Remarks about the Dateline/Dateline and Geometry
106+
107+
The antimeridian (or dateline) is the line at the -180 longitude mark that global CRS tiles are wrapped by standard global reference systems.
108+
The geometries of the bursts and the MGRS tiles in this package are all in `epsg:4326` (standard lon/lat).
109+
The geometries are all between -180 and 180 so those geometries that cross the antimeridian/dateline are generally wrapped.
110+
For MGRS tiles, the statement that a geometry overlaps the antimeridian occurs if and only if the geometry is a Polygon.
111+
The same is true for burst geometries.
112+
See `test_antimeridian_crossing` in [`tests/test_mgrs_burst_data.py`](tests/test_mgrs_burst_data.py).
113+
105114
# Contributing
106115

107116
We welcome contributions to this open-source package. To do so:
10.9 MB
Binary file not shown.

tests/test_mgrs_burst_data.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import pytest
2-
from shapely.geometry import Point
2+
from shapely.geometry import LineString, MultiPolygon, Point, Polygon
33

44
from dist_s1_enumerator.exceptions import NoMGRSCoverage
55
from dist_s1_enumerator.mgrs_burst_data import (
@@ -161,3 +161,20 @@ def test_all_bursts_in_lut() -> None:
161161
df_merged = df_bursts.merge(df_mgrs_lut, on='jpl_burst_id', indicator=True, how='left')
162162
burst_ids_not_in_lut = df_merged[df_merged['_merge'] == 'left_only'].jpl_burst_id.unique().tolist()
163163
assert len(burst_ids_not_in_lut) == 0
164+
165+
166+
def test_antimeridian_crossing() -> None:
167+
df_mgrs = get_mgrs_table()
168+
df_burst = get_burst_table()
169+
antimeridian_0 = LineString(coordinates=((-180, 90), (-180, -90))).buffer(0.00000001)
170+
antimeridian_1 = LineString(coordinates=((180, 90), (180, -90))).buffer(0.00000001)
171+
172+
for df in [df_mgrs, df_burst]:
173+
for antimeridian in [antimeridian_0, antimeridian_1]:
174+
ind_anti = df.geometry.intersects(antimeridian)
175+
df_antimerid = df[ind_anti].reset_index(drop=True)
176+
any_polygons = (df_antimerid.geometry.map(lambda geo: isinstance(geo, Polygon))).sum()
177+
assert any_polygons == 0
178+
df_antimerid_not = df[~ind_anti].reset_index(drop=True)
179+
any_multis = (df_antimerid_not.geometry.map(lambda geo: isinstance(geo, MultiPolygon))).sum()
180+
assert any_multis == 0

0 commit comments

Comments
 (0)