Module: sarpyx.utils.wkt_utils

File: sarpyx/utils/wkt_utils.py

This script provides utility functions for extracting Well-Known Text (WKT) representations of geographic footprints from satellite product metadata. It includes functions for extracting WKT polygons from Sentinel-1 products using the Copernicus Data Search API and from Terrasar-X product XML files.

Exported Symbols (__all__)

No explicit __all__ list. Public symbols inferred from implementation.

Public Functions (3)

sentinel1_wkt_extractor_manifest function

Extract WKT footprint from Sentinel-1 SAFE manifest (offline).

File location: sarpyx/utils/wkt_utils.py:43

Signature

sentinel1_wkt_extractor_manifest(product_path: str | Path, display_results: bool=False, verbose: bool=False, axis_order: str='latlon') -> str | None

Parameters

ParameterTypeRequiredDefaultDescription
product_pathstr | Pathyes-Path to the Sentinel-1 SAFE folder or manifest.safe file.
display_resultsboolnoFalseWhether to display extracted coordinates. Defaults to False.
verboseboolnoFalseWhether to print debug output. Defaults to False.
axis_orderstrno'latlon'Coordinate order in the manifest ('latlon' or 'lonlat'). Defaults to 'latlon'.

Return Type

str | None

str | None: WKT representation of the footprint polygon, or None if not found.

Exceptions

  • ValueError

Side Effects

  • io

Example Usage

from sarpyx.utils.wkt_utils import sentinel1_wkt_extractor_manifest

result = sentinel1_wkt_extractor_manifest(product_path=<product_path>)

Edge Cases

May raise: ValueError. Includes optional parameters with implementation-defined fallback behavior. Documented return may be None for some execution paths.

sentinel1_wkt_extractor_cdse function

Extract WKT footprint from Sentinel-1 product using Copernicus Data Search.

File location: sarpyx/utils/wkt_utils.py:129

Signature

sentinel1_wkt_extractor_cdse(product_name: str, display_results: bool=False, verbose: bool=False) -> str | None

Parameters

ParameterTypeRequiredDefaultDescription
product_namestryes-Name of the Sentinel-1 product to search for.
display_resultsboolnoFalseWhether to display search results. Defaults to False.
verboseboolnoFalseinferred from implementation.

Return Type

str | None

str | None: WKT representation of the product footprint polygon, or None if not found.

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • io

Example Usage

from sarpyx.utils.wkt_utils import sentinel1_wkt_extractor_cdse

result = sentinel1_wkt_extractor_cdse(product_name=<product_name>)

Edge Cases

Includes optional parameters with implementation-defined fallback behavior. Documented return may be None for some execution paths.

terrasar_wkt_extractor function

Extract WKT footprint from Terrasar-X product XML file.

File location: sarpyx/utils/wkt_utils.py:171

Signature

terrasar_wkt_extractor(product_path: Path) -> str

Parameters

ParameterTypeRequiredDefaultDescription
product_pathPathyes-Path to the input Terrasar-X product XML file.

Return Type

str

str: WKT representation of the product footprint polygon.

Exceptions

None explicitly documented; inferred from implementation.

Side Effects

  • inferred from implementation

Example Usage

from sarpyx.utils.wkt_utils import terrasar_wkt_extractor

result = terrasar_wkt_extractor(product_path=<product_path>)

Edge Cases

No explicit edge-case section found; behavior is inferred from implementation.

Public Classes (0)

No public classes detected.