GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Maps, GIS and field navigation / globalgrid2050 / repd_grid_atlasv6/.github/workflows

GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v6 Page and 8 more files

A web page that draws grid 400kV, grid 275kV, grid 220kV and grid 132kV. Published at https://globalgrid2050.com/repd_grid_atlasv6/.

686 lines of YAML and HTML and Python from globalgrid2050, in 9 files. Topic: Maps, GIS and field navigation. Section 493 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Update Grid Data v6 automation · globalgrid2050 / repd_grid_atlasv6/.github/workflows/update-grid-datav6.yml lines 1–73
  2. Update EV Chargers v6 automation · globalgrid2050 / repd_grid_atlasv6/.github/workflows/update_ev_chargersv6.yml lines 1–49
  3. Update Metros Trams v6 automation · globalgrid2050 / repd_grid_atlasv6/.github/workflows/update_metros_tramsv6.yml lines 1–44
  4. Update Prices v6 automation · globalgrid2050 / repd_grid_atlasv6/.github/workflows/update_pricesv6.yml lines 1–58
  5. Update Supermarkets v6 automation · globalgrid2050 / repd_grid_atlasv6/.github/workflows/update_supermarketsv6.yml lines 1–46
  6. Update Tube Stations v6 automation · globalgrid2050 / repd_grid_atlasv6/.github/workflows/update_tube_stationsv6.yml lines 1–44
  7. GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v6 Page render · globalgrid2050 / repd_grid_atlasv6/index.html lines 1–254
  8. Fetch 220kV Data v6 storage · globalgrid2050 / repd_grid_atlasv6/scripts/fetch_220kv_datav6.py lines 1–59
  9. Fetch 66kV Data v6 storage · globalgrid2050 / repd_grid_atlasv6/scripts/fetch_66kv_datav6.py lines 1–59

Update Grid Data v6

A configuration file in GlobalGrid2050. Runs by hand.

Set aside from the main view: 100% of its lines are the same as .github/workflows/update-grid-data.yml (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 100% of lines shared with GlobalGrid2050 Update Grid Data Workflow; read that one first. All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line-jaccard 1.0 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 .github/workflows/update-grid-data.yml:1-72 bcffb6f08bc51629756c637ef1aa054eb401221a
  • sha256 b8ed2af97ce76503027e94fe806e9e94e93dbd46e44d43bf09a027c4db9ce5d6
  • target sha256 8ffcd7df3ab10d386ec0fb560f3727f06f98b93fa2bff27d24df381565ecb12c
  • group of 2 (identity.json near-copy edges >= 0.9)
  • canonical rule: reachable, newest stamp, core repo, most lines

automationglobalgrid2050 / repd_grid_atlasv6/.github/workflows/update-grid-datav6.yml · lines 1–73 of 73 · Not reached from any entry point (candidate for review)

Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: 220kV, 66kV.
Inputs & outputs
Voltage levels named: 220kV, 66kV.
What it achieves
Named “fetch-national-grid-data”; runs `scripts/fetch_grid_data.py`, `scripts/fetch_220kv_data.py` and `scripts/fetch_66kv_data.py`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · repd_grid_atlasv6/.github/workflows · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
fetch-national-grid-data
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/.github/workflows/update-grid-datav6.yml:1-73 · blob 8990f6a52deea0af3a36632de5f42f2dabcba9de · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: duplicate_candidate
name: fetch-national-grid-data

on:
  workflow_dispatch:

permissions:
  contents: write

jobs:
  fetch-grid:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GRIDBOT_PAT }}

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install requests

      - name: Run Grid Fetcher
        run: python scripts/fetch_grid_data.py

      - name: Run 220kV Fetcher
        run: python scripts/fetch_220kv_data.py

      - name: Run 66kV Fetcher
        run: python scripts/fetch_66kv_data.py

      - name: Run Substation Fetcher
        run: python scripts/fetch_substations.py

      - name: Run Data Centre Fetcher
        run: python scripts/fetch_datacentres.py

      - name: Run Airport Fetcher
        run: python scripts/fetch_airports.py

      - name: Run Railway Fetcher
        run: python scripts/fetch_railways.py

      - name: Run Industrial Offtaker Fetcher
        run: python scripts/fetch_industrial_offtakers.py

      - name: Run Power Plants Fetcher
        run: python scripts/fetch_power_plants.py

      - name: Run HS2 Fetcher
        run: python scripts/fetch_hs2.py

      - name: Commit and push changes
        env:
          PAT: ${{ secrets.GRIDBOT_PAT }}
        run: |
          git config --global user.name "gridbot"
          git config --global user.email "bot@globalgrid2050.com"
          
          # Safely stage any geojson files created
          git add *.geojson || true
          
          if [ -n "$(git status --porcelain)" ]; then
            git commit -m "Automated grid, datacentre, airport, railway, industry, power plants, and hs2 fetch"
            git push https://${PAT}@github.com/${{ github.repository }}.git HEAD:main
          else
            echo "No changes to commit"
          fi

  

Update EV Chargers v6

A configuration file in GlobalGrid2050. Runs on a schedule and by hand.

automationglobalgrid2050 / repd_grid_atlasv6/.github/workflows/update_ev_chargersv6.yml · lines 1–49 of 49 · Not reached from any entry point (candidate for review)

Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
What it achieves
Runs `scripts/fetch_ev_chargers.py`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · repd_grid_atlasv6/.github/workflows · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
Update EV Chargers
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/.github/workflows/update_ev_chargersv6.yml:1-49 · blob 6a5696c8aa8d0710709248c22bb49eb45f9e71ac · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unreached_review
name: Update EV Chargers

on:
  schedule:
    - cron: '0 1 1 * *'   # 1st of every month
    - cron: '0 1 15 * *'  # 15th of every month
  workflow_dispatch:

permissions:
  contents: write

jobs:
  fetch-ev-chargers:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GRIDBOT_PAT }}

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install requests

      - name: Run EV Charger Fetcher
        env:
          OCM_API_KEY: ${{ secrets.OCM_API_KEY }}
        run: python scripts/fetch_ev_chargers.py

      - name: Commit and push changes
        env:
          PAT: ${{ secrets.GRIDBOT_PAT }}
        run: |
          git config --global user.name "gridbot"
          git config --global user.email "bot@globalgrid2050.com"

          git add ev_chargers.geojson || true

          if [ -n "$(git status --porcelain)" ]; then
            git commit -m "Automated EV charger update: $(date -u +'%Y-%m-%d %H:%M UTC')"
            git push https://${PAT}@github.com/${{ github.repository }}.git HEAD:main
          else
            echo "No changes to commit"
          fi

Update Metros Trams v6

A configuration file in GlobalGrid2050. Runs on a schedule and by hand.

automationglobalgrid2050 / repd_grid_atlasv6/.github/workflows/update_metros_tramsv6.yml · lines 1–44 of 44 · Not reached from any entry point (candidate for review)

Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
What it achieves
Named “Fetch UK Metros and Trams”; runs `scripts/fetch_metros_trams.py`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · repd_grid_atlasv6/.github/workflows · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
Fetch UK Metros and Trams
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/.github/workflows/update_metros_tramsv6.yml:1-44 · blob 498cf4792e9b7d6cb8f86da6513ba45aa63bd4b6 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unreached_review
name: Fetch UK Metros and Trams

on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 1 * *'

permissions:
  contents: write

jobs:
  update-transit-data:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GRIDBOT_PAT }}

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install requests

      - name: Run Transit Fetcher Script
        run: python scripts/fetch_metros_trams.py

      - name: Commit and Push changes
        env:
          PAT: ${{ secrets.GRIDBOT_PAT }}
        run: |
          git config --global user.name "gridbot"
          git config --global user.email "bot@globalgrid2050.com"
          git add uk_metros_trams.geojson
          
          if [ -n "$(git status --porcelain)" ]; then
            git commit -m "Automated update: Combined UK Metros and Trams geojson"
            git push https://${PAT}@github.com/${{ github.repository }}.git HEAD:main
          else
            echo "No changes to commit"
          fi

Update Prices v6

A configuration file in GlobalGrid2050. Runs on a schedule and by hand.

automationglobalgrid2050 / repd_grid_atlasv6/.github/workflows/update_pricesv6.yml · lines 1–58 of 58 · Not reached from any entry point (candidate for review)

Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: 33kV.
Inputs & outputs
Voltage levels named: 33kV.
What it achieves
Runs `scripts/update_prices_lv.py`, `scripts/update_prices.py` and `scripts/update_metal_trends.py`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · repd_grid_atlasv6/.github/workflows · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
update-metal-prices
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/.github/workflows/update_pricesv6.yml:1-58 · blob d8e0c451a30bdf8d9d2400203d44f576518e1816 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unreached_review
name: update-metal-prices

on:
  schedule:
    - cron: '0 6 * * *'
  workflow_dispatch:

permissions:
  contents: write
  actions: write

jobs:
  update:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          token: ${{ secrets.GRIDBOT_PAT }}

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install requests

      - name: Run LV price update
        run: python scripts/update_prices_lv.py

      - name: Run 33kV price update
        run: python scripts/update_prices.py

      - name: Run Historic Metal Trends update
        run: python scripts/update_metal_trends.py

      - name: Commit and push changes
        env:
          PAT: ${{ secrets.GRIDBOT_PAT }}
        run: |
          set -e
          
          git config --global user.name "gridbot"
          git config --global user.email "bot@globalgrid2050.com"
          
          git add lv_ac_dc_price_estimator/index.md
          git add 33kv_uk_dap_price_estimator/index.md
          git add copper_and_aluminium_prices_historic_trends.md
          
          if [ -n "$(git status --porcelain)" ]; then
            git commit -m "Automated price update: $(date -u +'%Y-%m-%d %H:%M UTC')"
            git push https://${PAT}@github.com/${{ github.repository }}.git HEAD:main
          else
            echo "No changes to commit"
          fi

Update Supermarkets v6

A configuration file in GlobalGrid2050. Runs on a schedule and by hand.

automationglobalgrid2050 / repd_grid_atlasv6/.github/workflows/update_supermarketsv6.yml · lines 1–46 of 46 · Not reached from any entry point (candidate for review)

Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
What it achieves
Runs `scripts/fetch_supermarkets.py`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · repd_grid_atlasv6/.github/workflows · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
Update Supermarkets
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/.github/workflows/update_supermarketsv6.yml:1-46 · blob 269520788fbc58845d249486a4a8d95deace1a30 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unreached_review
name: Update Supermarkets

on:
  schedule:
    - cron: '0 2 1 * *'   # 1st of every month at 02:00 UTC
  workflow_dispatch:

permissions:
  contents: write

jobs:
  fetch-supermarkets:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GRIDBOT_PAT }}

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install requests

      - name: Run Supermarket Fetcher
        run: python scripts/fetch_supermarkets.py

      - name: Commit and push changes
        env:
          PAT: ${{ secrets.GRIDBOT_PAT }}
        run: |
          git config --global user.name "gridbot"
          git config --global user.email "bot@globalgrid2050.com"

          git add supermarkets_*.geojson || true

          if [ -n "$(git status --porcelain)" ]; then
            git commit -m "Automated supermarket update: $(date -u +'%Y-%m-%d %H:%M UTC')"
            git push https://${PAT}@github.com/${{ github.repository }}.git HEAD:main
          else
            echo "No changes to commit"
          fi

Update Tube Stations v6

A configuration file in GlobalGrid2050. Runs on a schedule and by hand.

automationglobalgrid2050 / repd_grid_atlasv6/.github/workflows/update_tube_stationsv6.yml · lines 1–44 of 44 · Not reached from any entry point (candidate for review)

Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
What it achieves
Named “Fetch London Underground Stations”; runs `scripts/fetch_london_underground.py`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · repd_grid_atlasv6/.github/workflows · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
Fetch London Underground Stations
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/.github/workflows/update_tube_stationsv6.yml:1-44 · blob c3a09f139ace9a7aec93b717c195e58e6d688d7e · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unreached_review
name: Fetch London Underground Stations

on:
  workflow_dispatch:
  schedule:
    - cron: '0 0 1 * *'

permissions:
  contents: write

jobs:
  update-tube-data:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          token: ${{ secrets.GRIDBOT_PAT }}

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install dependencies
        run: pip install requests

      - name: Run Tube Station Script
        run: python scripts/fetch_london_underground.py

      - name: Commit and Push changes
        env:
          PAT: ${{ secrets.GRIDBOT_PAT }}
        run: |
          git config --global user.name "gridbot"
          git config --global user.email "bot@globalgrid2050.com"
          git add london_underground.geojson
          
          if [ -n "$(git status --porcelain)" ]; then
            git commit -m "Automated update: London Underground geojson"
            git push https://${PAT}@github.com/${{ github.repository }}.git HEAD:main
          else
            echo "No changes to commit"
          fi

GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v6 Page

A web page that draws grid 400kV, grid 275kV, grid 220kV and grid 132kV. Published at https://globalgrid2050.com/repd_grid_atlasv6/.

renderglobalgrid2050 / repd_grid_atlasv6/index.html · lines 1–254 of 254 · Entry point

What it does
It draws grid 400kV, grid 275kV, grid 220kV and grid 132kV. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: 400kV, 275kV, 220kV, 132kV, 66kV, 11kV.
Inputs & outputs
In: GeoJSON file grid_400kv.geojson; GeoJSON file grid_275kv.geojson; GeoJSON file grid_220kv.geojson; GeoJSON file grid_132kv.geojson; GeoJSON file grid_66kv.geojson; GeoJSON file grid_11kv_ukpn.geojson; GeoJSON file grid_substations.geojson; GeoJSON file power_plants.geojson. Out: web page. Voltage levels named: 400kV, 275kV, 220kV, 132kV, 66kV, 11kV.
Downstream impact
Used directly by 8 files: GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); Homepage V030 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v030.html); Homepage V031 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v031.html); Homepage V032 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v032.html); and 4 more. Reached from 87 other entry points, including GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V037 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v037.html); Homepage V038 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v038.html). It is itself an entry point, published at https://globalgrid2050.com/repd_grid_atlasv6/.
What it achieves
UK Region v6 (Experimental). Its code works with 100 kW, 11 kV and 132 kV.
Why it matters
Loaded by the GlobalGrid2050 Historical Builds map page at https://globalgrid2050.com/historical_builds.html and 7 other pages.
Application
globalgrid2050 · repd_grid_atlasv6 · page
Uses
Ventus v6 (stylesheet), Ventus Corev6engine (script src), https://cdn.jsdelivr.net/npm/maplibre-gl@3.6.2/dist/maplibre-gl.css, https://cdn.jsdelivr.net/npm/maplibre-gl@3.6.2/dist/maplibre-gl.js
Used by
named by URL in GlobalGrid2050 Historical Builds (estate URL), named by URL in Homepage V030 (estate URL), named by URL in Homepage V031 (estate URL), named by URL in Homepage V032 (estate URL), named by URL in Homepage V033 (estate URL), named by URL in Homepage V034 (estate URL), named by URL in Homepage V035 (estate URL), named by URL in Homepage V036 (estate URL)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/index.html:1-254 · blob 4695221d44691cdb1aa95169f117b78431db7d8e · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>GlobalGrid2050 | UK Region v6 (Experimental)</title>
    <link href="https://cdn.jsdelivr.net/npm/maplibre-gl@3.6.2/dist/maplibre-gl.css" rel="stylesheet" />
    <link href="ventusv6.css" rel="stylesheet" />
</head>
<body>

<div id="fatal-banner">CRITICAL ERROR: SYSTEM DEPENDENCIES FAILED TO LOAD</div>
<button id="btn-fullscreen-exit" onclick="exitFullscreen()">✕ Exit</button>
<div id="fs-curtain-tab">⬇ Layers</div>
<div id="fs-curtain"><div id="fs-curtain-keys"></div></div>
<div id="fs-letterhead">
    <div class="ventus-main">Ventus</div>
    <div class="ventus-sub">Cables &amp; Connectivity&reg;</div>
</div>

<div class="dashboard">
    <div class="hud-header">
        <div>
            <small style="color:#888">SYSTEM TIME</small><br>
            <span class="hud-val" id="clock">--:--:--</span><br>
            <span id="date" style="font-size: 11px; color: #888;">--/--/----</span>
        </div>
        <div class="ventus-brand">
            <div class="ventus-main">Ventus</div>
            <div class="ventus-sub">Cables &amp; Connectivity&reg;</div>
        </div>
        <div style="text-align:right"><small style="color:#888">2050 TARGET</small><br><span class="hud-val" id="days" style="color:#ff9d00">-- DAYS</span></div>
    </div>

    <div class="map-container" id="map-container">
        <div id="map"></div>
        <div class="custom-map-attrib">
            Data © <a href="https://www.openstreetmap.org/copyright" target="_blank" rel="noopener noreferrer">OpenStreetMap contributors</a> | © CARTO | EV data © <a href="https://openchargemap.org" target="_blank" rel="noopener noreferrer">Open Charge Map</a>
        </div>
        <button id="btn-fullscreen" onclick="enterFullscreen()" title="Fullscreen">⛶</button>
        <div class="search-bar-wrapper">
            <div style="position:relative">
                <input class="search-input" id="search-input" type="text" placeholder="Search project name..." autocomplete="off" />
                <div class="search-results" id="search-results"></div>
            </div>
            <button class="search-btn" id="search-btn">GO</button>
        </div>

        <div class="map-controls">
            <button class="map-ctrl-btn" id="btn-export">⬇ Export CSV</button>
            <button class="map-ctrl-btn" id="btn-radius">◎ Radius Search</button>
            <button class="map-ctrl-btn" id="btn-radius-area">◵ Radius Area</button>
            <button class="map-ctrl-btn" id="btn-zonedraw">⬡ Poly Zone</button>
            <button class="map-ctrl-btn" id="btn-status">◑ Status Colours</button>
            <button class="map-ctrl-btn" id="btn-measure">📏 Measure</button>
        </div>

        <div class="radius-popup" id="radius-popup">
            <label>Radius from click</label>
            <div class="radius-input-row">
                <input type="number" id="radius-input" value="10" min="1" max="160" step="1" />
                <span class="radius-unit">km</span>
            </div>
            <div class="radius-hint">1 – 160 km (100 mi) · press Enter to apply</div>
        </div>

        <div class="radius-popup" id="radius-area-popup">
            <label>Measure Area from click</label>
            <div class="radius-input-row">
                <input type="number" id="radius-area-input" value="1" min="0.001" max="160" step="0.001" />
                <span class="radius-unit">km</span>
            </div>
            <div class="radius-hint">Input radius: 0.001 (1m) to 160 km</div>
        </div>

        <div class="radius-popup" id="zonedraw-display">
            <label class="polyzone-label">🔶 Poly Zone Tool</label>
            <div class="radius-input-row">
                <input type="number" id="zonedraw-radius-input" value="2" min="0.1" max="160" step="0.1" />
                <span class="radius-unit">km</span>
            </div>
            <div class="radius-hint">Set starting radius, then click map to create zone</div>
            <button id="btn-zonedraw-undo" title="Undo last vertex" style="margin-top:8px;background:#ff6600;color:#000;border:none;padding:6px 12px;border-radius:4px;cursor:pointer;font-weight:bold;font-size:12px;">↩ Undo Point</button>
        </div>

        <div id="measure-display">
            <div class="m-row" id="m-line" style="display:none">━━ <span id="m-km"></span> km | <span id="m-m"></span> m | <span id="m-mi"></span> mi</div>
            <div class="m-row" id="m-perim" style="display:none">Perimeter: <span id="m-pkm"></span> km | <span id="m-pm"></span> m</div>
            <div class="m-row" id="m-area" style="display:none">Area: <span id="m-km2"></span> km² | <span id="m-ha"></span> ha | <span id="m-ac"></span> ac</div>
            <div class="m-hint" id="m-hint">Click to add points · Double-click to close polygon</div>
            <button id="btn-measure-undo" title="Undo last point">↩ Undo Point</button>
        </div>

        <div id="polyzone-display">
            <div class="m-row" id="pz-area" style="display:none">
                <span id="pz-km2"></span> km² · <span id="pz-ha"></span> ha<br>
                <span id="pz-ac"></span> ac · <span id="pz-mi2"></span> mi²<br>
                <span id="pz-m2"></span> m²<br>
                <span style="color:#ffae00">⚽ <span id="pz-pitch"></span> pitches</span>
            </div>
            <div class="m-row" id="pz-perim" style="display:none">
                <span style="color:#555;font-size:9px">perimeter <span id="pz-pkm"></span> km</span>
            </div>
            <div class="m-hint" id="pz-hint">Click map to drop circle</div>
            <button id="btn-polyzone-undo" title="Undo last vertex">↩ Undo Vertex</button>
        </div>

        <div class="podcast-shoutout">In support of The Future of Solar Photovoltaics podcast<br>&amp; all participants to date</div>
    </div>

    <div class="scada-wrapper">
        <div class="scada-brand">
            <div>
                <div class="scada-brand-main">Ventus</div>
                <div class="scada-brand-sub">Cables &amp; Connectivity&reg;</div>
            </div>
            <div class="scada-brand-tag">globalgrid2050.com | open infrastructure intelligence</div>
        </div>
        <div class="status-legend">
            <div class="status-dot"><span style="background:#00ff88"></span>Operational</div>
            <div class="status-dot"><span style="background:#ffcc00"></span>Under Construction</div>
            <div class="status-dot"><span style="background:#ff8800"></span>Consented</div>
            <div class="status-dot"><span style="background:#8888ff"></span>Applied</div>
        </div>
        <div class="scada-keys" id="scada-ui-container"></div>
        <div class="disclaimer-box">
            This interface is based on publicly available and open source infrastructure data, including public energy datasets such as REPD where applicable. It is presented for analytical and visualisation purposes only and does not include live operational or other non public operational data.
        </div>
    </div>
</div>

<script src="https://cdn.jsdelivr.net/npm/maplibre-gl@3.6.2/dist/maplibre-gl.js"></script>
<script src="ventus-corev6engine.js"></script>

<script>
    const ukConfig = [
        {
            group: "Topology (GeoJSON)",
            layers: [
                { id: "400",  label: "400kV", color: "#0054ff", type: "line", width: 2.5, url: "data/grid_400kv.geojson", snap: true, preload: true },
                { id: "275",  label: "275kV", color: "#ff0000", type: "line", width: 2.0, url: "data/grid_275kv.geojson", snap: true, preload: true },
                { id: "220",  label: "220kV", color: "#ff9900", type: "line", width: 1.8, url: "data/grid_220kv.geojson", snap: true, preload: true },
                { id: "132",  label: "132kV", color: "#00cc00", type: "line", width: 1.5, url: "data/grid_132kv.geojson", snap: true, preload: true },
                { id: "66",   label: "66kV",  color: "#b200ff", type: "line", width: 1.2, url: "data/grid_66kv.geojson", snap: true, preload: true },
                { id: "11kv", label: "11kV (UKPN)", color: "#ff00ff", type: "point", radius: ['interpolate', ['linear'], ['zoom'], 13.5, 4, 15, 8, 18, 18], url: "data/grid_11kv_ukpn.geojson", minzoom: 13.5, preload: false },
                { id: "subs", label: "Subs",  color: "#ffffff", type: "point", radius: ['interpolate', ['linear'], ['zoom'], 5, 3, 10, 5, 14, 10, 18, 22], url: "data/grid_substations.geojson", isSubs: true, preload: true }
            ]
        },
        {
            group: "Assets (GeoJSON)",
            layers: [
                { id: "nuc",  label: "Nuclear",   color: "#39ff14", type: "point", radius: 4.5, url: "data/power_plants.geojson", filter: ['==', ['get', 'source'], 'nuclear'], preload: true },
                { id: "gas",  label: "Gas",       color: "#ff4500", type: "point", radius: 4.5, url: "data/power_plants.geojson", filter: ['!=', ['get', 'source'], 'nuclear'], preload: true },
                { id: "ind",  label: "Industry",  color: "#ff6600", type: "point", radius: 4.5, url: "data/industrial_offtakers.geojson", preload: true },
                { id: "dc",   label: "Data Ctrs", color: "#00ffff", type: "point", radius: 4.5, url: "data/datacentres.geojson", preload: true },
                { id: "air",  label: "Airports",  color: "#ff00ff", type: "point", radius: 4.5, url: "data/airports.geojson", preload: true },
                { id: "rail", label: "Railways",  color: "#ffd700", type: "point", radius: 4.5, url: "data/railways.geojson", preload: true }
            ]
        },
        {
            group: "Supermarkets (GeoJSON)",
            layers: [
                { id: "tesco",      label: "Tesco",       color: "#ee1c2e", type: "point", radius: 4.5, url: "data/supermarkets_tesco.geojson", preload: false },
                { id: "sainsburys", label: "Sainsbury's", color: "#ff8200", type: "point", radius: 4.5, url: "data/supermarkets_sainsburys.geojson", preload: false },
                { id: "asda",       label: "Asda",        color: "#78be20", type: "point", radius: 4.5, url: "data/supermarkets_asda.geojson", preload: false },
                { id: "morrisons",  label: "Morrisons",   color: "#ffd700", type: "point", radius: 4.5, url: "data/supermarkets_morrisons.geojson", preload: false },
                { id: "aldi",       label: "Aldi",        color: "#003087", type: "point", radius: 4.5, url: "data/supermarkets_aldi.geojson", preload: false },
                { id: "lidl",       label: "Lidl",        color: "#0050aa", type: "point", radius: 4.5, url: "data/supermarkets_lidl.geojson", preload: false },
                { id: "waitrose",   label: "Waitrose",    color: "#7ab800", type: "point", radius: 4.5, url: "data/supermarkets_waitrose.geojson", preload: false },
                { id: "ms",         label: "M&S Food",    color: "#009b77", type: "point", radius: 4.5, url: "data/supermarkets_ms.geojson", preload: false },
                { id: "coop",       label: "Co-op",       color: "#00b1a9", type: "point", radius: 4.5, url: "data/supermarkets_coop.geojson", preload: false },
                { id: "costco",     label: "Costco",      color: "#005daa", type: "point", radius: 4.5, url: "data/supermarkets_costco.geojson", preload: false },
                { id: "booths",     label: "Booths",      color: "#6d2077", type: "point", radius: 4.5, url: "data/supermarkets_booths.geojson", preload: false }
            ]
        },
        {
            group: "Transit (GeoJSON)",
            layers: [
                { id: "elizabeth", label: "Elizabeth Line", color: "#60399E", type: "point", radius: 5, url: "data/elizabeth_line.geojson", preload: false },
                { id: "lu",    label: "London Underground", color: "#e32017", type: "point", radius: 5, url: "data/london_underground.geojson", preload: false },
                { id: "dlr",   label: "DLR", color: "#00afad", type: "point", radius: 5, url: "data/uk_metros_trams.geojson", preload: false,
                  filter: ['all', ['in', 'Docklands', ['get', 'operator']], ['!', ['in', 'London Underground', ['get', 'operator']]]] },
                { id: "metro", label: "UK Metro", color: "#f3a712", type: "point", radius: 5, url: "data/uk_metros_trams.geojson", preload: false,
                  filter: ['any', ['in', 'Tyne', ['get', 'operator']], ['in', 'Metrolink', ['get', 'operator']], ['in', 'Supertram', ['get', 'operator']], ['in', 'Nottingham', ['get', 'operator']], ['in', 'Edinburgh', ['get', 'operator']], ['in', 'Midland Metro', ['get', 'operator']]] },
                { id: "tram",  label: "Trams & Light Rail", color: "#84329b", type: "point", radius: 5, url: "data/uk_metros_trams.geojson", preload: false,
                  filter: ['all', ['==', ['get', 'type'], 'Tram / Light Rail'], ['!', ['in', 'London Underground', ['get', 'operator']]]] },
                { id: "hs2",   label: "HS2", color: "#2c6fad", type: "point", radius: 4, url: "data/hs2.geojson", preload: false },
                { id: "eurostar_route", label: "Eurostar (HS1) UK & Europe", color: "#001489", type: "line", width: 2.5, url: "data/eurostar.geojson", filter: ['==', ['get', 'type'], 'route'], preload: false },
                { id: "eurostar_station", label: "Eurostar Stations UK & Europe", color: "#ffd700", type: "point", radius: 5.5, url: "data/eurostar.geojson", filter: ['==', ['get', 'type'], 'eurostar_station'], preload: false }
            ]
        },
        {
            group: "Leisure & Sports (GeoJSON)",
            layers: [
                { id: "stadiums", label: "Major Stadiums", color: "#e5ff00", type: "point", radius: 5.5, url: "data/stadiums.geojson", preload: false }
            ]
        },
        {
            group: "Global Data Backbone",
            layers: [
                { id: "subsea_data_cables", label: "Subsea Data Cables (Fibre) (not all connections available yet)", color: "#00e5ff", type: "line", width: 1.5, url: "data/subsea_data_cables.geojson", preload: false }
            ]
        },
        {
            group: "Global Supply Chain & Chokepoints",
            layers: [
                { id: "global_ports_major", label: "Major Ports (Deep Water/Ferry)", color: "#00bfff", type: "point", radius: ['interpolate', ['linear'], ['get', 'area_ha'], 0, 8, 80, 10, 500, 16], url: "data/global_ports.geojson", filter: ['==', ['get', 'type'], 'Major Cargo/Container Port'], preload: false },
                { id: "global_ports_minor", label: "Inland / Minor Harbours", color: "#0055aa", type: "point", radius: ['interpolate', ['linear'], ['get', 'area_ha'], 0, 2.5, 50, 4.5, 200, 6], url: "data/global_ports.geojson", filter: ['==', ['get', 'type'], 'Minor/Local Harbour'], preload: false },
                { id: "global_hydrocarbons", label: "Global Hydrocarbons (Oil, Gas, LNG)", color: "#ff3300", type: "point", radius: ['interpolate', ['linear'], ['get', 'area_ha'], 0, 4, 100, 8, 1000, 15], url: "data/global_hydrocarbons.geojson", preload: false }
            ]
        },
        {
            group: "Highway Infrastructure",
            layers: [
                { id: "motorway_services", label: "Motorway Services", color: "#ff00ff", type: "point", radius: 5.5, url: "data/motorway_services.geojson", preload: false }
            ]
        },
        {
            group: "EV (GeoJSON)",
            layers: [
                { id: "ev", label: "EV Rapid (100kW+)", color: "#00ff88", type: "point", radius: 5, url: "data/ev_chargers.geojson", preload: false }
            ]
        },
        {
            group: "REPD (GeoJSON)",
            layers: [
                { id: "solar",      label: "Solar PV",               color: "#ffff00", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'solar'],      preload: false },
                { id: "solar_operational", label: "Solar PV (Operational Only)", color: "#00ff88", type: "point", radius: ['interpolate', ['linear'], ['coalesce', ['get', 'capacity'], 0], 0, 10, 10, 14, 50, 18, 100, 22, 200, 28, 350, 35, 500, 42], url: "/dist/repd_master.json", filter: ['all', ['==', ['get', 'tech'], 'solar'], ['==', ['get', 'status'], 'operational']], preload: false },
                { id: "solar_roof", label: "Solar Roof",             color: "#ffcc00", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'solar_roof'], preload: false },
                { id: "wind",       label: "Wind",                   color: "#00ffff", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'wind'],       preload: false },
                { id: "wind_onshore_operational",  label: "Onshore Wind (Operational Only)",  color: "#00ffcc", type: "point", radius: ['interpolate', ['linear'], ['coalesce', ['get', 'capacity'], 0], 0, 8, 10, 12, 50, 16, 100, 20, 200, 26, 350, 32, 500, 38], url: "/dist/repd_master.json", filter: ['all', ['==', ['get', 'raw_tech'], 'Wind Onshore'], ['==', ['get', 'status'], 'operational']], prelo  … [line shortened here: 412 characters; full line on GitHub]
                { id: "wind_offshore_operational", label: "Offshore Wind (Operational Only)", color: "#0066ff", type: "point", radius: ['interpolate', ['linear'], ['coalesce', ['get', 'capacity'], 0], 0, 8, 10, 12, 50, 16, 100, 20, 200, 26, 350, 32, 500, 38], url: "/dist/repd_master.json", filter: ['all', ['==', ['get', 'raw_tech'], 'Wind Offshore'], ['==', ['get', 'status'], 'operational']], prel  … [line shortened here: 413 characters; full line on GitHub]
                { id: "bess",       label: "Battery Storage",        color: "#ffae00", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'bess'],       preload: false },
                { id: "bess_operational", label: "Battery Storage (Operational Only)", color: "#ff69b4", type: "point", radius: ['interpolate', ['linear'], ['coalesce', ['get', 'capacity'], 0], 0, 8, 10, 12, 50, 16, 100, 20, 200, 26, 350, 32, 500, 38], url: "/dist/repd_master.json", filter: ['all', ['==', ['get', 'tech'], 'bess'], ['==', ['get', 'status'], 'operational']], preload: false },
                { id: "biomass",    label: "Biomass & EfW",          color: "#39ff14", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'biomass'],    preload: false },
                { id: "tidal",      label: "Tidal & Wave",           color: "#00bfff", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'tidal'],      preload: false },
                { id: "hydrogen",   label: "Hydrogen",               color: "#ffffff", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'hydrogen'],   preload: false },
                { id: "hydro",      label: "Hydro & Pumped Storage", color: "#00aaff", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'hydro'],      preload: false },
                { id: "flywheel",   label: "Flywheel",               color: "#ff69b4", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'flywheel'],   preload: false },
                { id: "act",        label: "Advanced Conversion",    color: "#ff6600", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'act'],        preload: false },
                { id: "geothermal", label: "Geothermal",             color: "#ff3300", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'geothermal'], preload: false },
                { id: "caes",       label: "Compressed Air Storage", color: "#88aaff", type: "point", radius: 8, url: "/dist/repd_master.json", filter: ['==', ['get', 'tech'], 'caes'],       preload: false }
            ]
        }
    ];

    window.initVentusMap({
        config: ukConfig,
        center: [-3.5, 54.0],
        zoom: 4.2
    });
</script>
</body>
</html>

Fetch 220kV Data v6

A Python command-line tool in the scripts folder of GlobalGrid2050 that fetches grid 220kV and cables from OpenStreetMap (Overpass).

storageglobalgrid2050 / repd_grid_atlasv6/scripts/fetch_220kv_datav6.py · lines 1–59 of 59 · Entry point

What it does
It fetches grid 220kV and cables. Defines fetch_220kv_data. Uses libraries requests, json, time. Side effects: reads or writes files; makes network requests.
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: cables, 220kV.
Inputs & outputs
In: data source: OpenStreetMap (Overpass); GeoJSON file grid_220kv.geojson. Out: JSON file. Voltage levels named: 220kV.
Downstream impact
It is itself an entry point (Python CLI); no other file was found loading it.
What it achieves
Its name says it fetches 220kV data. Defines `fetch_220kv_data`. Its code works with 220 kV.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · repd_grid_atlasv6/scripts · Python CLI
Uses
requests, json, time
Used by
none found
Produces
fetch_220kv_data
Defines here
fetch_220kv_data
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/scripts/fetch_220kv_datav6.py:1-59 · blob 8b83784c33db0d5d4afbf3af720247644fbd5c42 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: filesystem, network · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
import requests
import json
import time

def fetch_220kv_data(filename="grid_220kv.geojson"):
    print("\n🌊 Fetching 220kV UK Network (Offshore Cables & Interconnectors)...")
    
    query = """
    [out:json][timeout:300];
    area(3600062149)->.uk;
    (
      way["power"="line"]["voltage"~"220000"](area.uk);
      way["power"="cable"]["voltage"~"220000"](area.uk);
    );
    out geom;
    """
    
    url = "https://overpass-api.de/api/interpreter"
    
    for attempt in range(3):
        print(f"Attempt {attempt + 1} of 3...")
        response = requests.post(url, data={'data': query})
        
        if response.status_code == 200:
            print("✅ 220kV Data successfully downloaded!")
            break
        elif response.status_code == 429:
            print("⚠️ Server busy, sleeping 60s...")
            time.sleep(60)
        else:
            print(f"❌ Error: {response.text[:100]}")
            return

    try:
        osm_data = response.json()
    except ValueError:
        print("❌ Failed to parse JSON.")
        return

    geojson = {"type": "FeatureCollection", "features": []}
    
    for element in osm_data.get('elements', []):
        if element['type'] == 'way' and 'geometry' in element:
            coords = [[node['lon'], node['lat']] for node in element['geometry']]
            feature = {
                "type": "Feature",
                "properties": element.get('tags', {}),
                "geometry": {"type": "LineString", "coordinates": coords}
            }
            geojson['features'].append(feature)
            
    with open(filename, 'w', encoding='utf-8') as f:
        json.dump(geojson, f)
        
    print(f"💾 Saved {len(geojson['features'])} cables/lines to {filename}")

if __name__ == "__main__":
    fetch_220kv_data()

Fetch 66kV Data v6

A Python command-line tool in the scripts folder of GlobalGrid2050 that fetches grid 66kV and cables from OpenStreetMap (Overpass).

storageglobalgrid2050 / repd_grid_atlasv6/scripts/fetch_66kv_datav6.py · lines 1–59 of 59 · Entry point

What it does
It fetches grid 66kV and cables. Defines fetch_66kv_data. Uses libraries requests, json, time. Side effects: reads or writes files; makes network requests.
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: cables, 66kV.
Inputs & outputs
In: data source: OpenStreetMap (Overpass); GeoJSON file grid_66kv.geojson. Out: JSON file. Voltage levels named: 66kV.
Downstream impact
It is itself an entry point (Python CLI); no other file was found loading it.
What it achieves
Its name says it fetches 66kV data. Defines `fetch_66kv_data`. Its code works with 66 kV.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · repd_grid_atlasv6/scripts · Python CLI
Uses
requests, json, time
Used by
none found
Produces
fetch_66kv_data
Defines here
fetch_66kv_data
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 repd_grid_atlasv6/scripts/fetch_66kv_datav6.py:1-59 · blob b42ca0f1d2028bf79bf1981680ef75fd87666cc6 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: filesystem, network · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
import requests
import json
import time

def fetch_66kv_data(filename="grid_66kv.geojson"):
    print("\n⚡ Fetching 66kV UK Network (Legacy Onshore & Offshore Inter-Array)...")
    
    query = """
    [out:json][timeout:300];
    area(3600062149)->.uk;
    (
      way["power"="line"]["voltage"~"66000"](area.uk);
      way["power"="cable"]["voltage"~"66000"](area.uk);
    );
    out geom;
    """
    
    url = "https://overpass-api.de/api/interpreter"
    
    for attempt in range(3):
        print(f"Attempt {attempt + 1} of 3...")
        response = requests.post(url, data={'data': query})
        
        if response.status_code == 200:
            print("✅ 66kV Data successfully downloaded!")
            break
        elif response.status_code == 429:
            print("⚠️ Server busy, sleeping 60s...")
            time.sleep(60)
        else:
            print(f"❌ Error: {response.text[:100]}")
            return

    try:
        osm_data = response.json()
    except ValueError:
        print("❌ Failed to parse JSON.")
        return

    geojson = {"type": "FeatureCollection", "features": []}
    
    for element in osm_data.get('elements', []):
        if element['type'] == 'way' and 'geometry' in element:
            coords = [[node['lon'], node['lat']] for node in element['geometry']]
            feature = {
                "type": "Feature",
                "properties": element.get('tags', {}),
                "geometry": {"type": "LineString", "coordinates": coords}
            }
            geojson['features'].append(feature)
            
    with open(filename, 'w', encoding='utf-8') as f:
        json.dump(geojson, f)
        
    print(f"💾 Saved {len(geojson['features'])} 66kV cables/lines to {filename}")

if __name__ == "__main__":
    fetch_66kv_data()