How tathyaearth/stsa works
Project type and purpose
• This is a Python-based geospatial analysis tool (a library + CLI + Streamlit web app) for parsing Sentinel-1 TOPS-SPLIT XML metadata and exporting it as shapefiles, JSON, CSV, or interactive webmaps.
Top-level components (from file structure)
• app.py – Streamlit front-end web application
• stsa/ – Core library package
– search.py – Handles Copernicus Scihub API search & download
– stsa.py – Defines TopsSplitAnalyzer class (core logic)
– utils.py – XML parsing, geometry construction, format conversion
• CLI entrypoint – invoking stsa.py as a script
• setup.py + requirements.txt – packaging & dependencies
• tests/ – pytest suite with sample SAFE/ZIP data
Main external dependencies & services
• Copernicus Scihub API (HTTPS)
• Local filesystem (ZIP or .SAFE directories)
• GDAL/Fiona/GeoPandas/Shapely – geospatial I/O & geometry
• Streamlit – for hosting the web app
Architectural patterns & design principles
• Layered design:
1. Presentation layer (CLI and Streamlit UI)
2. Application layer (TopsSplitAnalyzer orchestration)
3. Integration layer (search.py for API & file I/O)
4. Utility layer (XML parsing & geo-conversion in utils.py)
• Single-responsibility modules
• Clear separation of I/O (download, file reads) vs. data processing vs. output
Essential elements
• Labels: module names, file & API interfaces
• Data formats at I/O boundaries (ZIP, XML, GeoJSON, Shapefile, CSV)