Copenhagen Phase 1: scaffolding + area + OSM download
- pyproject.toml with all deps (geopandas, contextily, partridge, etc.)
- config/: area.json (3 OSM boundary relations), modes.yaml (subway/s_tog/
light_rail/regional/bus, S-tog scoped to route=light_rail network=Takst),
styling.yaml (zorder/widths/colours/palette/mask/labels)
- build_area.py: fetch 3 relations via OSM API, stitch rings, dissolve to
area.gpkg/area.geojson (City Pass approximation)
- download_osm.py: per-mode Overpass (mirror+backoff, out geom + recurse for
stops), writes {mode}.gpkg (lines+stops) + query text
- download_gtfs.py / gtfs_to_geopackage.py: stubs (blocked on Rejseplanen)
- data/ gitignored (regenerable); output/ tracked
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"description": "City Pass area approximation: Copenhagen Kommune + Frederiksberg Kommune + Amager island (dissolved).",
|
||||
"source": "OpenStreetMap API relation/{id}/full.json",
|
||||
"relations": [
|
||||
{"name": "Kobenhavns Kommune", "id": 2192363},
|
||||
{"name": "Frederiksberg Kommune", "id": 2186660},
|
||||
{"name": "Amager", "id": 5175924}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
# Mapping of map modes to OSM route filters, GTFS route types, and style keys.
|
||||
# `style` references a key in styling.yaml.
|
||||
#
|
||||
# OSM filter keys map directly to Overpass tag filters. A key suffixed with
|
||||
# `_neq` emits a negated tag filter (["k"!="v"]); any other key emits an
|
||||
# equality filter (["k"="v"]). The bbox is appended by download_osm.py.
|
||||
#
|
||||
# S-tog are tagged route=light_rail in OSM (NOT route=train); they are scoped
|
||||
# by network="Takst Sjælland". The separate `light_rail` mode catches other
|
||||
# light rail (e.g. Hovedstadens Letbane, opened Aug 2026) via network!=Takst.
|
||||
# GTFS route_type: 0=tram,1=subway,2=rail,3=bus,4=ferry.
|
||||
modes:
|
||||
subway:
|
||||
osm:
|
||||
route: subway
|
||||
gtfs_route_type: 1
|
||||
style: metro
|
||||
s_tog:
|
||||
osm:
|
||||
route: light_rail
|
||||
network: "Takst Sjælland"
|
||||
gtfs_route_type: 2
|
||||
style: s_tog
|
||||
light_rail:
|
||||
osm:
|
||||
route: light_rail
|
||||
network_neq: "Takst Sjælland"
|
||||
gtfs_route_type: 2
|
||||
style: light_rail
|
||||
regional:
|
||||
osm:
|
||||
route: train
|
||||
gtfs_route_type: 2
|
||||
style: regional
|
||||
bus:
|
||||
osm:
|
||||
route: bus
|
||||
network: Movia
|
||||
gtfs_route_type: 3
|
||||
style: bus
|
||||
@@ -0,0 +1,77 @@
|
||||
# Styling for the Copenhagen transit map. Referenced by render.py and prepare.py.
|
||||
# Colours keyed by `style` (from modes.yaml) then route ref.
|
||||
# zorder is draw order bottom->top (higher drawn later / on top).
|
||||
|
||||
zorder:
|
||||
bus: 1
|
||||
s_tog: 2
|
||||
light_rail: 3
|
||||
regional: 4
|
||||
metro: 5
|
||||
|
||||
line_width: # body width in points (outline = body + outline_width)
|
||||
bus: 0.8
|
||||
s_tog: 2.0
|
||||
light_rail: 2.0
|
||||
regional: 1.8
|
||||
metro: 2.6
|
||||
|
||||
outline_width: 1.2 # added to line_width for the dark casing
|
||||
outline_color: "#2b2b2b"
|
||||
|
||||
alpha:
|
||||
bus: 0.45
|
||||
s_tog: 0.95
|
||||
light_rail: 0.95
|
||||
regional: 0.9
|
||||
metro: 1.0
|
||||
|
||||
# Fallback palette when no GTFS route_color and no OSM colour tag are present.
|
||||
# Metro / S-tog values mirror the OSM colour tags (verified). Regional trains
|
||||
# have no OSM colour, so the palette supplies one.
|
||||
palette:
|
||||
metro:
|
||||
M1: "#008d41"
|
||||
M2: "#ffc600"
|
||||
M3: "#ff0a0a"
|
||||
M4: "#009cd3"
|
||||
s_tog:
|
||||
A: "#00a4eb"
|
||||
B: "#50ae30"
|
||||
Bx: "#adce6d"
|
||||
C: "#f68b1f"
|
||||
E: "#7670b3"
|
||||
F: "#fcc019"
|
||||
H: "#e63511"
|
||||
regional:
|
||||
default: "#7a1b3e"
|
||||
light_rail:
|
||||
default: "#e89b3a"
|
||||
bus:
|
||||
A: "#d6264a"
|
||||
C: "#16a085"
|
||||
S: "#2a6fb5"
|
||||
default: "#c8a80e"
|
||||
|
||||
bus_filters:
|
||||
# ref-based bus categorisation (regex applied to route ref)
|
||||
categories:
|
||||
A: "^\\d+A$"
|
||||
C: "^\\d+C$"
|
||||
S: "^\\d+S$"
|
||||
regular: "^\\d+$"
|
||||
|
||||
mask:
|
||||
fade_distance_m: 2500 # shapeburst fade width outside the area
|
||||
max_alpha: 0.85
|
||||
color: white
|
||||
|
||||
basemap:
|
||||
provider: CartoDB.PositronNoLabels
|
||||
zoom: 14
|
||||
|
||||
labels:
|
||||
show: true
|
||||
styles: [metro, s_tog] # which station types to label
|
||||
min_fontsize: 5
|
||||
max_fontsize: 9
|
||||
Reference in New Issue
Block a user