Skip to content

Latest commit

 

History

History
87 lines (63 loc) · 3.96 KB

File metadata and controls

87 lines (63 loc) · 3.96 KB

map-data

Collection of topojson boundaries to be used for building map visualisations

Available data:

UK

Administrative:

OECD/Eurostat:

  • ITL1 - International Territorial Level 1 (UK): 2025, 2021
  • ITL2 - International Territorial Level 2 (UK): 2025, 2021
  • ITL3 - International Territorial Level 3 (UK): 2025, 2021
  • NUTS1 - Nomenclature of Territorial Units for Statistics 1: (UK 2018), (England & Wales 2015)
  • NUTS2 - Nomenclature of Territorial Units for Statistics 2: (UK 2018), (England & Wales 2015),
  • NUTS3 - Nomenclature of Territorial Units for Statistics 3: (UK 2018), (England & Wales 2015)

Census:

  • Lower layer Super Output Areas (England & Wales): 2021, 2011, 2001
  • Middle layer Super Output Areas (England & Wales): 2021, 2011, 2001

Electoral:

Home Nations:

USA

Cities

  • New York:

World



Mapping with TopoJSON in Vega-Lite / Altair

  1. Get the raw GitHub file link to any of the TopoJSONs:

Note: all TopoJSONs in this repo use the geog feature key.

In Altair (Python)

import altair as alt

topo_url = "https://raw.githubusercontent.com/jhellingsdata/map-data/refs/heads/main/gbr/ITL1_UK_2021.json"
data = alt.Data(url=topo_url, format=alt.DataFormat(feature='geog', type='topojson'))

alt.Chart(data).mark_geoshape().project(
    type='mercator'     # Find other projections here: https://vega.github.io/vega/docs/projections/
)

In Vega-Lite:

{
    "$schema": "https://vega.github.io/schema/vega-lite/v5.20.1.json",
    "data": {
        "url": "https://raw.githubusercontent.com/jhellingsdata/map-data/refs/heads/main/gbr/ITL1_UK_2021.json",
        "format": {"feature": "geog", "type": "topojson"}
    },
    "mark": {"type": "geoshape"},
    "projection": {"type": "mercator"}
}

TopoJSON works a bit different than GeoJSON in Vega-Lite/Altair. We set the 'feature' instead of the property for xyz..