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

product.kml not found for Radarsat-2 product #155

Closed
jteulade opened this issue Jun 10, 2024 · 3 comments
Closed

product.kml not found for Radarsat-2 product #155

jteulade opened this issue Jun 10, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@jteulade
Copy link
Contributor

jteulade commented Jun 10, 2024

For a lot of products whose : s3://sertit-projects-archives/projects/2021/FormationPCAlgerie/FormationPCAlgerie2016/TP/Donnees/TP_9_2/RS2_OK28193_PK280925_DK255114_MF23_20120228_053641_HH_SGF/RS2_OK28193_PK280925_DK255114_MF23_20120228_053641_HH_SGF

I get this error:

Traceback (most recent call last):
  File "E:\JTeulade\repositories\stac\scripts\add_items.py", line 35, in <module>
    main()
  File "E:\JTeulade\repositories\stac\libs\sertit-utils\sertit\s3.py", line 99, in s3_env_wrapper
    return function(*_args, **_kwargs)
  File "E:\JTeulade\repositories\stac\scripts\add_items.py", line 22, in main
    add_items(valid_path_products, S3_TARGET_PATH, utils.get_ids())
  File "E:\JTeulade\repositories\stac\stac\stac.py", line 294, in add_items
    path_products = create_items(valid_path_products, catalog, s3_target_path)
  File "E:\JTeulade\repositories\stac\stac\stac.py", line 205, in create_items
    create_item(
  File "E:\JTeulade\repositories\stac\stac\stac.py", line 132, in create_item
    prod.stac.create_item()
  File "e:\jteulade\repositories\eoreader\eoreader\products\product.py", line 1424, in stac
    self._stac = StacItem(self)
  File "e:\jteulade\repositories\eoreader\eoreader\stac\stac_item.py", line 69, in __init__
    self.proj = ProjExt(prod, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\stac\stac_extensions.py", line 210, in __init__
    self.epsg = self.crs().to_epsg()
  File "C:\Users\jteulade\AppData\Local\anaconda3\envs\arcgispro-eo\lib\site-packages\methodtools.py", line 72, in __call__
    return self.__call__(*args, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\__init__.py", line 34, in wrapper
    return func(*args, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\stac\stac_extensions.py", line 232, in crs
    return self._prod.crs()
  File "C:\Users\jteulade\AppData\Local\anaconda3\envs\arcgispro-eo\lib\site-packages\methodtools.py", line 72, in __call__
    return self.__call__(*args, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\__init__.py", line 34, in wrapper
    return func(*args, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\products\sar\sar_product.py", line 382, in crs
    extent_wgs84 = self.wgs84_extent()
  File "C:\Users\jteulade\AppData\Local\anaconda3\envs\arcgispro-eo\lib\site-packages\methodtools.py", line 72, in __call__
    return self.__call__(*args, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\__init__.py", line 34, in wrapper
    return func(*args, **kwargs)
  File "e:\jteulade\repositories\eoreader\eoreader\products\sar\rs2_product.py", line 431, in wgs84_extent
    raise InvalidProductError(
eoreader.exceptions.InvalidProductError: Extent file (product.kml) not found in s3://sertit-projects-archives/projects/2021/FormationPCAlgerie/FormationPCAlgerie2016/TP/Donnees/TP_9_2/RS2_OK28193_PK280925_DK255114_MF23_20120228_053641_HH_SGF/RS2_OK28193_PK280925_DK255114_MF23_20120228_053641_HH_SGF

However product.kml file is not required in RS2 products here

image

We have the same problem for map-overlay.kml and S1 products

@jteulade jteulade added the bug Something isn't working label Jun 10, 2024
@remi-braun
Copy link
Member

There is a need to create workarounds when looking for these files (it's for the footprints right ? Sadly, we cannot compute a footprint from non-orthorectified data, so we should 1/ ortho the default band 2/ compute the footprint)

Maybe catch the error for now when creating the STAC Item and set the extent instead of the footprint (with a warning)

@remi-braun remi-braun added the 0.22.0 For version 0.22.0 label Jul 2, 2024
@jteulade
Copy link
Contributor Author

jteulade commented Jul 9, 2024

RS2:

  • For products SGF and SGX. Retrieve the extent from tif image.
  • For SSG products, maybe SPG. Retrieve the extent from tif image.

@jteulade
Copy link
Contributor Author

jteulade commented Jul 9, 2024

RCM: product GRD and GRC: Retrieve the extent from tif image.

pixalytics added a commit to pixalytics-ltd/eoreader that referenced this issue Aug 12, 2024
* Fix sertit#140: replace QB satellite ID with QB02 satellite ID

* Fix sertit#142: catch StopIteration and return InvalidProductError

* Fix sertit#142: catch StopIteration in several products

* Fix sertit#142: raise InvalidProductError instead of log

* Fix sertit#145: remove nested=-1 for SPOT constellations, use the default nested=0 instead

* Fix sertit#145: update CHANGES.md

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix sertit#142: catch StopIteration and return InvalidProductError

* Avoid KeyError if a product metadata doesn't have a namespace

* sertit#142: catch StopIteration and return InvalidProductError

* sertit#156: catch InvalidProductError when we try to get cloud_coverage property

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* sertit#156: catch all InvalidProductError due to properties not found in metadata

* sertit#161: return an error if SPECTRAL_PROCESSING not found in metadata

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/PyCQA/flake8: 7.0.0 → 7.1.0](PyCQA/flake8@7.0.0...7.1.0)

* FIX: Handle RCM and RS2 products that doesn't bundle their extent in a KML file sertit#155

* OPTIM: Search correctly nested metadata in the Reader (without accidentally using a recursive glob)

* sertit#152: add SGF in RS2 product type

* FIX: Fix error in looking for bands in Sentinel-2 L1C archived products sertit#168

* FIX: Handle wrongly recognized Planet products because of the recursive nested mtd in the Reader sertit#169

* FIX: Force the loading of `DimapV1` bands in `float32`

* FIX: Handle the case where fiona isn't installed anymore (with `geopandas 1.0`)

* FIX: Don't make `pystac` a mandatory requirement

* Use sertit.types.is_iterable

* Use sertit.types.make_iterable

* Correct typo

* FIX: Fix an unknown Planet bug that just appeared (`'...Path' has no len()`)

* CI: Remove for now end-to-end tests with Python 3.11 and 3.10.

* v0.21.2

* INSTALL: Remove `pystac[validation]` (as it is an optional dependency) from setup.py, and create a `stac` extra feature.

* Updates in CHANGES.md

* v0.21.2

* [pre-commit.ci] pre-commit autoupdate

updates:
- [github.com/PyCQA/flake8: 7.1.0 → 7.1.1](PyCQA/flake8@7.1.0...7.1.1)
- [github.com/psf/black: 24.4.2 → 24.8.0](psf/black@24.4.2...24.8.0)

* FIX: Get better window name (if available) when writing bands on disk (in tmp folder) + update sertit's version to benefit to the vector's name

---------

Co-authored-by: jteulade <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Rémi Braun <[email protected]>
Co-authored-by: BRAUN REMI <[email protected]>
@remi-braun remi-braun removed the 0.22.0 For version 0.22.0 label Feb 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants