CoolFace
Datasetpublic

cassini-team-todo/eea-river-proximity

EEA Industrial Emissions - River Proximity Dataset This dataset links 160,576 industrial facilities from the European Environment Agency (EEA) to nearby rivers, with upstream/downstream flow analysis based on HydroRIVERS network data. Why This Dataset? Industrial facilities that discharge pollutants into water bodies affect downstream ecosystems and communities. This dataset enables: Impact assessment: Which communities/ecosystems are downstream of polluting… See the full description on the dataset page: https://huggingface.co/datasets/cassini-team-todo/eea-river-proximity.

sourceHugging Facecc-by-4.0updated 5mo agoView on Hugging Face
0likes122downloads
Dataset Card

EEA Industrial Emissions - River Proximity Dataset

This dataset links 160,576 industrial facilities from the European Environment Agency (EEA) to nearby rivers, with upstream/downstream flow analysis based on HydroRIVERS network data.

Why This Dataset?

Industrial facilities that discharge pollutants into water bodies affect downstream ecosystems and communities. This dataset enables:

  • Impact assessment: Which communities/ecosystems are downstream of polluting facilities?
  • Source tracing: Where does a facility's water supply come from?
  • Regulatory analysis: Mapping industrial emissions to affected river networks
  • Environmental research: Studying relationships between industry and water quality

How It Works

         ┌─────────────┐
         │  UPSTREAM   │  ← Source water (green)
         │  (5 parts)  │     flowing TOWARD facility
         └──────┬──────┘
                │
         ───────●─────── ← Split point (closest to facility)
                │
         ┌──────┴──────┐
         │  FACILITY   │  ← Industrial facility (orange)
         │   (211m)    │     within 1km of river
         └─────────────┘
                │
         ┌──────┴──────┐
         │ DOWNSTREAM  │  → Affected water (red)
         │  (4 parts)  │     flowing AWAY from facility
         └─────────────┘

For each facility:

  1. 1.Find the closest river segment within 1km
  2. 2.Split the river at the closest point
  3. 3.Trace upstream 10km (source water)
  4. 4.Trace downstream 10km (potentially affected)
  5. 5.Clip water surface polygons to match

Dataset Files

river_data_facilities.geoparquet (2.6 GB)

Main dataset with 160,576 facilities matched to rivers.

ColumnTypeDescription
facilityNamestringName of industrial facility
citystringCity location
countryNamestringCountry
EPRTR_SectorCodeintIndustry sector code (1-9)
EPRTR_SectorNamestringIndustry sector name
PollutantstringPollutant released to water
ReleasesfloatAmount released
closest_river_idintHydroRIVERS segment ID
distance_to_river_mfloatDistance to river (meters)
river_strahlerintStrahler stream order (1-9)
river_dischargefloatAverage discharge (m³/s)
upstream_segment_idslist[int]Upstream HydroRIVERS IDs
downstream_segment_idslist[int]Downstream HydroRIVERS IDs
n_upstreamintNumber of upstream parts
n_downstreamintNumber of downstream parts
upstream_line_wkbbytesUpstream river geometry (WKB)
downstream_line_wkbbytesDownstream river geometry (WKB)
upstream_poly_wkbbytesUpstream water surface (WKB)
downstream_poly_wkbbytesDownstream water surface (WKB)
geometryPointFacility location (WGS84)
closest_river_overlap_fractionfloatFraction (0–1) of the closest HydroRIVERS segment's length that falls inside an EU-Hydro River_Net_p polygon (± 30 m buffer)
closest_river_is_sentinel_visibleboolTrue if closest_river_overlap_fraction ≥ 0.30 — the closest river segment is wide enough to be detectable in Sentinel-2
n_upstream_sentinel_visibleintNumber of upstream segments that meet the Sentinel-visibility threshold
n_downstream_sentinel_visibleintNumber of downstream segments that meet the Sentinel-visibility threshold
has_sentinel_visible_riverboolSummary flag — True if any of the closest, upstream, or downstream segments is Sentinel-visible; use this column to filter facilities to those where Sentinel-2 water-quality retrieval is feasible

river_data_segments.geoparquet (1.7 MB)

River segments with direction labels (28,434 entries).

ColumnTypeDescription
HYRIV_IDintHydroRIVERS segment ID
directionstring"upstream" or "downstream"
ORD_STRAintStrahler stream order
DIS_AV_CMSfloatAverage discharge (m³/s)
LENGTH_KMfloatSegment length (km)
geometryLineStringRiver segment geometry

Usage

Load the dataset

python
import geopandas as gpd
from shapely import wkb

# Load facilities
facilities = gpd.read_parquet("river_data_facilities.geoparquet")
print(f"Loaded {len(facilities):,} facilities")

# Example: Find facilities in Germany
german = facilities[facilities['countryName'] == 'Germany']
print(f"Germany has {len(german):,} facilities near rivers")

Extract river geometries

python
# Get a specific facility
facility = facilities[facilities['facilityName'].str.contains('PRECHEZA')].iloc[0]

# Parse WKB geometries
upstream_line = wkb.loads(facility['upstream_line_wkb'])
downstream_line = wkb.loads(facility['downstream_line_wkb'])
upstream_poly = wkb.loads(facility['upstream_poly_wkb'])
downstream_poly = wkb.loads(facility['downstream_poly_wkb'])

print(f"Upstream: {facility['n_upstream']} segments")
print(f"Downstream: {facility['n_downstream']} segments")

Visualize a facility

python
python visualize_single_facility.py "PRECHEZA"
# Opens facility_map.html in browser

Visualize multiple facilities

python
python visualize_facilities_rivers.py
# Opens facilities_rivers_map.html with 200 sampled facilities

Scripts

river_proximity.py

Main pipeline that:

  1. 1.Loads EEA facilities, HydroRIVERS segments, and EU-Hydro polygons
  2. 2.Builds river network graph from NEXT_DOWN field
  3. 3.For each facility, finds closest river and splits at nearest point
  4. 4.Traces upstream (BFS) and downstream (linear) within distance limits
  5. 5.Clips water surface polygons to match river geometries
  6. 6.Outputs geoparquet files

visualize_single_facility.py

Creates an interactive Folium map for a single facility showing:

  • Green: upstream river and water surface
  • Red: downstream river and water surface
  • Orange marker: facility location

visualize_facilities_rivers.py

Creates an overview map with sampled facilities and their river associations.

Source Data

DatasetSourceUsage
Industrial FacilitiesEEA E-PRTRFacility locations & emissions
River NetworkHydroRIVERS v1.0River segments & flow direction
Water PolygonsEU-HydroWater surface geometry

Parameters

ParameterValueDescription
max_distance_m1,000Max distance from facility to river
upstream_distance_km10How far to trace upstream
downstream_distance_km10How far to trace downstream
polygon_buffer_m600Buffer for polygon clipping

Statistics

  • Total facilities processed: 254,027
  • Facilities near rivers: 160,576 (63%)
  • Unique upstream segments: 18,498
  • Unique downstream segments: 9,936
  • Average upstream parts: 7.1
  • Average downstream parts: 3.7

Sentinel visibility (EU-Hydro River_Net_p overlap ≥ 30 %)

Strahler orderFacilities% Sentinel-visible
143,69922.5 %
228,11320.5 %
331,61623.9 %
424,96142.5 %
515,70967.8 %
68,12886.5 %
78,13197.5 %
8219100.0 %
  • Facilities with `has_sentinel_visible_river = True`: 59,568 / 160,576 (37.1 %)
  • *Facilities where the closest reach is visible*: 23,507 / 160,576 (14.6 %)

Lower-order rates (~20–25 %) are driven by upstream/downstream propagation: a headwater facility may drain into a wider river within the 10 km trace window.

facility_timeseries.parquet (210 MB)

Sentinel-2 water-quality time series for Sentinel-visible industrial facilities (both upstream and downstream polygons detectable in 10 m imagery). Produced by fetching the Sentinel Hub Statistical API in P10D bins over 2017–2023 and merging three shards. One row per (facility, direction, 10-day bin).

ColumnTypeDescription
facility_idintRow index in river_data_facilities.geoparquet
directionstring"upstream" or "downstream"
polygon_hashstringSHA-256[:16] of the raw WKB polygon bytes (dedup key)
datedatetimeStart of the 10-day bin
ndci_meanfloatMean NDCI over water pixels in bin
ndci_stddevfloatStd dev of NDCI
ndci_n_validintNumber of valid (water-masked) pixels
turb_meanfloatMean turbidity proxy over water pixels
turb_stddevfloatStd dev of turbidity
turb_n_validintNumber of valid pixels (turbidity)
ndwi_meanfloatMean NDWI (water index, quality check)
ndwi_n_validintNumber of valid pixels (NDWI)

Coverage: 9.2 M rows · 23,158 unique facility IDs · 20,755 paired (both directions) · 2017-01-01 → 2023-12-16

facility_anomalies_per_bin.parquet (216 MB)

Per-bin anomaly detection output. One row per paired (facility, 10-day bin) where both upstream and downstream data exist. Produced by scripts/compute_facility_anomalies.py.

Pipeline steps applied:

  1. 1.Inner-join upstream + downstream on (facility_id, date)
  2. 2.Pixel-count quality flags
  3. 3.Raw downstream-minus-upstream delta
  4. 4.Spatial detrending: subtract cross-facility median delta per date to remove regional Sentinel-2 artifacts
  5. 5.Robust z-score per (facility_id, quarter) using median + MAD × 1.4826
  6. 6.Previous-bin z (persistence check)
  7. 7.High-confidence anomaly flag (detrended delta > 0, z > 3, prev-z > 1.5)
ColumnTypeDescription
facility_idintFacility identifier
datedatetime10-day bin start
quarterintCalendar quarter (1–4), used for seasonal baseline
poly_hash_upstreamstringUpstream polygon hash
poly_hash_downstreamstringDownstream polygon hash
ndci_mean_upstream / _downstreamfloatNDCI means per direction
ndci_n_valid_upstream / _downstreamintValid pixel counts
turb_mean_upstream / _downstreamfloatTurbidity means
turb_n_valid_upstream / _downstreamintValid pixel counts
valid_bin_ndci / valid_bin_turbboolPasses pixel-count quality filter
delta_ndci_rawfloatRaw downstream − upstream NDCI
date_median_ndcifloatCross-facility median NDCI delta on this date (removed artifact)
delta_ndcifloatSpatially detrended NDCI delta
delta_turb_raw / delta_turbfloatSame for turbidity
baseline_med_ndci / baseline_mad_ndcifloatSeasonal baseline median and MAD
z_delta_ndci / z_delta_turbfloatRobust z-scores of detrended deltas
z_delta_ndci_prev / z_delta_turb_prevfloatPrevious-bin z (persistence)
low_baseline_databoolTrue if < 8 bins in the seasonal group
high_confidence_ndci / high_confidence_turbboolAnomaly flag per signal
any_anomalyboolEither signal flagged
event_keystringLinks to event in facility_anomalies_events.parquet (null if not in a kept event)

Coverage: 4.26 M rows · 20,755 facilities · 255 unique dates

facility_anomalies_events.parquet (tiny)

Consolidated pollution events — one row per unique (upstream polygon, downstream polygon, time window) after deduplication. Single-bin events and events where the downstream signal is not worse than upstream are excluded.

ColumnTypeDescription
event_idstringUnique event key (e.g. 12345_e3)
facility_idintRepresentative facility for this polygon pair
start_datedatetimeFirst flagged bin
end_datedatetimeLast flagged bin
duration_binsintNumber of flagged 10-day bins
peak_z_ndcifloatMaximum z-score (NDCI) across bins in event
peak_z_turbfloatMaximum z-score (turbidity) across bins in event
mean_z_ndci / mean_z_turbfloatMean z-scores over event
signal_typestring"ndci", "turb", or "both"
poly_hash_upstream / poly_hash_downstreamstringPhysical polygon pair (dedup key)

Coverage: 42 events · 36 unique polygon pairs · 2017–2023

Thresholds used: z > 3.0, prev-bin z > 1.5, ≥ 2 consecutive bins, detrended delta > 0, seasonal MAD baseline requires ≥ 8 bins per quarter.

License

CC-BY-4.0. See source datasets for their respective licenses.

Citation

If you use this dataset, please cite the source datasets:

  • Lehner, B., Grill G. (2013): Global river hydrography and network routing: baseline data and new approaches to study the world's large river systems. Hydrological Processes, 27(15): 2171–2186.
  • European Environment Agency (EEA) Industrial Emissions Database
  • Copernicus EU-Hydro River Network Database