Is the shoreline near me advancing or retreating?
Draw a rectangle to pick your area of interest, then see what NASA data covers it (live, here in your browser) or download a ready-to-run notebook with your AOI pre-filled. The notebook runs in any Python environment — it needs a free Earthdata Login to fetch the data.
80, 12.5 → 81, 16 (Andhra–Tamil Nadu east coast)Is the shoreline near me advancing or retreating?
What you can answer
- Multi-date shoreline position for any coastal AOI from a water-index waterline
- Erosion vs accretion rate in m/yr along shore-normal transects (DSAS-style)
- Where the coast is changing fastest (hotspot map of retreat/advance)
- Decadal trend by extending back to Landsat Collection 2 (1982+)
- Seasonal vs long-term signal by comparing pre- and post-monsoon scenes
What you can NOT answer with these alone
- True erosion vs tide/run-up shift without tidal correction or consistent tide-stage scene selection — the optical waterline is instantaneous.
- Sub-pixel change below ~30 m (HLS/Landsat) or ~10 m (Sentinel-2); narrow-beach change can be lost to mixed pixels.
- Sediment volume / beach profile — these are 2-D position changes, not 3-D volume; needs lidar/DEM or surveyed profiles.
- Cause attribution (groynes, ports, sea-level rise, sand mining) — imagery shows change, not its driver.
Code template
import earthaccess
import xarray as xr
import numpy as np
earthaccess.login(strategy="netrc")
# AOI: Andhra–Tamil Nadu east coast
aoi = (80.0, 12.5, 81.0, 16.0)
epochs = [("2015-01-01", "2015-04-30"), # dry-season, lower turbidity
("2020-01-01", "2020-04-30"),
("2025-01-01", "2025-04-30")]
shorelines = {}
for start, end in epochs:
granules = earthaccess.search_data(
short_name="HLSS30", # HLS Sentinel-2, 30 m
bounding_box=aoi,
temporal=(start, end),
cloud_cover=(0, 10),
)
# Open green (B03) and SWIR1 (B11) bands; stack to xarray
# ds = xr.open_mfdataset(...) with the granule assets
# MNDWI = (green - swir1) / (green + swir1)
# mndwi = (ds.B03 - ds.B11) / (ds.B03 + ds.B11)
# Composite over the epoch (median) to suppress clouds/waves
# mndwi_c = mndwi.median(dim="time")
# Water mask: MNDWI > 0 is water (verify threshold on a clear scene;
# tune per coast — turbid/built coasts may need a small positive offset)
# water = mndwi_c > 0
# Trace land/water boundary -> waterline vector (e.g. skimage / rasterio)
shorelines[start] = "<waterline geometry>"
# Cast shore-normal transects from a baseline, intersect each waterline,
# and fit per-transect rates:
# end-point rate = (pos_late - pos_early) / years
# linear rate = slope of position vs date (>=3 epochs)
# Sign convention: seaward (+) = accretion, landward (-) = erosion
Expected output
- Multi-date waterline overlay on a basemap (one colour per year)
- Transect map coloured by rate: red = retreat/erosion, blue = advance/accretion
- Histogram of m/yr rates across all transects (median + IQR)
- Hotspot callouts: fastest-eroding and fastest-accreting transects with values
Caveats
- Tide & wave run-up bias: the optical waterline is the instantaneous land/water edge. Without tidal correction, compare scenes at similar tide stage and treat near-pixel rates as uncertain.
- Index threshold is not universal: MNDWI > 0 is a common starting point but turbid plumes, foam, wet sand and dark built surfaces shift it — verify the threshold on a clear scene per coast rather than hard-coding it.
- Resolution floor: detectable change is bounded by pixel size (~30 m HLS/Landsat, ~10 m Sentinel-2). Use 10 m Sentinel-2 L2A for narrow beaches.
- Cloud and monsoon gaps: the east coast is cloudy in NE-monsoon months; prefer dry-season composites and median-stacking to fill gaps.
- Validate before publishing rates: cross-check against surveyed shorelines or DSAS reference data; satellite-derived shoreline rates carry several-metre uncertainty.
Cross-DAAC composition
HLS (HLSS30/HLSL30) is served by LP DAAC — single auth. Extending to Landsat Collection 2 L2 pulls from USGS (separate credentials), and 10 m Sentinel-2 L2A from ESA/Copernicus.
Sources
- HLS (HLSS30/HLSL30): https://lpdaac.usgs.gov/products/hlss30v002/
- Landsat Collection 2: https://www.usgs.gov/landsat-missions/landsat-collection-2
- DSAS (Digital Shoreline Analysis System): https://www.usgs.gov/centers/whcmsc/science/digital-shoreline-analysis-system-dsas
- Water indices (NDWI/MNDWI/AWEI) — McFeeters 1996; Xu 2006; Feyisa et al. 2014
Make it yours → Pick your stretch of coast and the year range, choose the water index (MNDWI for turbid or built coasts, NDWI for clean water, 10 m Sentinel-2 for finer detail), set transect spacing, and the notebook returns per-transect erosion/accretion rates plus a shoreline-change map. Swap in Landsat Collection 2 to extend the record back to the 1980s.
The thresholding a measurement into classes at the heart of this question — runnable on synthetic data, right here. The full earthaccess code template further down does it on real NASA data (needs an Earthdata login).