stactools-packages / landsat

stactools package for working with LANDSAT data
Other
4 stars 6 forks source link

Antimeridian Failure #29

Closed pjhartzell closed 2 years ago

pjhartzell commented 2 years ago

Describe the bug If the Item geometry is "already" split along the antimeridian (which can be the case when using the USGS geometry), application of the stactools antimeridian utility function antimeridian.fix_item fails since it does not handle MultiPolygons.

To reproduce Call create_stac_item with an href to a scene that spans the antimeridian, legacy_l8=False, and use_usgs_geometry=True for a case where the USGS geometry is already split along the antimeridian. An example scene is LT05_L2SR_087017_20090621_20200827_02_T2.

Expected behavior create_stac_item does not fail in above case.

Screenshots and shell session dumps

File "/Users/pjh/miniconda3/envs/stactools-landsat/lib/python3.10/site-packages/stactools/core/utils/antimeridian.py", line 32, in fix_item
    raise ValueError(
ValueError: Can only fix antimeridian issues for Polygons, geometry=MULTIPOLYGON (((180 61.09289443379927, 179.90517236107144 60.95119752303177, 180 60.93687820884834, 180 61.09289443379927)), ((-180 60.93687820884834, -176.7016565170453 60.43881649233896, -175.51498801955913 61.95528671380596, -179.06386088310478 62.491727331163695, -180 61.09289443379927, -180 60.93687820884834)))