stac-utils / stactools

Command line utility and Python library for STAC
https://stactools.readthedocs.io/
Other
104 stars 28 forks source link

RasterFootprint with antimeridian-spanning sentinel-1 image gives incorrect and odd footprint #425

Open philvarner opened 1 year ago

philvarner commented 1 year ago

Describe the bug

Using RasterFootprint with a sentinel-1 image that crosses the antimeridian gives an incorrect and odd footprint.

To reproduce

See attached script, and the 3 files it generates. This produces a geojson that looks like:

image

Then splitting it with either the stactools antimeridian package or gadomski/antimeridian give inverted results.

Expected behavior

RasterFootprint gives me a correct geometry over the raster.

Additional context

repro.py.txt

bad_footprint_split_with_antimeridian.geojson.txt bad_footprint_split_with_stactools_antimeridian.geojson.txt bad_footprint.geojson.txt

gadomski commented 1 year ago

Might be fixed once #421 is done, so I'll do #421 first and then take a look at the repro. Thanks for the report.

philvarner commented 1 year ago

I ran it without the scaling also, and got the same result.

with WarpedVRT(src) as vrt:
                    return RasterFootprint(
                    vrt.read(1),
                    vrt.crs,
                    vrt.transform,
                    no_data=0,
                    simplify_tolerance=simplify_tolerance,
                ).footprint()