How johnson-natanael/floodanalysis works
1. Repository purpose
- This is a geospatial flood/coastal-change analysis project, not just a generic web app.
- The codebase combines offline raster prediction pipelines with a Python-based presentation layer for browsing results.
2. Core data products
- The main outputs are GeoTIFF rasters under modules/LANDSAT8/ and modules/SENTINEL2/.
- These files represent time-sliced predictions, e.g. Landsat 8 half-year intervals and Sentinel-2 quarterly intervals from 2013–2024.
- A derived CSV, web_app/hasil_akresi_abrasi_per_tahun.csv, suggests yearly summary metrics for shoreline change or similar environmental change.
3. Modeling / inference subsystem
- modules/landsat_model.py and modules/sentinel_model.py are the two model pipelines, each tied to a different satellite source.
- Their output artifacts are precomputed rasters, which means model execution is likely batch/offline rather than interactive.
- The naming pattern indicates separate temporal cadences and possibly separate preprocessing/model parameters per sensor.
4. Geospatial post-processing subsystem
- modules/coastline.py likely extracts or transforms coastline geometry/metrics from raster predictions.
- modules/combine_hasil.py appears to merge multiple model outputs into consolidated results, likely producing the yearly CSV consumed by the app.
- These scripts are the main boundary between raw prediction rasters and human-readable analytical summaries.
5. Satellite-source separation
- The repository explicitly splits Landsat 8 and Sentinel-2 into distinct pipelines and artifact directories.
- That suggests different input characteristics, resolutions, or time windows are handled independently before any comparison or aggregation.
- An architecture diagram should show these as parallel upstream sources feeding into shared post-processing.
6. Web presentation layer
- web_app/ contains the user-facing application with app.py, HTML templates, and CSS assets.
- The template set (dashboard.html, detail.html, predict.html, comparison.html) indicates multiple views: overview, drill-down detail, prediction visualization, and side-by-side comparison.
- This layer is primarily read-only and visualizes precomputed data rather than running the geospatial models live.
7. Static asset boundary
- web_app/static/assets/ stores map imagery and derived files used by the UI.
- Subfolders like predictions, predictions_old, compare, coastlines, and custom_model suggest the UI consumes multiple asset categories: current predictions, historical comparisons, coastline overlays, and custom inputs.
- raw_data.tif under custom_model implies the app may support user-supplied geospatial input or a custom analysis mode.
8. Data flow through the system
- Satellite-derived inputs are processed by the model scripts in modules/.
- The resulting GeoTIFFs are stored as versioned artifacts by sensor and time period.
- Post-processing scripts combine those rasters into summary outputs such as the yearly CSV.
- The web app then reads the static rasters and tabular summaries to render dashboards and comparison pages.
9. Technology profile
- The project is Python-based end to end.
- The presence of templates/ and static/ strongly implies a Flask-style server architecture, even though the framework isn’t explicitly shown in the tree.
- The heavy use of .tif files indicates geospatial raster tooling is a central dependency of the offline pipeline.
10. Operational shape
- This is a file-backed analytics system: the “database” is effectively a set of raster artifacts plus a CSV summary.
- There is no sign of a separate backend service, queue, or external storage layer in the tree.
- The important architectural boundary is between offline geoprocessing and online visualization.
11. What to draw in an architecture diagram
- Show two independent upstream pipelines: Landsat 8 and Sentinel-2.
- Show their outputs landing as GeoTIFF prediction artifacts.
- Show a post-processing/aggregation step producing yearly summary data.
- Show the web app reading those static outputs and rendering dashboard, detail, prediction, and comparison views.
12. Notable repo characteristic
- The repository is artifact-heavy and code-light: many outputs are already committed.
- That makes the system closer to a packaged analysis product than a purely source-driven application.
Main entry points: app.py Web app · LANDSAT8 Landsat rasters · SENTINEL2 Sentinel rasters · combine_hasil.py Combine results
Components 17
Offline geoprocessing
Batch satellite model pipelines and raster post-processing.
- Landsat model · Offline Landsat 8 prediction pipeline.
modules/landsat_model.py - Sentinel model · Offline Sentinel-2 prediction pipeline.
modules/sentinel_model.py - Landsat rasters · Versioned half-year prediction artifacts for Landsat 8.
modules/LANDSAT8 - Sentinel rasters · Versioned quarterly prediction artifacts for Sentinel-2.
modules/SENTINEL2 - Coastline processing · Derives coastline metrics or geometry from prediction rasters.
modules/coastline.py - Combine results · Merges model outputs into consolidated analytical results.
modules/combine_hasil.py
Presentation layer
Web app that reads committed rasters and summary data.
- Yearly summary · Annual akresi/abrasi metric used by the web app.
web_app/hasil_akresi_abrasi_per_tahun.csv - Web app · Presentation layer for browsing predictions and summaries.
web_app/app.py - Dashboard · Overview page for system-wide results.
web_app/templates/dashboard.html - Detail view · Drill-down page for a specific result or area.
web_app/templates/detail.html - Prediction view · Page for viewing prediction rasters and related outputs.
web_app/templates/predict.html - Comparison view · Side-by-side comparison page for different periods or sources.
web_app/templates/comparison.html - Predictions · Current raster imagery and derived files served to the UI.
web_app/static/assets/predictions - Old predictions · Historical or legacy prediction imagery used for comparison.
web_app/static/assets/predictions_old - Compare assets · Comparison imagery and overlays for multi-period viewing.
web_app/static/assets/compare - Coastline assets · Rendered coastline overlays and related map artifacts.
web_app/static/assets/coastlines - Custom input · User-supplied geospatial input for custom analysis mode.
web_app/static/assets/custom_model/raw_data.tif
Connections 17
- Landsat model → Landsat rasters: writes · Produces Landsat 8 GeoTIFF prediction artifacts.
- Sentinel model → Sentinel rasters: writes · Produces Sentinel-2 GeoTIFF prediction artifacts.
- Landsat rasters → Coastline processing: feeds · Raster outputs are transformed into coastline metrics.
- Sentinel rasters → Coastline processing: feeds · Raster outputs are transformed into coastline metrics.
- Landsat rasters → Combine results: feeds · Landsat rasters contribute to consolidated summaries.
- Sentinel rasters → Combine results: feeds · Sentinel rasters contribute to consolidated summaries.
- Combine results → Yearly summary: produces · Creates annual shoreline-change summary data.
- Yearly summary → Web app: consumed by · Tabular annual metrics are read by the presentation layer.
- Predictions → Web app: served to · Primary prediction imagery consumed by the UI.
- Old predictions → Comparison view: supports · Historical predictions used in comparison workflows.
- Compare assets → Comparison view: supports · Comparison assets drive side-by-side visualizations.
- Coastline assets → Detail view: supports · Coastline overlays are shown in detail pages.
- Custom input → Prediction view: supports · Custom raster input enables user-driven prediction viewing.
- Web app → Dashboard: renders · Main overview page.
- Web app → Detail view: renders · Drill-down page.
- Web app → Prediction view: renders · Prediction visualization page.
- Web app → Comparison view: renders · Comparison page.