From c1710da6d42371b1c7f874e94c5e107d607637d3 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 15 Mar 2022 09:19:06 -0600 Subject: [PATCH 1/4] feat: add antimeridian support --- setup.cfg | 2 +- src/stactools/modis/constants.py | 7 +++ src/stactools/modis/stac.py | 25 ++++++-- ...2Q1.A2001001.h00v08.006.2018142182903.json | 62 +++++++++++++------ ...A2H.A2022025.h01v11.061.2022035062702.json | 62 +++++++++++++------ ...3GF.A2021001.h11v02.061.2022024075208.json | 62 +++++++++++++------ ...3A1.A2022009.h25v02.061.2022028071925.json | 62 +++++++++++++------ ...4A1.A2022025.h01v07.061.2022035001141.json | 62 +++++++++++++------ ...3GF.A2021001.h11v02.061.2022024220526.json | 62 +++++++++++++------ tests/test_stac.py | 13 ++++ 10 files changed, 305 insertions(+), 114 deletions(-) diff --git a/setup.cfg b/setup.cfg index a1a47603..3d86285f 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ packages = stactools.modis stactools.modis.fragments install_requires = - stactools >= 0.2.6 + stactools @ git+https://github.com/stac-utils/stactools@antimeridian [options.packages.find] where = src diff --git a/src/stactools/modis/constants.py b/src/stactools/modis/constants.py index e6e4b50d..fea80976 100644 --- a/src/stactools/modis/constants.py +++ b/src/stactools/modis/constants.py @@ -1,3 +1,5 @@ +from enum import Enum, auto + from pystac import MediaType HDF_ASSET_KEY = "hdf" @@ -13,3 +15,8 @@ "title": "FGDC Metdata" } TEMPORALLY_WEIGHTED_PRODUCTS = ["MCD43A4"] + + +class AntimeridianStrategy(Enum): + NORMALIZE = auto() + SPLIT = auto() diff --git a/src/stactools/modis/stac.py b/src/stactools/modis/stac.py index 91bcfb90..4dba1714 100644 --- a/src/stactools/modis/stac.py +++ b/src/stactools/modis/stac.py @@ -8,6 +8,7 @@ import rasterio import shapely.geometry import stactools.core.utils +import stactools.core.utils.antimeridian from pystac import Asset, Collection, Item, Summaries from pystac.extensions.eo import Band, EOExtension from pystac.extensions.item_assets import AssetDefinition, ItemAssetsExtension @@ -20,7 +21,8 @@ import stactools.modis.utils from stactools.modis.constants import (HDF_ASSET_KEY, HDF_ASSET_PROPERTIES, METADATA_ASSET_KEY, - METADATA_ASSET_PROPERTIES) + METADATA_ASSET_PROPERTIES, + AntimeridianStrategy) from stactools.modis.file import File from stactools.modis.metadata import Metadata from stactools.modis.product import Product @@ -76,10 +78,13 @@ def create_collection(product_name: str, version: str) -> Collection: return collection -def create_item(href: str, - cog_directory: Optional[str] = None, - create_cogs: bool = False, - read_href_modifier: Optional[ReadHrefModifier] = None) -> Item: +def create_item( + href: str, + cog_directory: Optional[str] = None, + create_cogs: bool = False, + read_href_modifier: Optional[ReadHrefModifier] = None, + antimeridian_strategy: AntimeridianStrategy = AntimeridianStrategy.SPLIT +) -> Item: """Creates a STAC Item from MODIS data. Args: @@ -91,6 +96,8 @@ def create_item(href: str, hdf file. read_href_modifier (Callable[[str], str]): An optional function to modify the href (e.g. to add a token to a url) + antimeridian_strategy (AntimeridianStrategy): Either split on -180 or + normalize geometries so all longitudes are either positive or negative. Returns: pystac.Item: A STAC Item representing this MODIS image. @@ -111,6 +118,14 @@ def create_item(href: str, bbox=metadata.bbox, datetime=metadata.datetime, properties=properties) + geometry = shapely.geometry.shape(item.geometry) + if antimeridian_strategy == AntimeridianStrategy.SPLIT: + split = stactools.core.utils.antimeridian.split(geometry) + if split: + item.geometry = shapely.geometry.mapping(split) + elif antimeridian_strategy == AntimeridianStrategy.NORMALIZE: + item.geometry = shapely.geometry.mapping( + stactools.core.utils.antimeridian.normalize(geometry)) item.common_metadata.instruments = metadata.instruments item.common_metadata.platform = metadata.platform diff --git a/tests/data-files/expected/MCD12Q1/006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json b/tests/data-files/expected/MCD12Q1/006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json index 8456cfc7..e85907c7 100644 --- a/tests/data-files/expected/MCD12Q1/006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json +++ b/tests/data-files/expected/MCD12Q1/006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json @@ -131,28 +131,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -179.999952, - -0.006836 - ], - [ - 179.928473, - 9.998978 - ], - [ - -169.920147, - 9.990931 - ], - [ - -169.991733, - 6e-06 - ], + [ + -179.999952, + -0.006836 + ], + [ + -180.0, + -0.00012584880300359202 + ], + [ + -180.0, + 9.998921300539532 + ], + [ + -169.920147, + 9.990931 + ], + [ + -169.991733, + 6e-06 + ], + [ + -179.999952, + -0.006836 + ] + ] + ], + [ [ - -179.999952, - -0.006836 + [ + 180.0, + -0.00012584880300359202 + ], + [ + 179.928473, + 9.998978 + ], + [ + 180.0, + 9.998921300539532 + ], + [ + 180.0, + -0.00012584880300359202 + ] ] ] ] diff --git a/tests/data-files/expected/MCD15A2H/061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json b/tests/data-files/expected/MCD15A2H/061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json index 6dcb5117..1a2c3c80 100644 --- a/tests/data-files/expected/MCD15A2H/061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json +++ b/tests/data-files/expected/MCD15A2H/061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - 179.73790138346, - -27.2577913842797 - ], - [ - -179.99759047847, - -19.9296251074518 - ], - [ - -170.262009620933, - -19.9373696403913 - ], - [ - -169.997993708017, - -27.2397265661842 - ], + [ + 179.73790138346, + -27.2577913842797 + ], + [ + 180.0, + -19.99638061277713 + ], + [ + 180.0, + -27.25733009088168 + ], + [ + 179.73790138346, + -27.2577913842797 + ] + ] + ], + [ [ - 179.73790138346, - -27.2577913842797 + [ + -180.0, + -19.99638061277713 + ], + [ + -179.99759047847, + -19.9296251074518 + ], + [ + -170.262009620933, + -19.9373696403913 + ], + [ + -169.997993708017, + -27.2397265661842 + ], + [ + -180.0, + -27.25733009088168 + ], + [ + -180.0, + -19.99638061277713 + ] ] ] ] diff --git a/tests/data-files/expected/MOD16A3GF/061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json b/tests/data-files/expected/MOD16A3GF/061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json index 1298b85a..1555c062 100644 --- a/tests/data-files/expected/MOD16A3GF/061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json +++ b/tests/data-files/expected/MOD16A3GF/061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -161.99981886055, - 55.5344815313793 - ], - [ - 176.211092064359, - 68.4670945567165 - ], - [ - -109.906882828253, - 75.55535641397 - ], - [ - -120.101822308431, - 59.6807024294448 - ], + [ + -161.99981886055, + 55.5344815313793 + ], + [ + -180.0, + 66.21824055683585 + ], + [ + -180.0, + 68.83060342862159 + ], + [ + -109.906882828253, + 75.55535641397 + ], + [ + -120.101822308431, + 59.6807024294448 + ], + [ + -161.99981886055, + 55.5344815313793 + ] + ] + ], + [ [ - -161.99981886055, - 55.5344815313793 + [ + 180.0, + 66.21824055683585 + ], + [ + 176.211092064359, + 68.4670945567165 + ], + [ + 180.0, + 68.83060342862159 + ], + [ + 180.0, + 66.21824055683585 + ] ] ] ] diff --git a/tests/data-files/expected/MYD13A1/061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json b/tests/data-files/expected/MYD13A1/061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json index e5f803e2..c8fb6a97 100644 --- a/tests/data-files/expected/MYD13A1/061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json +++ b/tests/data-files/expected/MYD13A1/061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - 140.110001024585, - 59.6452506478332 - ], - [ - 135.926980213043, - 69.2113905326394 - ], - [ - -176.534172118079, - 66.3541732020201 - ], - [ - 174.497006769159, - 57.5564415970622 - ], + [ + 140.110001024585, + 59.6452506478332 + ], + [ + 135.926980213043, + 69.2113905326394 + ], + [ + 180.0, + 66.5624791239083 + ], + [ + 180.0, + 62.95445955952884 + ], + [ + 174.497006769159, + 57.5564415970622 + ], + [ + 140.110001024585, + 59.6452506478332 + ] + ] + ], + [ [ - 140.110001024585, - 59.6452506478332 + [ + -180.0, + 66.5624791239083 + ], + [ + -176.534172118079, + 66.3541732020201 + ], + [ + -180.0, + 62.95445955952884 + ], + [ + -180.0, + 66.5624791239083 + ] ] ] ] diff --git a/tests/data-files/expected/MYD14A1/061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json b/tests/data-files/expected/MYD14A1/061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json index 90cdd543..928699a9 100644 --- a/tests/data-files/expected/MYD14A1/061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json +++ b/tests/data-files/expected/MYD14A1/061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -179.464544105346, - 9.72439219646173 - ], - [ - 179.952014616979, - 19.9968450579578 - ], - [ - -162.21824805558, - 20.2678775712419 - ], - [ - -162.468655281243, - 9.9829565925733 - ], + [ + -179.464544105346, + 9.72439219646173 + ], + [ + -180.0, + 19.151982680224844 + ], + [ + -180.0, + 19.99757449096751 + ], + [ + -162.21824805558, + 20.2678775712419 + ], + [ + -162.468655281243, + 9.9829565925733 + ], + [ + -179.464544105346, + 9.72439219646173 + ] + ] + ], + [ [ - -179.464544105346, - 9.72439219646173 + [ + 180.0, + 19.151982680224844 + ], + [ + 179.952014616979, + 19.9968450579578 + ], + [ + 180.0, + 19.99757449096751 + ], + [ + 180.0, + 19.151982680224844 + ] ] ] ] diff --git a/tests/data-files/expected/MYD16A3GF/061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json b/tests/data-files/expected/MYD16A3GF/061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json index e9c8ae99..839e17d4 100644 --- a/tests/data-files/expected/MYD16A3GF/061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json +++ b/tests/data-files/expected/MYD16A3GF/061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -161.99981886055, - 55.5344815313793 - ], - [ - 176.211092064359, - 68.4670945567165 - ], - [ - -109.906882828253, - 75.55535641397 - ], - [ - -120.101822308431, - 59.6807024294448 - ], + [ + -161.99981886055, + 55.5344815313793 + ], + [ + -180.0, + 66.21824055683585 + ], + [ + -180.0, + 68.83060342862159 + ], + [ + -109.906882828253, + 75.55535641397 + ], + [ + -120.101822308431, + 59.6807024294448 + ], + [ + -161.99981886055, + 55.5344815313793 + ] + ] + ], + [ [ - -161.99981886055, - 55.5344815313793 + [ + 180.0, + 66.21824055683585 + ], + [ + 176.211092064359, + 68.4670945567165 + ], + [ + 180.0, + 68.83060342862159 + ], + [ + 180.0, + 66.21824055683585 + ] ] ] ] diff --git a/tests/test_stac.py b/tests/test_stac.py index cf822d37..aa6472fc 100644 --- a/tests/test_stac.py +++ b/tests/test_stac.py @@ -5,9 +5,11 @@ from tempfile import TemporaryDirectory import pytest +import shapely.geometry from pystac import CatalogType, MediaType import stactools.modis.stac +from stactools.modis.constants import AntimeridianStrategy from stactools.modis.file import File from . import test_data @@ -121,3 +123,14 @@ def test_cog_directory() -> None: if asset.media_type == MediaType.COG ] assert len(cog_assets) == 2 + + +def test_antimeridian() -> None: + href = test_data.get_path( + "data-files/MCD15A2H.A2022025.h01v11.061.2022035062702.hdf.xml") + item = stactools.modis.stac.create_item( + href, antimeridian_strategy=AntimeridianStrategy.NORMALIZE) + bounds = shapely.geometry.shape(item.geometry).bounds + assert bounds[0] == 179.73790138346 + assert bounds[2] == 190.002006291983 + item.validate() From 0d035b19dd62f4a6d4eb1abb5a9cf1c6bad9e8bf Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 15 Mar 2022 09:23:35 -0600 Subject: [PATCH 2/4] chore: update examples --- ...2Q1.A2001001.h00v08.006.2018142182903.json | 62 +++++++++++++------ ...3A1.A2022009.h25v02.061.2022028071925.json | 62 +++++++++++++------ ...4A1.A2022025.h01v07.061.2022035001141.json | 62 +++++++++++++------ ...A2H.A2022025.h01v11.061.2022035062702.json | 62 +++++++++++++------ ...3GF.A2021001.h11v02.061.2022024075208.json | 62 +++++++++++++------ ...3GF.A2021001.h11v02.061.2022024220526.json | 62 +++++++++++++------ 6 files changed, 264 insertions(+), 108 deletions(-) diff --git a/examples/modis-006/modis-12Q1-006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json b/examples/modis-006/modis-12Q1-006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json index cf78adf9..5f48dbde 100644 --- a/examples/modis-006/modis-12Q1-006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json +++ b/examples/modis-006/modis-12Q1-006/MCD12Q1.A2001001.h00v08.006.2018142182903/MCD12Q1.A2001001.h00v08.006.2018142182903.json @@ -131,28 +131,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -179.999952, - -0.006836 - ], - [ - 179.928473, - 9.998978 - ], - [ - -169.920147, - 9.990931 - ], - [ - -169.991733, - 6e-06 - ], + [ + -179.999952, + -0.006836 + ], + [ + -180.0, + -0.00012584880300359202 + ], + [ + -180.0, + 9.998921300539532 + ], + [ + -169.920147, + 9.990931 + ], + [ + -169.991733, + 6e-06 + ], + [ + -179.999952, + -0.006836 + ] + ] + ], + [ [ - -179.999952, - -0.006836 + [ + 180.0, + -0.00012584880300359202 + ], + [ + 179.928473, + 9.998978 + ], + [ + 180.0, + 9.998921300539532 + ], + [ + 180.0, + -0.00012584880300359202 + ] ] ] ] diff --git a/examples/modis-061/modis-13A1-061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json b/examples/modis-061/modis-13A1-061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json index 27b28996..ed9772bf 100644 --- a/examples/modis-061/modis-13A1-061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json +++ b/examples/modis-061/modis-13A1-061/MYD13A1.A2022009.h25v02.061.2022028071925/MYD13A1.A2022009.h25v02.061.2022028071925.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - 140.110001024585, - 59.6452506478332 - ], - [ - 135.926980213043, - 69.2113905326394 - ], - [ - -176.534172118079, - 66.3541732020201 - ], - [ - 174.497006769159, - 57.5564415970622 - ], + [ + 140.110001024585, + 59.6452506478332 + ], + [ + 135.926980213043, + 69.2113905326394 + ], + [ + 180.0, + 66.5624791239083 + ], + [ + 180.0, + 62.95445955952884 + ], + [ + 174.497006769159, + 57.5564415970622 + ], + [ + 140.110001024585, + 59.6452506478332 + ] + ] + ], + [ [ - 140.110001024585, - 59.6452506478332 + [ + -180.0, + 66.5624791239083 + ], + [ + -176.534172118079, + 66.3541732020201 + ], + [ + -180.0, + 62.95445955952884 + ], + [ + -180.0, + 66.5624791239083 + ] ] ] ] diff --git a/examples/modis-061/modis-14A1-061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json b/examples/modis-061/modis-14A1-061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json index 4b5d6533..bd677a4f 100644 --- a/examples/modis-061/modis-14A1-061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json +++ b/examples/modis-061/modis-14A1-061/MYD14A1.A2022025.h01v07.061.2022035001141/MYD14A1.A2022025.h01v07.061.2022035001141.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -179.464544105346, - 9.72439219646173 - ], - [ - 179.952014616979, - 19.9968450579578 - ], - [ - -162.21824805558, - 20.2678775712419 - ], - [ - -162.468655281243, - 9.9829565925733 - ], + [ + -179.464544105346, + 9.72439219646173 + ], + [ + -180.0, + 19.151982680224844 + ], + [ + -180.0, + 19.99757449096751 + ], + [ + -162.21824805558, + 20.2678775712419 + ], + [ + -162.468655281243, + 9.9829565925733 + ], + [ + -179.464544105346, + 9.72439219646173 + ] + ] + ], + [ [ - -179.464544105346, - 9.72439219646173 + [ + 180.0, + 19.151982680224844 + ], + [ + 179.952014616979, + 19.9968450579578 + ], + [ + 180.0, + 19.99757449096751 + ], + [ + 180.0, + 19.151982680224844 + ] ] ] ] diff --git a/examples/modis-061/modis-15A2H-061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json b/examples/modis-061/modis-15A2H-061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json index f0fd77f5..08c07d46 100644 --- a/examples/modis-061/modis-15A2H-061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json +++ b/examples/modis-061/modis-15A2H-061/MCD15A2H.A2022025.h01v11.061.2022035062702/MCD15A2H.A2022025.h01v11.061.2022035062702.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - 179.73790138346, - -27.2577913842797 - ], - [ - -179.99759047847, - -19.9296251074518 - ], - [ - -170.262009620933, - -19.9373696403913 - ], - [ - -169.997993708017, - -27.2397265661842 - ], + [ + 179.73790138346, + -27.2577913842797 + ], + [ + 180.0, + -19.99638061277713 + ], + [ + 180.0, + -27.25733009088168 + ], + [ + 179.73790138346, + -27.2577913842797 + ] + ] + ], + [ [ - 179.73790138346, - -27.2577913842797 + [ + -180.0, + -19.99638061277713 + ], + [ + -179.99759047847, + -19.9296251074518 + ], + [ + -170.262009620933, + -19.9373696403913 + ], + [ + -169.997993708017, + -27.2397265661842 + ], + [ + -180.0, + -27.25733009088168 + ], + [ + -180.0, + -19.99638061277713 + ] ] ] ] diff --git a/examples/modis-061/modis-16A3GF-061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json b/examples/modis-061/modis-16A3GF-061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json index eeb59899..3fca489a 100644 --- a/examples/modis-061/modis-16A3GF-061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json +++ b/examples/modis-061/modis-16A3GF-061/MOD16A3GF.A2021001.h11v02.061.2022024075208/MOD16A3GF.A2021001.h11v02.061.2022024075208.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -161.99981886055, - 55.5344815313793 - ], - [ - 176.211092064359, - 68.4670945567165 - ], - [ - -109.906882828253, - 75.55535641397 - ], - [ - -120.101822308431, - 59.6807024294448 - ], + [ + -161.99981886055, + 55.5344815313793 + ], + [ + -180.0, + 66.21824055683585 + ], + [ + -180.0, + 68.83060342862159 + ], + [ + -109.906882828253, + 75.55535641397 + ], + [ + -120.101822308431, + 59.6807024294448 + ], + [ + -161.99981886055, + 55.5344815313793 + ] + ] + ], + [ [ - -161.99981886055, - 55.5344815313793 + [ + 180.0, + 66.21824055683585 + ], + [ + 176.211092064359, + 68.4670945567165 + ], + [ + 180.0, + 68.83060342862159 + ], + [ + 180.0, + 66.21824055683585 + ] ] ] ] diff --git a/examples/modis-061/modis-16A3GF-061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json b/examples/modis-061/modis-16A3GF-061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json index b16bcde0..0ac4d7bf 100644 --- a/examples/modis-061/modis-16A3GF-061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json +++ b/examples/modis-061/modis-16A3GF-061/MYD16A3GF.A2021001.h11v02.061.2022024220526/MYD16A3GF.A2021001.h11v02.061.2022024220526.json @@ -17,28 +17,54 @@ "datetime": null }, "geometry": { - "type": "Polygon", + "type": "MultiPolygon", "coordinates": [ [ [ - -161.99981886055, - 55.5344815313793 - ], - [ - 176.211092064359, - 68.4670945567165 - ], - [ - -109.906882828253, - 75.55535641397 - ], - [ - -120.101822308431, - 59.6807024294448 - ], + [ + -161.99981886055, + 55.5344815313793 + ], + [ + -180.0, + 66.21824055683585 + ], + [ + -180.0, + 68.83060342862159 + ], + [ + -109.906882828253, + 75.55535641397 + ], + [ + -120.101822308431, + 59.6807024294448 + ], + [ + -161.99981886055, + 55.5344815313793 + ] + ] + ], + [ [ - -161.99981886055, - 55.5344815313793 + [ + 180.0, + 66.21824055683585 + ], + [ + 176.211092064359, + 68.4670945567165 + ], + [ + 180.0, + 68.83060342862159 + ], + [ + 180.0, + 66.21824055683585 + ] ] ] ] From ae3e622610fd5ed43538584b5723207d7bae4f26 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Tue, 15 Mar 2022 09:24:25 -0600 Subject: [PATCH 3/4] chore: update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cecc1d07..e098ba24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), - Keywords and summaries to collections ([#48](https://github.com/stactools-packages/modis/pull/48)) - More Item and Collection metadata ([#51](https://github.com/stactools-packages/modis/pull/51)) - Keywords for Collections ([#54](https://github.com/stactools-packages/modis/pull/54)) +- Antimeridian corrections ([#62](https://github.com/stactools-packages/modis/pull/62)) ### Changed From 2ad0fc97a53404f72ec9823e67eb3d0bbd162397 Mon Sep 17 00:00:00 2001 From: Pete Gadomski Date: Fri, 18 Mar 2022 11:42:47 -0600 Subject: [PATCH 4/4] deps: pin stactools This is to pick up the antimeridian changes in a stable way. --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 3d86285f..fc8233f7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -31,7 +31,7 @@ packages = stactools.modis stactools.modis.fragments install_requires = - stactools @ git+https://github.com/stac-utils/stactools@antimeridian + stactools @ git+https://github.com/stac-utils/stactools@f31524f03308df94b4836c92abb779f194e34567 [options.packages.find] where = src