Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<interval: struct<from: timestamp[s], to: timestamp[s]>, outputs: struct<indices: struct<bands: struct<B0: struct<stats: struct<min: string, max: string, mean: string, stDev: string, sampleCount: int64, noDataCount: int64, percentiles: struct<50.0: string, 10.0: string, 90.0: string>>>, B1: struct<stats: struct<min: string, max: string, mean: string, stDev: string, sampleCount: int64, noDataCount: int64, percentiles: struct<50.0: string, 10.0: string, 90.0: string>>>, B2: struct<stats: struct<min: string, max: string, mean: string, stDev: string, sampleCount: int64, noDataCount: int64, percentiles: struct<50.0: string, 10.0: string, 90.0: string>>>>>>, error: struct<type: string, message: string, status: int64, th: null>>
to
{'interval': {'from': Value('timestamp[s]'), 'to': Value('timestamp[s]')}, 'outputs': {'indices': {'bands': {'B0': {'stats': {'min': Json(decode=True), 'max': Json(decode=True), 'mean': Json(decode=True), 'stDev': Json(decode=True), 'sampleCount': Value('int64'), 'noDataCount': Value('int64'), 'percentiles': {'50.0': Json(decode=True), '10.0': Json(decode=True), '90.0': Json(decode=True)}}}, 'B1': {'stats': {'min': Json(decode=True), 'max': Json(decode=True), 'mean': Json(decode=True), 'stDev': Json(decode=True), 'sampleCount': Value('int64'), 'noDataCount': Value('int64'), 'percentiles': {'50.0': Json(decode=True), '10.0': Json(decode=True), '90.0': Json(decode=True)}}}, 'B2': {'stats': {'min': Json(decode=True), 'max': Json(decode=True), 'mean': Json(decode=True), 'stDev': Json(decode=True), 'sampleCount': Value('int64'), 'noDataCount': Value('int64'), 'percentiles': {'50.0': Json(decode=True), '10.0': Json(decode=True), '90.0': Json(decode=True)}}}}}}}
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1779, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 295, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/packaged_modules/json/json.py", line 128, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2281, in table_cast
                  return cast_table_to_schema(table, schema)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2233, in cast_table_to_schema
                  cast_array_to_feature(
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 1804, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2061, in cast_array_to_feature
                  casted_array_values = _c(array.values, feature.feature)
                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 1806, in wrapper
                  return func(array, *args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/table.py", line 2101, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<interval: struct<from: timestamp[s], to: timestamp[s]>, outputs: struct<indices: struct<bands: struct<B0: struct<stats: struct<min: string, max: string, mean: string, stDev: string, sampleCount: int64, noDataCount: int64, percentiles: struct<50.0: string, 10.0: string, 90.0: string>>>, B1: struct<stats: struct<min: string, max: string, mean: string, stDev: string, sampleCount: int64, noDataCount: int64, percentiles: struct<50.0: string, 10.0: string, 90.0: string>>>, B2: struct<stats: struct<min: string, max: string, mean: string, stDev: string, sampleCount: int64, noDataCount: int64, percentiles: struct<50.0: string, 10.0: string, 90.0: string>>>>>>, error: struct<type: string, message: string, status: int64, th: null>>
              to
              {'interval': {'from': Value('timestamp[s]'), 'to': Value('timestamp[s]')}, 'outputs': {'indices': {'bands': {'B0': {'stats': {'min': Json(decode=True), 'max': Json(decode=True), 'mean': Json(decode=True), 'stDev': Json(decode=True), 'sampleCount': Value('int64'), 'noDataCount': Value('int64'), 'percentiles': {'50.0': Json(decode=True), '10.0': Json(decode=True), '90.0': Json(decode=True)}}}, 'B1': {'stats': {'min': Json(decode=True), 'max': Json(decode=True), 'mean': Json(decode=True), 'stDev': Json(decode=True), 'sampleCount': Value('int64'), 'noDataCount': Value('int64'), 'percentiles': {'50.0': Json(decode=True), '10.0': Json(decode=True), '90.0': Json(decode=True)}}}, 'B2': {'stats': {'min': Json(decode=True), 'max': Json(decode=True), 'mean': Json(decode=True), 'stDev': Json(decode=True), 'sampleCount': Value('int64'), 'noDataCount': Value('int64'), 'percentiles': {'50.0': Json(decode=True), '10.0': Json(decode=True), '90.0': Json(decode=True)}}}}}}}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1347, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 980, in convert_to_parquet
                  builder.download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 882, in download_and_prepare
                  self._download_and_prepare(
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 943, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1646, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.12/site-packages/datasets/builder.py", line 1832, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

data
list
status
string
geometryPixelCount
int64
[ { "interval": { "from": "2017-01-01T00:00:00", "to": "2017-01-11T00:00:00" }, "outputs": { "indices": { "bands": { "B0": { "stats": { "min": 0.0000509398, "max": 0.1892762631, "mean": 0.058702701700000005, ...
OK
10,911
[{"interval":{"from":"2017-01-01T00:00:00","to":"2017-01-11T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
38,506
[{"interval":{"from":"2017-01-01T00:00:00","to":"2017-01-11T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
10,298
[{"interval":{"from":"2017-01-01T00:00:00","to":"2017-01-11T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
13,802
[{"interval":{"from":"2017-01-01T00:00:00","to":"2017-01-11T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
25,899
[{"interval":{"from":"2017-01-21T00:00:00","to":"2017-01-31T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
14,731
[{"interval":{"from":"2017-01-21T00:00:00","to":"2017-01-31T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
11,866
[{"interval":{"from":"2017-01-01T00:00:00","to":"2017-01-11T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
29,415
[{"interval":{"from":"2017-01-31T00:00:00","to":"2017-02-10T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
93,708
[{"interval":{"from":"2017-01-21T00:00:00","to":"2017-01-31T00:00:00"},"outputs":{"indices":{"bands"(...TRUNCATED)
OK
35,288
End of preview.

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. Find the closest river segment within 1km
  2. Split the river at the closest point
  3. Trace upstream 10km (source water)
  4. Trace downstream 10km (potentially affected)
  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.

Column Type Description
facilityName string Name of industrial facility
city string City location
countryName string Country
EPRTR_SectorCode int Industry sector code (1-9)
EPRTR_SectorName string Industry sector name
Pollutant string Pollutant released to water
Releases float Amount released
closest_river_id int HydroRIVERS segment ID
distance_to_river_m float Distance to river (meters)
river_strahler int Strahler stream order (1-9)
river_discharge float Average discharge (mΒ³/s)
upstream_segment_ids list[int] Upstream HydroRIVERS IDs
downstream_segment_ids list[int] Downstream HydroRIVERS IDs
n_upstream int Number of upstream parts
n_downstream int Number of downstream parts
upstream_line_wkb bytes Upstream river geometry (WKB)
downstream_line_wkb bytes Downstream river geometry (WKB)
upstream_poly_wkb bytes Upstream water surface (WKB)
downstream_poly_wkb bytes Downstream water surface (WKB)
geometry Point Facility location (WGS84)
closest_river_overlap_fraction float Fraction (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_visible bool True if closest_river_overlap_fraction β‰₯ 0.30 β€” the closest river segment is wide enough to be detectable in Sentinel-2
n_upstream_sentinel_visible int Number of upstream segments that meet the Sentinel-visibility threshold
n_downstream_sentinel_visible int Number of downstream segments that meet the Sentinel-visibility threshold
has_sentinel_visible_river bool Summary 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).

Column Type Description
HYRIV_ID int HydroRIVERS segment ID
direction string "upstream" or "downstream"
ORD_STRA int Strahler stream order
DIS_AV_CMS float Average discharge (mΒ³/s)
LENGTH_KM float Segment length (km)
geometry LineString River segment geometry

Usage

Load the dataset

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

# 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 visualize_single_facility.py "PRECHEZA"
# Opens facility_map.html in browser

Visualize multiple facilities

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

Scripts

river_proximity.py

Main pipeline that:

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

Dataset Source Usage
Industrial Facilities EEA E-PRTR Facility locations & emissions
River Network HydroRIVERS v1.0 River segments & flow direction
Water Polygons EU-Hydro Water surface geometry

Parameters

Parameter Value Description
max_distance_m 1,000 Max distance from facility to river
upstream_distance_km 10 How far to trace upstream
downstream_distance_km 10 How far to trace downstream
polygon_buffer_m 600 Buffer 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 order Facilities % Sentinel-visible
1 43,699 22.5 %
2 28,113 20.5 %
3 31,616 23.9 %
4 24,961 42.5 %
5 15,709 67.8 %
6 8,128 86.5 %
7 8,131 97.5 %
8 219 100.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).

Column Type Description
facility_id int Row index in river_data_facilities.geoparquet
direction string "upstream" or "downstream"
polygon_hash string SHA-256[:16] of the raw WKB polygon bytes (dedup key)
date datetime Start of the 10-day bin
ndci_mean float Mean NDCI over water pixels in bin
ndci_stddev float Std dev of NDCI
ndci_n_valid int Number of valid (water-masked) pixels
turb_mean float Mean turbidity proxy over water pixels
turb_stddev float Std dev of turbidity
turb_n_valid int Number of valid pixels (turbidity)
ndwi_mean float Mean NDWI (water index, quality check)
ndwi_n_valid int Number 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. Inner-join upstream + downstream on (facility_id, date)
  2. Pixel-count quality flags
  3. Raw downstream-minus-upstream delta
  4. Spatial detrending: subtract cross-facility median delta per date to remove regional Sentinel-2 artifacts
  5. Robust z-score per (facility_id, quarter) using median + MAD Γ— 1.4826
  6. Previous-bin z (persistence check)
  7. High-confidence anomaly flag (detrended delta > 0, z > 3, prev-z > 1.5)
Column Type Description
facility_id int Facility identifier
date datetime 10-day bin start
quarter int Calendar quarter (1–4), used for seasonal baseline
poly_hash_upstream string Upstream polygon hash
poly_hash_downstream string Downstream polygon hash
ndci_mean_upstream / _downstream float NDCI means per direction
ndci_n_valid_upstream / _downstream int Valid pixel counts
turb_mean_upstream / _downstream float Turbidity means
turb_n_valid_upstream / _downstream int Valid pixel counts
valid_bin_ndci / valid_bin_turb bool Passes pixel-count quality filter
delta_ndci_raw float Raw downstream βˆ’ upstream NDCI
date_median_ndci float Cross-facility median NDCI delta on this date (removed artifact)
delta_ndci float Spatially detrended NDCI delta
delta_turb_raw / delta_turb float Same for turbidity
baseline_med_ndci / baseline_mad_ndci float Seasonal baseline median and MAD
z_delta_ndci / z_delta_turb float Robust z-scores of detrended deltas
z_delta_ndci_prev / z_delta_turb_prev float Previous-bin z (persistence)
low_baseline_data bool True if < 8 bins in the seasonal group
high_confidence_ndci / high_confidence_turb bool Anomaly flag per signal
any_anomaly bool Either signal flagged
event_key string Links 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.

Column Type Description
event_id string Unique event key (e.g. 12345_e3)
facility_id int Representative facility for this polygon pair
start_date datetime First flagged bin
end_date datetime Last flagged bin
duration_bins int Number of flagged 10-day bins
peak_z_ndci float Maximum z-score (NDCI) across bins in event
peak_z_turb float Maximum z-score (turbidity) across bins in event
mean_z_ndci / mean_z_turb float Mean z-scores over event
signal_type string "ndci", "turb", or "both"
poly_hash_upstream / poly_hash_downstream string Physical 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
Downloads last month
727