MapToGrid

About

MapToGrid builds a synthetic transmission-level grid for any region you select, entirely on your device, and opens it in an interactive power flow viewer.

What this is

Choose a country or draw a box, press Generate, and a WebAssembly engine sites buses, wires them into a network, sizes loads and generators, and checks the result with optimal power flow. The grid then opens in the embedded tellegen viewer, where you can run DC optimal power flow, read locational marginal prices, and drag demand and rating sliders to see sensitivities. Nothing you draw or generate leaves the browser: the only network traffic is the static site itself, basemap tiles, and, in OpenStreetMap mode, a query to a public Overpass server.

In a browser that offers WebMCP, an AI agent working in the same tab can do the same through tools: generate a grid for a country or a box, then inspect, query and edit it in the viewer. The Agent panel lists the tools and logs every call.

How a grid is generated

Generation runs as a sequence of stages. The progress panel shows the same names.

  1. Context. Measure the region, size its peak demand from national electricity demand and pick a bus count.
  2. Site buses. Place buses on populated places, weighted by population, with blue-noise infill, and spread the peak demand over them.
  3. Topology. Connect them into a meshed network with small-world statistics.
  4. Electrify. Assign voltage levels, impedances and ratings, size generation area by area, and plan the circuits and reactive support the peak dispatch needs.
  5. DC OPF. Solve a DC optimal power flow to check that the grid can serve its load.
  6. Calibrate. Search ratings, generation capacity and, if allowed, load scale for a better fit, re-solving the DC OPF for every step.
  7. AC power flow. Run an AC power flow and check bus voltages against the planning and emergency bands.
  8. Finalize. Write the case, the report and the provenance record.

Buses are sited on Natural Earth populated places, weighted by population, with additional points filled in by blue-noise sampling so sparsely populated areas are still covered. The topology targets the small-world statistics reported for real transmission networks (branch to bus ratio, degree distribution, clustering). Voltage tiers, per-kilometre impedance and rating tables, and generators with capacity margins and cost curves follow published synthetic-grid methods. Unless the Generation panel names voltage levels, the region is modelled at the transmission levels of its main country by demand: 380 and 220 kV in Germany, 400 and 275 kV in Great Britain, 500, 345 and 230 kV in the United States. A country missing from the engine's ladder table takes 400 and 220 kV, and the report says so. The report lists the levels each grid used and where they came from. Generation is deterministic: the same region, seed and parameters always produce the same case.

Peak demand comes from each place's country: its annual electricity demand, from Ember's Yearly Electricity Data via Our World in Data (2024 for most countries), as an average load, times a peak factor of 1.3. The places table lists a country's cities, which hold only part of its people, so the peak splits in two. The share its listed places explain (their population over the national population) follows those places by population. The rest is spread over the country's area, and a region takes it for the part of the country it covers, up to its share of the country's listed people. A region that holds a whole country carries that country's peak, a box around a few cities takes only the part of the country it covers, and a region across a border counts each country on its own. The factor is a modelling choice at the low end of measured systems, because Ember's demand counts losses and self-supplied use that operators' peaks leave out. A place up to 15 km outside the region's simplified outline, such as a harbour the outline cuts off at the coast, joins it when the region holds at least half of that country's people in the places table. The bus count follows the region's area and density, kept between 30 and 150 MW of peak load per bus and capped at 3,000 buses. No bus carries more than the load cap of the highest modelled level (7 GW at 500 kV, 2.9 GW at 400 kV); the excess moves to the nearest buses with room.

Generation is sized area by area: groups of about 10 GW of nearby load each hold the reserve margin of their own load, so the network carries transfers between neighbouring areas. The network plan adds circuits until none runs above 90% of its rating at peak. A corridor that would need more than two circuits at its voltage is raised to the next level, and no corridor holds more than four. Above the ladder, the plan may add only a higher level the country has in service (765 kV in the United States, India and Brazil, 750 kV in Russia, 1,000 kV in China), or 765 kV above levels named in the panel; a country with none, as in most of Europe, keeps its ceiling, and a corridor short of capacity at four circuits stays short. The plan also aims to hold each island's angle spread within the St. Clair stability margin (44.4°) without passing 1.6 branches per bus. When it cannot, the report says the plan is incomplete. A loaded bus more than 480 km of corridor from any generator, a load pocket fed over long lines, gets a synchronous condenser: a machine with no active power that holds the pocket's voltage with reactive power, about 0.5 Mvar per MW of the load nearest it. Without one, such a pocket's AC power flow can stall while its lines are well inside their ratings. The report and the result card count condensers apart from generators.

Calibration and validation

After the network is electrified, the engine solves a DC optimal power flow and then calibrates: a recorded search over a rating multiplier per line class, a capacity multiplier per fuel, rating notches on binding branches and, only when the request allows it, a load multiplier. Every candidate is checked with an exact DC OPF re-solve and kept only if it lowers the objective, whose terms are DC infeasibility, loading above the target, an under-used 90th-percentile branch, the share of binding branches against its reference range and any reserve shortfall. Mean degree and the share of high-voltage buses are reported beside them, but these parameters cannot move them. Last, an AC power flow looks for a voltage solution and checks every bus against the planning band (0.95 to 1.05 pu) and the emergency band (0.9 to 1.1 pu); a solution with buses outside either band counts as a failed check.

Calibrated means the targets are met. A calibrated grid does not reproduce the flows, prices or outages of any real system. The Report panel states the outcome in words (targets met, improved, unchanged, infeasible or off), lists every step with its change and whether it was kept, and gives the solver statuses. When nothing improves, the report says unchanged; no figure is adjusted after the fact.

Data sources and attribution

Country boundaries
Natural Earth, 1:110m Admin 0 countries. Public domain.
Populated places
Natural Earth populated places, shipped with the engine. Public domain.
Electricity demand
Ember, Yearly Electricity Data, via Our World in Data's energy dataset: each country's annual electricity demand and population, 2024 for most countries, compiled into the engine. Both under CC BY 4.0.
Voltage levels
A table of national transmission voltage ladders compiled into the engine from national transmission operators' and regulators' documents, the ENTSO-E members list and IEC 60038; it copies no dataset. Country areas for the demand split are measured from Natural Earth's 1:50m countries (public domain).
OpenStreetMap mode
Only power=* features (substations, plants and lines) are queried, from the public Overpass server overpass-api.de, and also from overpass.kumi.systems and overpass.private.coffee when it is slow or busy. Data © OpenStreetMap contributors, under the Open Database License. OpenStreetMap mode is off by default; answers are kept in your browser for a day so a repeat does not query the servers again.
Basemap
CARTO Dark Matter (© CARTO, data © OpenStreetMap contributors), with OpenFreeMap (© OpenMapTiles, data © OpenStreetMap contributors) as the fallback when CARTO cannot be shown. Whenever OpenFreeMap is on screen, its road lines start at zoom 8 and its water and land are recoloured so the network stands out. Attribution is always shown on the map.
Engine and viewer
tellegen (MIT) and powerio (MIT or Apache-2.0), compiled to WebAssembly.
Fonts
Atkinson Hyperlegible Next and IBM Plex Mono, self-hosted. No external font service.

Limitations

  • Synthetic mode places buses by population. It uses no surveys or utility records.
  • Peak demand is a national annual average times a fixed factor. Inside a country it follows population, so industrial load centres are not modelled.
  • Continental regions (Russia, the United States, China, India, Brazil) are generated as one AC island. Real systems that size split into synchronous areas joined by HVDC links, which the generator does not model. Their network plan cannot hold the angle spread within the stability margin, so the report says the plan is incomplete, and the AC power flow may not converge or may settle with voltages outside the bands.
  • No critical-infrastructure disclosure: synthetic mode uses no infrastructure data at all, and OpenStreetMap mode uses only tags that are already public.
  • A grid that passes the DC OPF can still fail the AC power flow. Neither check assesses reliability or N-1 security.
  • Some grids fail a check: the DC OPF can find no feasible dispatch, or the AC power flow can fail to converge or converge with bus voltages outside the planning or emergency band, mostly for very large regions or demands. The result card and the report say which check failed, in words.
  • The region area is capped so that generation and the solver fit in browser memory. Larger regions can be generated at lower density. OpenStreetMap mode takes regions up to about 600,000 km², out of consideration for the public Overpass servers.
  • When OpenStreetMap has too little mapped data for a region, or no Overpass server answers, the app says so and offers a synthetic grid. It only switches when you choose to, and the report of the synthetic grid records why it was made.
  • The map requires WebGL 2. Without it the panels and exports still work, but the map stays blank.

Reproducibility

The address bar carries the region, the seed and every parameter. The same URL produces the same case, down to the bytes of the exported module, because the engine is deterministic and the WebAssembly build is pinned. The generation report records the seed, a hash of the request, the engine and parameter table versions, a hash of the populated places table, the year and hashes of the national demand and country area tables, the version and hash of the voltage ladder table and, in OpenStreetMap mode, the Overpass timestamp and a hash of the response.

Accessibility statement

MapToGrid aims to conform to the Web Content Accessibility Guidelines (WCAG) 2.2 at level AA. We check it with automated tests (axe-core with the WCAG 2.0, 2.1 and 2.2 A and AA rules) on the landing view, a running generation, the viewer with and without a selected bus, the settings dialog and this page, and by working through the whole app with a keyboard alone.

  • Every function works from the keyboard. A region can be chosen from the country list, typed as coordinates, or drawn on the map with the arrow keys, Space and Enter. Buses are found by number with /, and branches from a list or from the most loaded lines in the Inspect panel. Press ? for the full list of shortcuts.
  • The progress of a generation is a labelled progress bar, stage changes and finished grids are announced, and errors are announced and stay on screen until you act on them.
  • Dialogs keep focus inside and return it to the control that opened them. Panels can be opened from the rail with the digit keys, and closing one returns focus to the control that opened it.
  • Text and interface components meet the AA contrast minimums against the darkest and lightest parts of the basemap, text is never smaller than 12 pixels, and targets are at least 24 pixels (44 on touch screens). This holds for the viewer's panels too, from tellegen interface kit 0.4.0 on.
  • The interface follows the reduced motion setting, which the Settings dialog can also override, and redraws itself with system colours when forced colours are on.

Known limitations. The map itself is drawn with WebGL and is not available to assistive technology. Every value encoded on the map (bus kind, voltage, line loading, prices) is also available as text in the Layers, Inspect and Report panels and in the exports. The viewer's own panels (Network, the solver card, notifications) come from the tellegen interface kit and pass the same automated checks.

If something does not work for you, please open an issue in the tellegen repository and mention the browser and any assistive technology you use.

Privacy

There is no server, no account, no analytics and no cookie. See the privacy page for exactly what leaves the browser.

Licensing

MapToGrid is released under the Apache License 2.0. tellegen is MIT licensed; powerio is MIT or Apache-2.0; the synthetic-grid methods follow published work released under BSD-3; data licences are listed above.

How to cite

If you use grids generated here in a publication, please cite both the app and the engine:

Talkington, S. MapToGrid: synthetic electric grids for any map region, in the
browser (version 0.1.0). 2026. https://maptogrid.com

Talkington, S., Geth, F., Zhang, Q., Xie, L. and Liu, S. Interactive Power Flow
in the Browser. In The Inaugural ACM Conference on Digital Transformation
(ACM DXConf 2026). ACM, 2026. https://doi.org/10.1145/3847238.3849038

MapToGrid v0.1.0. Built on the tellegen engine and UI kit. Apache-2.0.