Mask out Skyttehøj and everything south of it (lat 55.628)

Add south_bound_lat to modes.yaml and a load_south_bound() helper in
prepare.py. When set, the area geometry is intersected with the north
half-plane above the cutoff, so all downstream clipping (lines, stops,
stations) cascades automatically.

Removed: 94 bus stops (including Skyttehøj), 1 station (Vestamager),
and line segments south of the boundary (Metro M1 tail, buses 32-36).
This commit is contained in:
2026-09-18 00:32:02 +02:00
parent b27421aaa1
commit 07dc0b55a0
2 changed files with 21 additions and 0 deletions
+16
View File
@@ -30,6 +30,7 @@ import sys
import geopandas as gpd
import pandas as pd
import yaml
from shapely.geometry import box
from _common import CONFIG, GTFS_RAW, PROCESSED
@@ -69,6 +70,15 @@ def load_bus_whitelist():
}
def load_south_bound():
"""South latitude cutoff from modes.yaml, or None.
When set, stops/stations south of (and transit lines below) this
latitude are dropped. Used to trim the map at a boundary.
"""
return _load_modes_yaml().get("south_bound_lat")
def _load_modes_yaml():
return yaml.safe_load((CONFIG / "modes.yaml").read_text())
@@ -331,6 +341,12 @@ def main():
styling = load_styling()
area_geom = load_area()
south_bound = load_south_bound()
if south_bound is not None:
north = box(-180, south_bound, 180, 90)
area_geom = area_geom.intersection(north)
print(f"south bound: clipping area at lat {south_bound}", flush=True)
routes = load_routes(modes, load_exclude())
bus_wl = load_bus_whitelist()