Skip to content

A Civilization-style strategy game about governing Israel from 15 May 1948. Real ministers, real map, every fact sourced. Unity + deterministic C# sim.

Map: the railways and main roads of 1948 (promo look, roads and rail) (#180)

Eyal Golanf19ae4416c5f
diff --git a/ASSETS.yaml b/ASSETS.yaml
index 5107f7523..b9e9d17e0 100644
--- a/ASSETS.yaml
+++ b/ASSETS.yaml
@@ -103,6 +103,11 @@ rules:
source: "Village Statistics, 1945 (Government of Palestine), figures read from https://en.wikipedia.org/wiki/Village_Statistics,_1945 on 2026-10-11; per-row sources in the file"
status: owner-verify
note: "Presentation only (settlement kit footprints); the sim never reads it. To be checked against a scan of the 1945 publication."
+ - glob: "content/map/route*_1948.yaml"
+ licence: CC-BY-SA-4.0
+ source: "Railways and main roads of May 1948 (issue #35): traced by tools/routes_1948.py on the Survey of Palestine 1:250,000 map of 1946 (public domain; scans and georeferencing by Palestine Open Maps, https://palopenmaps.org/en/maps?basemap=pal250k1946) between waypoints at Wikipedia API (CC BY-SA) and Wikidata (CC0) coordinates; per-route sources and check dates in routes_1948.yaml"
+ status: verified
+ note: "Public domain checked 2026-10-11: PD-UKGov (expired Crown copyright: 50 years from publication for published works, which HMSO treats as worldwide) and PD-scan, as Wikimedia Commons files the 1946 Survey of Palestine sheets (e.g. https://commons.wikimedia.org/wiki/File:Gaza_sh._04,_1946.jpg). Palestine Open Maps' About page calls its maps public domain under the UK Copyright, Designs and Patents Act and publishes no terms of its own for its tiles or georeferencing; the traced lines are our own derivative and copy none of its layers. No OpenStreetMap (ODbL) geometry is copied: OSM and OpenHistoricalMap lines are only measured against (tools/routes_accuracy.py, docs/routes.md)."
# --- Baked map textures (derived from the heightmap) ---
- glob: "unity/Assets/Textures/*"
licence: Copernicus-DEM
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 63f5527e5..b873a2979 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -43,6 +43,12 @@ adds a line under **Unreleased**; CI's `Changelog` job checks this (see `CONTRIB
Spitfire flying a loop with its shadow, and the corvette INS Haganah, built from code as painted miniatures at the
promo's symbolic scale. Shown only with `?units` (desktop `-units`) and in `tools/art_checkpoint.sh --units`; an
authored model can replace a code-built one per unit type (docs/units.md).
+- The railways and main roads of 1948 on the map: the Jaffa–Jerusalem line, the main line from Lydda to Rafah, the
+ Eastern Railway, Hadera–Haifa, Haifa–Acre–Ras an-Naqura and the Jezreel Valley line, with 13 main roads, traced on
+ the public-domain 1946 Survey of Palestine map (`content/map/routes_1948.yaml`, sources per route), drawn as pale dirt
+ roads and ballasted track with sleepers at the promo's scale. Each route shows only from its sourced date: the Burma
+ Road appears on 14 June 1948, when it was completed. Settlement buildings and trees keep clear of every route. A steam train is a showcase only (`?train`, `?units` and the
+ promo screenshots), not normal play. Map-only: the sim does not read them (#35).
### Changed
- Ben-Gurion's Transportation term ends on 24 December 1952, when the Fourth Government took office; the seat
diff --git a/NOTICE b/NOTICE
index 6c7822b0a..43d900e5f 100644
--- a/NOTICE
+++ b/NOTICE
@@ -23,6 +23,9 @@ Rain-gauge data: Israel Meteorological Service, meteorological data archive, dat
Wikipedia (CC BY-SA 4.0): many facts in content/ cite English and Hebrew Wikipedia articles, and the 1948 settlement
coordinates come from the Wikipedia API; each entry lists its source URLs.
+Railways and roads of 1948 (content/map/route*_1948.yaml): traced on the Survey of Palestine 1:250,000 map of 1946
+(public domain), using the scans and georeferencing published by Palestine Open Maps (https://palopenmaps.org).
+
Portraits: public-domain and CC0 photographs from Wikimedia Commons; per-file records in ASSETS.portraits.yaml.
Fonts: EB Garamond, SIL Open Font License 1.1 (unity/Assets/UI/Fonts/OFL.txt).
diff --git a/content/map/route_paths_1948.yaml b/content/map/route_paths_1948.yaml
new file mode 100644
index 000000000..a1f7c9ccb
--- /dev/null
+++ b/content/map/route_paths_1948.yaml
@@ -0,0 +1,2278 @@
+# GENERATED by tools/routes_1948.py from routes_1948.yaml and the Survey of Palestine 1:250,000 map of 1946 (public
+# domain; tiles by Palestine Open Maps). Do not edit by hand: change the waypoints in routes_1948.yaml and re-run.
+# Each route: its id, kind, status and display window (from, to) from routes_1948.yaml; the trace's quality (on_symbol:
+# the share of traced pixels on the route's own map symbol; max_gap_m: the longest run off it, in metres); its length
+# and its line as [lon, lat] pairs, 5 decimals.
+# Map-only: the sim never reads this file, so it does not move the content hash.
+routes:
+- id: jaffa_jerusalem_railway
+ kind: rail
+ status: draft
+ from: '1920-10-05'
+ on_symbol: 1.00
+ max_gap_m: 65
+ length_km: 80.7
+ points:
+ - [34.76117, 32.05894]
+ - [34.76161, 32.05943]
+ - [34.76649, 32.06054]
+ - [34.77525, 32.06053]
+ - [34.77718, 32.05965]
+ - [34.78170, 32.05501]
+ - [34.78297, 32.05093]
+ - [34.78630, 32.04541]
+ - [34.79225, 32.03944]
+ - [34.79636, 32.03598]
+ - [34.79928, 32.03446]
+ - [34.82057, 32.01895]
+ - [34.82366, 32.01744]
+ - [34.82804, 32.01383]
+ - [34.83121, 32.01259]
+ - [34.83921, 32.00669]
+ - [34.84059, 32.00436]
+ - [34.84508, 32.00029]
+ - [34.84787, 31.99650]
+ - [34.85435, 31.99097]
+ - [34.86211, 31.98311]
+ - [34.87212, 31.97462]
+ - [34.87338, 31.97233]
+ - [34.87800, 31.96826]
+ - [34.87943, 31.96549]
+ - [34.88592, 31.95864]
+ - [34.88699, 31.95588]
+ - [34.88637, 31.95413]
+ - [34.87876, 31.94758]
+ - [34.87565, 31.94582]
+ - [34.87079, 31.94146]
+ - [34.86988, 31.93956]
+ - [34.87000, 31.93665]
+ - [34.87341, 31.93077]
+ - [34.87628, 31.92966]
+ - [34.87873, 31.92747]
+ - [34.88013, 31.92356]
+ - [34.88693, 31.91742]
+ - [34.88741, 31.91261]
+ - [34.88933, 31.90999]
+ - [34.88957, 31.90853]
+ - [34.88904, 31.90693]
+ - [34.88683, 31.90489]
+ - [34.88116, 31.90060]
+ - [34.87700, 31.89846]
+ - [34.87359, 31.89308]
+ - [34.87059, 31.88973]
+ - [34.87036, 31.88667]
+ - [34.87134, 31.88419]
+ - [34.87193, 31.87719]
+ - [34.87134, 31.87311]
+ - [34.86875, 31.86999]
+ - [34.86852, 31.86684]
+ - [34.86687, 31.86451]
+ - [34.86537, 31.86028]
+ - [34.86702, 31.85722]
+ - [34.86781, 31.84920]
+ - [34.87010, 31.84570]
+ - [34.87069, 31.84074]
+ - [34.86997, 31.82747]
+ - [34.86720, 31.82193]
+ - [34.86712, 31.81960]
+ - [34.86989, 31.81595]
+ - [34.87021, 31.81041]
+ - [34.87309, 31.80706]
+ - [34.87773, 31.80455]
+ - [34.88030, 31.80384]
+ - [34.88391, 31.80131]
+ - [34.88700, 31.80024]
+ - [34.89587, 31.79360]
+ - [34.89741, 31.79100]
+ - [34.90069, 31.78782]
+ - [34.90518, 31.78414]
+ - [34.90698, 31.78187]
+ - [34.91237, 31.77807]
+ - [34.91884, 31.77116]
+ - [34.92339, 31.76733]
+ - [34.92734, 31.76610]
+ - [34.93027, 31.76368]
+ - [34.93335, 31.76237]
+ - [34.93712, 31.75895]
+ - [34.94742, 31.75916]
+ - [34.95206, 31.75672]
+ - [34.95566, 31.75598]
+ - [34.97489, 31.75628]
+ - [34.98107, 31.75802]
+ - [34.99772, 31.75757]
+ - [35.00459, 31.75633]
+ - [35.01163, 31.75764]
+ - [35.01521, 31.76161]
+ - [35.01626, 31.76216]
+ - [35.02845, 31.76225]
+ - [35.03164, 31.76158]
+ - [35.03583, 31.76516]
+ - [35.03926, 31.76605]
+ - [35.04756, 31.76393]
+ - [35.05024, 31.75875]
+ - [35.05231, 31.75715]
+ - [35.05382, 31.75788]
+ - [35.05575, 31.76022]
+ - [35.05849, 31.76118]
+ - [35.06467, 31.76539]
+ - [35.06742, 31.76602]
+ - [35.06883, 31.76503]
+ - [35.06986, 31.76065]
+ - [35.06541, 31.75636]
+ - [35.06471, 31.75466]
+ - [35.06542, 31.75342]
+ - [35.06794, 31.75158]
+ - [35.07136, 31.75027]
+ - [35.07754, 31.74991]
+ - [35.07920, 31.75116]
+ - [35.08237, 31.75612]
+ - [35.08518, 31.75820]
+ - [35.08698, 31.75874]
+ - [35.08811, 31.75729]
+ - [35.08649, 31.75509]
+ - [35.08602, 31.75151]
+ - [35.08698, 31.75096]
+ - [35.09110, 31.75128]
+ - [35.09282, 31.75055]
+ - [35.09419, 31.74897]
+ - [35.09443, 31.74591]
+ - [35.09557, 31.74456]
+ - [35.09849, 31.74354]
+ - [35.10329, 31.74322]
+ - [35.10638, 31.74144]
+ - [35.11016, 31.74109]
+ - [35.11342, 31.73917]
+ - [35.11754, 31.73804]
+ - [35.11902, 31.73856]
+ - [35.11990, 31.74080]
+ - [35.12183, 31.74266]
+ - [35.12355, 31.74342]
+ - [35.12521, 31.74340]
+ - [35.12603, 31.74268]
+ - [35.12627, 31.74138]
+ - [35.12476, 31.73788]
+ - [35.12492, 31.73642]
+ - [35.12579, 31.73526]
+ - [35.12733, 31.73447]
+ - [35.12921, 31.73443]
+ - [35.13316, 31.73687]
+ - [35.13539, 31.73700]
+ - [35.13713, 31.73569]
+ - [35.13841, 31.73181]
+ - [35.13981, 31.73111]
+ - [35.14089, 31.73129]
+ - [35.15685, 31.74443]
+ - [35.15891, 31.74558]
+ - [35.16372, 31.74588]
+ - [35.17161, 31.74387]
+ - [35.18003, 31.74403]
+ - [35.18174, 31.74466]
+ - [35.18706, 31.74875]
+ - [35.19238, 31.74964]
+ - [35.19599, 31.75150]
+ - [35.19977, 31.75150]
+ - [35.20423, 31.74957]
+ - [35.20629, 31.75002]
+ - [35.21312, 31.75554]
+ - [35.21488, 31.75890]
+ - [35.22466, 31.76678]
+- id: kantara_main_line_south
+ kind: rail
+ status: draft
+ from: '1946'
+ on_symbol: 0.99
+ max_gap_m: 97
+ length_km: 104.1
+ points:
+ - [34.87550, 31.94583]
+ - [34.85490, 31.94125]
+ - [34.84467, 31.94145]
+ - [34.83835, 31.93616]
+ - [34.83533, 31.93523]
+ - [34.83172, 31.93307]
+ - [34.81919, 31.93330]
+ - [34.81749, 31.93276]
+ - [34.81394, 31.92718]
+ - [34.81370, 31.91960]
+ - [34.80997, 31.91567]
+ - [34.80848, 31.91071]
+ - [34.80712, 31.90945]
+ - [34.80460, 31.90916]
+ - [34.80118, 31.90634]
+ - [34.79265, 31.89773]
+ - [34.79183, 31.89512]
+ - [34.78915, 31.89517]
+ - [34.78761, 31.89243]
+ - [34.78435, 31.89201]
+ - [34.78011, 31.89020]
+ - [34.77495, 31.88516]
+ - [34.77267, 31.88402]
+ - [34.76758, 31.87924]
+ - [34.76178, 31.87478]
+ - [34.75877, 31.87349]
+ - [34.75053, 31.86738]
+ - [34.74704, 31.86615]
+ - [34.74565, 31.86387]
+ - [34.74126, 31.86087]
+ - [34.72004, 31.84293]
+ - [34.71751, 31.83870]
+ - [34.71503, 31.83608]
+ - [34.71334, 31.83287]
+ - [34.70419, 31.82383]
+ - [34.70305, 31.82062]
+ - [34.70055, 31.81653]
+ - [34.69262, 31.80763]
+ - [34.69116, 31.80457]
+ - [34.68897, 31.80224]
+ - [34.68673, 31.79815]
+ - [34.67930, 31.79232]
+ - [34.67266, 31.78575]
+ - [34.66957, 31.78152]
+ - [34.66774, 31.77656]
+ - [34.66473, 31.77305]
+ - [34.66481, 31.76970]
+ - [34.66691, 31.76692]
+ - [34.66819, 31.76328]
+ - [34.66580, 31.75846]
+ - [34.66264, 31.75403]
+ - [34.66162, 31.75387]
+ - [34.65938, 31.75461]
+ - [34.65629, 31.75354]
+ - [34.65337, 31.75365]
+ - [34.65035, 31.75131]
+ - [34.64893, 31.74722]
+ - [34.64654, 31.74445]
+ - [34.64575, 31.74138]
+ - [34.64268, 31.73802]
+ - [34.64101, 31.73423]
+ - [34.63844, 31.73160]
+ - [34.63768, 31.72912]
+ - [34.63560, 31.72663]
+ - [34.63373, 31.72298]
+ - [34.62771, 31.71510]
+ - [34.62556, 31.71145]
+ - [34.62304, 31.70897]
+ - [34.62206, 31.70619]
+ - [34.61954, 31.70356]
+ - [34.61425, 31.69611]
+ - [34.61202, 31.68955]
+ - [34.60856, 31.68790]
+ - [34.60625, 31.68530]
+ - [34.60530, 31.68209]
+ - [34.60541, 31.67157]
+ - [34.60427, 31.67113]
+ - [34.59500, 31.67112]
+ - [34.58814, 31.67052]
+ - [34.58724, 31.66999]
+ - [34.58724, 31.66848]
+ - [34.58865, 31.66690]
+ - [34.59809, 31.66152]
+ - [34.60039, 31.65901]
+ - [34.59921, 31.65477]
+ - [34.59656, 31.65167]
+ - [34.59493, 31.64790]
+ - [34.59746, 31.63694]
+ - [34.59437, 31.63197]
+ - [34.58916, 31.62671]
+ - [34.58299, 31.62131]
+ - [34.57880, 31.61876]
+ - [34.57845, 31.61019]
+ - [34.57563, 31.60654]
+ - [34.57519, 31.60317]
+ - [34.57366, 31.60069]
+ - [34.57309, 31.59689]
+ - [34.57155, 31.59469]
+ - [34.57036, 31.59118]
+ - [34.56747, 31.58785]
+ - [34.56328, 31.58475]
+ - [34.56063, 31.58125]
+ - [34.55935, 31.58066]
+ - [34.55774, 31.58124]
+ - [34.55622, 31.57942]
+ - [34.55561, 31.57788]
+ - [34.55637, 31.57212]
+ - [34.55415, 31.57083]
+ - [34.55322, 31.56822]
+ - [34.55023, 31.56515]
+ - [34.54927, 31.56194]
+ - [34.54677, 31.55930]
+ - [34.54528, 31.55682]
+ - [34.53774, 31.54941]
+ - [34.53548, 31.54628]
+ - [34.53185, 31.54443]
+ - [34.52308, 31.53808]
+ - [34.51570, 31.53135]
+ - [34.51175, 31.53062]
+ - [34.50883, 31.52922]
+ - [34.50231, 31.52881]
+ - [34.49681, 31.52440]
+ - [34.49407, 31.52326]
+ - [34.48995, 31.52048]
+ - [34.48103, 31.51570]
+ - [34.47910, 31.51339]
+ - [34.47510, 31.51102]
+ - [34.47003, 31.50943]
+ - [34.46746, 31.50796]
+ - [34.46488, 31.50780]
+ - [34.46352, 31.50719]
+ - [34.46265, 31.50590]
+ - [34.46266, 31.50209]
+ - [34.46464, 31.49980]
+ - [34.46482, 31.49887]
+ - [34.46024, 31.49331]
+ - [34.45304, 31.48734]
+ - [34.44566, 31.48320]
+ - [34.43852, 31.47729]
+ - [34.43687, 31.47501]
+ - [34.43416, 31.47278]
+ - [34.42986, 31.47129]
+ - [34.41613, 31.46121]
+ - [34.41240, 31.45495]
+ - [34.40565, 31.44851]
+ - [34.38060, 31.42727]
+ - [34.37456, 31.42171]
+ - [34.37283, 31.41892]
+ - [34.37000, 31.41617]
+ - [34.36652, 31.41476]
+ - [34.36370, 31.41219]
+ - [34.36038, 31.41013]
+ - [34.35914, 31.40793]
+ - [34.35649, 31.40515]
+ - [34.35511, 31.40105]
+ - [34.35217, 31.39869]
+ - [34.35163, 31.39607]
+ - [34.34962, 31.39255]
+ - [34.34530, 31.38845]
+ - [34.34318, 31.38464]
+ - [34.34067, 31.38215]
+ - [34.33883, 31.37731]
+ - [34.32945, 31.36949]
+ - [34.32509, 31.36500]
+ - [34.32292, 31.36133]
+ - [34.31993, 31.35811]
+ - [34.31851, 31.35532]
+ - [34.31225, 31.34858]
+ - [34.31161, 31.34531]
+ - [34.31039, 31.34477]
+ - [34.30312, 31.34395]
+ - [34.30071, 31.33890]
+ - [34.29647, 31.33528]
+ - [34.29490, 31.33289]
+ - [34.29010, 31.32849]
+ - [34.28544, 31.32242]
+ - [34.28110, 31.31852]
+ - [34.27908, 31.31427]
+ - [34.26597, 31.30298]
+ - [34.26541, 31.30107]
+ - [34.26541, 31.28772]
+ - [34.26474, 31.28523]
+ - [34.26466, 31.27833]
+ - [34.26369, 31.27686]
+ - [34.25855, 31.27246]
+- id: eastern_railway
+ kind: rail
+ status: draft
+ from: '1915'
+ on_symbol: 0.99
+ max_gap_m: 114
+ length_km: 63.7
+ points:
+ - [34.87550, 31.94583]
+ - [34.87807, 31.94690]
+ - [34.88666, 31.95311]
+ - [34.89499, 31.96083]
+ - [34.89683, 31.96316]
+ - [34.89944, 31.96796]
+ - [34.90055, 31.97641]
+ - [34.90228, 31.97947]
+ - [34.90248, 31.98587]
+ - [34.90502, 31.99141]
+ - [34.90544, 31.99359]
+ - [34.90994, 32.00043]
+ - [34.91132, 32.00480]
+ - [34.91411, 32.00844]
+ - [34.91513, 32.01106]
+ - [34.91706, 32.01339]
+ - [34.92246, 32.01776]
+ - [34.92525, 32.02183]
+ - [34.92727, 32.02591]
+ - [34.92741, 32.02954]
+ - [34.92979, 32.03347]
+ - [34.93407, 32.03813]
+ - [34.93524, 32.04468]
+ - [34.93524, 32.05894]
+ - [34.93494, 32.06083]
+ - [34.93335, 32.06388]
+ - [34.93318, 32.09181]
+ - [34.93370, 32.10243]
+ - [34.93463, 32.10490]
+ - [34.93455, 32.11100]
+ - [34.93575, 32.11987]
+ - [34.93304, 32.12394]
+ - [34.93232, 32.13906]
+ - [34.93334, 32.14328]
+ - [34.93373, 32.14837]
+ - [34.93494, 32.15025]
+ - [34.93524, 32.15331]
+ - [34.93684, 32.15563]
+ - [34.93712, 32.15897]
+ - [34.93989, 32.16203]
+ - [34.94415, 32.16827]
+ - [34.94863, 32.17249]
+ - [34.94947, 32.17569]
+ - [34.95667, 32.18673]
+ - [34.95522, 32.19457]
+ - [34.95532, 32.19966]
+ - [34.95731, 32.20300]
+ - [34.95772, 32.20619]
+ - [34.96070, 32.21026]
+ - [34.96305, 32.21265]
+ - [34.96519, 32.21384]
+ - [34.96642, 32.21592]
+ - [34.97019, 32.21970]
+ - [34.97268, 32.22594]
+ - [34.97475, 32.22928]
+ - [34.98054, 32.24192]
+ - [34.98289, 32.24961]
+ - [34.98596, 32.25687]
+ - [34.98871, 32.26022]
+ - [34.98948, 32.26340]
+ - [34.99138, 32.26602]
+ - [34.99310, 32.27298]
+ - [34.99618, 32.27734]
+ - [34.99646, 32.28067]
+ - [34.99916, 32.28401]
+ - [34.99993, 32.28764]
+ - [35.00339, 32.29078]
+ - [35.00927, 32.29417]
+ - [35.01351, 32.30766]
+ - [35.01866, 32.30949]
+ - [35.02433, 32.30975]
+ - [35.02626, 32.31199]
+ - [35.02569, 32.31286]
+ - [35.02227, 32.31309]
+ - [35.01969, 32.31410]
+ - [35.01454, 32.31487]
+ - [35.01166, 32.31855]
+ - [35.01087, 32.32696]
+ - [35.00825, 32.33073]
+ - [35.00778, 32.33479]
+ - [35.00646, 32.33740]
+ - [35.00624, 32.34103]
+ - [35.00462, 32.34378]
+ - [35.00455, 32.34712]
+ - [35.00337, 32.34988]
+ - [35.00277, 32.35771]
+ - [34.99996, 32.36293]
+ - [34.99996, 32.36612]
+ - [35.00084, 32.36858]
+ - [35.00101, 32.37163]
+ - [35.00273, 32.37539]
+ - [35.00278, 32.37960]
+ - [35.00072, 32.38409]
+ - [34.99838, 32.38699]
+ - [34.99774, 32.39062]
+ - [34.99526, 32.39375]
+ - [34.98845, 32.39721]
+ - [34.98033, 32.40250]
+ - [34.97685, 32.40902]
+ - [34.97657, 32.41337]
+ - [34.97547, 32.41569]
+ - [34.97539, 32.41917]
+ - [34.97481, 32.42047]
+ - [34.96872, 32.42786]
+ - [34.96572, 32.43307]
+ - [34.95996, 32.43617]
+ - [34.95601, 32.43699]
+ - [34.95465, 32.43772]
+ - [34.94946, 32.44336]
+ - [34.94966, 32.44612]
+- id: hadera_haifa_railway
+ kind: rail
+ status: draft
+ from: '1918'
+ on_symbol: 0.98
+ max_gap_m: 113
+ length_km: 50.8
+ points:
+ - [34.94966, 32.44612]
+ - [34.94625, 32.44916]
+ - [34.94459, 32.45278]
+ - [34.94156, 32.45669]
+ - [34.94127, 32.45890]
+ - [34.93977, 32.46104]
+ - [34.93970, 32.46292]
+ - [34.94045, 32.46451]
+ - [34.94377, 32.46755]
+ - [34.94700, 32.47327]
+ - [34.94893, 32.47446]
+ - [34.95299, 32.48551]
+ - [34.95270, 32.48739]
+ - [34.95121, 32.49000]
+ - [34.95103, 32.49420]
+ - [34.95152, 32.49666]
+ - [34.94991, 32.50650]
+ - [34.94987, 32.51041]
+ - [34.94871, 32.51360]
+ - [34.94707, 32.51591]
+ - [34.94650, 32.52011]
+ - [34.94413, 32.52228]
+ - [34.93950, 32.52836]
+ - [34.93764, 32.53184]
+ - [34.93199, 32.53661]
+ - [34.92878, 32.54124]
+ - [34.92820, 32.55730]
+ - [34.93044, 32.56497]
+ - [34.93058, 32.56786]
+ - [34.92788, 32.57293]
+ - [34.92782, 32.57698]
+ - [34.92681, 32.57929]
+ - [34.92637, 32.58291]
+ - [34.92466, 32.58653]
+ - [34.92419, 32.59217]
+ - [34.92222, 32.59766]
+ - [34.92219, 32.60214]
+ - [34.92241, 32.60807]
+ - [34.92514, 32.62571]
+ - [34.92716, 32.62918]
+ - [34.92733, 32.63193]
+ - [34.92666, 32.63439]
+ - [34.92834, 32.63702]
+ - [34.92840, 32.64017]
+ - [34.93022, 32.64798]
+ - [34.93052, 32.65289]
+ - [34.93136, 32.65520]
+ - [34.93129, 32.66402]
+ - [34.93225, 32.67110]
+ - [34.93342, 32.67587]
+ - [34.93533, 32.67861]
+ - [34.93582, 32.68266]
+ - [34.93715, 32.68584]
+ - [34.93724, 32.69216]
+ - [34.93965, 32.69373]
+ - [34.93852, 32.69754]
+ - [34.94015, 32.70216]
+ - [34.94199, 32.71198]
+ - [34.94433, 32.71516]
+ - [34.94492, 32.71704]
+ - [34.94483, 32.72469]
+ - [34.94671, 32.73697]
+ - [34.94887, 32.74144]
+ - [34.95003, 32.75328]
+ - [34.95170, 32.75631]
+ - [34.95158, 32.76613]
+ - [34.95342, 32.77522]
+ - [34.95398, 32.78460]
+ - [34.95624, 32.78792]
+ - [34.95499, 32.79398]
+ - [34.95498, 32.80409]
+ - [34.95402, 32.80856]
+ - [34.95390, 32.81289]
+ - [34.95096, 32.81981]
+ - [34.95070, 32.82183]
+ - [34.95144, 32.82327]
+ - [34.95602, 32.82775]
+ - [34.95996, 32.83077]
+ - [34.96305, 32.83122]
+ - [34.96596, 32.83233]
+ - [34.97334, 32.83242]
+ - [34.97935, 32.83486]
+ - [34.98347, 32.83490]
+ - [34.98659, 32.83274]
+ - [34.98677, 32.83005]
+ - [34.98749, 32.82875]
+ - [34.99257, 32.82515]
+ - [34.99687, 32.82068]
+ - [34.99797, 32.81765]
+ - [35.00238, 32.81217]
+ - [35.00379, 32.81126]
+ - [35.00493, 32.81159]
+- id: haifa_beirut_railway
+ kind: rail
+ status: draft
+ from: '1942'
+ on_symbol: 0.99
+ max_gap_m: 128
+ length_km: 39.5
+ points:
+ - [35.00493, 32.81159]
+ - [35.00654, 32.80740]
+ - [35.01643, 32.79919]
+ - [35.02210, 32.79782]
+ - [35.02639, 32.79566]
+ - [35.03205, 32.79471]
+ - [35.03549, 32.79535]
+ - [35.03930, 32.79860]
+ - [35.04270, 32.80365]
+ - [35.04639, 32.80768]
+ - [35.04819, 32.80895]
+ - [35.05145, 32.80995]
+ - [35.05500, 32.81260]
+ - [35.05581, 32.81505]
+ - [35.05753, 32.81750]
+ - [35.05821, 32.82024]
+ - [35.06030, 32.82284]
+ - [35.06096, 32.82544]
+ - [35.06776, 32.83279]
+ - [35.06867, 32.83552]
+ - [35.07128, 32.83660]
+ - [35.07349, 32.84289]
+ - [35.07691, 32.84650]
+ - [35.07780, 32.84967]
+ - [35.08005, 32.85284]
+ - [35.08475, 32.85702]
+ - [35.08568, 32.86020]
+ - [35.08801, 32.86265]
+ - [35.08904, 32.86510]
+ - [35.09227, 32.86856]
+ - [35.09241, 32.88067]
+ - [35.09102, 32.88297]
+ - [35.08777, 32.88643]
+ - [35.08640, 32.89307]
+ - [35.08302, 32.89825]
+ - [35.08269, 32.90215]
+ - [35.08321, 32.90517]
+ - [35.08238, 32.90921]
+ - [35.07967, 32.91295]
+ - [35.08118, 32.92881]
+ - [35.07823, 32.94004]
+ - [35.07877, 32.94307]
+ - [35.08097, 32.94609]
+ - [35.08135, 32.95056]
+ - [35.08280, 32.95416]
+ - [35.08286, 32.96122]
+ - [35.08355, 32.96381]
+ - [35.08286, 32.97648]
+ - [35.08362, 32.98196]
+ - [35.08713, 32.98584]
+ - [35.08864, 32.98887]
+ - [35.09193, 32.99189]
+ - [35.09392, 33.00542]
+ - [35.09449, 33.00666]
+ - [35.09619, 33.00793]
+ - [35.09629, 33.01061]
+ - [35.09708, 33.01277]
+ - [35.09707, 33.01665]
+ - [35.09588, 33.02428]
+ - [35.09592, 33.02961]
+ - [35.09711, 33.03335]
+ - [35.10017, 33.03680]
+ - [35.10087, 33.03882]
+ - [35.10090, 33.04817]
+ - [35.10208, 33.05076]
+ - [35.10226, 33.05263]
+ - [35.10216, 33.05623]
+ - [35.10089, 33.05910]
+ - [35.10089, 33.07550]
+ - [35.10174, 33.07809]
+ - [35.10195, 33.08457]
+ - [35.10311, 33.08715]
+ - [35.10316, 33.09089]
+ - [35.10449, 33.09276]
+- id: jezreel_valley_railway
+ kind: rail
+ status: draft
+ from: '1905-10-15'
+ on_symbol: 0.98
+ max_gap_m: 161
+ length_km: 93.0
+ points:
+ - [35.00493, 32.81188]
+ - [35.00601, 32.81015]
+ - [35.00630, 32.80798]
+ - [35.00733, 32.80668]
+ - [35.02267, 32.79317]
+ - [35.02553, 32.79165]
+ - [35.03446, 32.78482]
+ - [35.03686, 32.78172]
+ - [35.04682, 32.77449]
+ - [35.05195, 32.77003]
+ - [35.07191, 32.74736]
+ - [35.08616, 32.73321]
+ - [35.09002, 32.73098]
+ - [35.09156, 32.72862]
+ - [35.09639, 32.72455]
+ - [35.09756, 32.72224]
+ - [35.10351, 32.69768]
+ - [35.11050, 32.68896]
+ - [35.14209, 32.67711]
+ - [35.14621, 32.67435]
+ - [35.15014, 32.67363]
+ - [35.15342, 32.67144]
+ - [35.15754, 32.66973]
+ - [35.16063, 32.66924]
+ - [35.16406, 32.66676]
+ - [35.17488, 32.66186]
+ - [35.18037, 32.66065]
+ - [35.18466, 32.65724]
+ - [35.18929, 32.65561]
+ - [35.19307, 32.65504]
+ - [35.20131, 32.65121]
+ - [35.20543, 32.64825]
+ - [35.20938, 32.64639]
+ - [35.21295, 32.64582]
+ - [35.21934, 32.64190]
+ - [35.22981, 32.63711]
+ - [35.23702, 32.63408]
+ - [35.24028, 32.63354]
+ - [35.24388, 32.63106]
+ - [35.24766, 32.63034]
+ - [35.25109, 32.62788]
+ - [35.25470, 32.62725]
+ - [35.25830, 32.62472]
+ - [35.26208, 32.62409]
+ - [35.27581, 32.61801]
+ - [35.28762, 32.61042]
+ - [35.29332, 32.60914]
+ - [35.31114, 32.59390]
+ - [35.32716, 32.57336]
+ - [35.33366, 32.56853]
+ - [35.33761, 32.56776]
+ - [35.35169, 32.56146]
+ - [35.35787, 32.56076]
+ - [35.36387, 32.55806]
+ - [35.38207, 32.55369]
+ - [35.39065, 32.55117]
+ - [35.39495, 32.54924]
+ - [35.40250, 32.54833]
+ - [35.41537, 32.54832]
+ - [35.41898, 32.54684]
+ - [35.42653, 32.54610]
+ - [35.43546, 32.54155]
+ - [35.43958, 32.54078]
+ - [35.44885, 32.53665]
+ - [35.47614, 32.51974]
+ - [35.48953, 32.51569]
+ - [35.49399, 32.51292]
+ - [35.50103, 32.51351]
+ - [35.50292, 32.51447]
+ - [35.51056, 32.52112]
+ - [35.51202, 32.52387]
+ - [35.51280, 32.52749]
+ - [35.51546, 32.53070]
+ - [35.51665, 32.53070]
+ - [35.52027, 32.52685]
+ - [35.52335, 32.52553]
+ - [35.52747, 32.52859]
+ - [35.53159, 32.52875]
+ - [35.53335, 32.53010]
+ - [35.53360, 32.53285]
+ - [35.53203, 32.53806]
+ - [35.53193, 32.54081]
+ - [35.53344, 32.54414]
+ - [35.53352, 32.54935]
+ - [35.53429, 32.55296]
+ - [35.53928, 32.56020]
+ - [35.54526, 32.56584]
+ - [35.54784, 32.57307]
+ - [35.54807, 32.59159]
+ - [35.54728, 32.60388]
+ - [35.55385, 32.61082]
+ - [35.55682, 32.62007]
+ - [35.56784, 32.63121]
+ - [35.56867, 32.63742]
+ - [35.56867, 32.64552]
+ - [35.56934, 32.64798]
+ - [35.56973, 32.65838]
+ - [35.57297, 32.66561]
+ - [35.57449, 32.67081]
+ - [35.57644, 32.67356]
+ - [35.57660, 32.67803]
+ - [35.57783, 32.68352]
+ - [35.58255, 32.69855]
+ - [35.58364, 32.70014]
+ - [35.58772, 32.70306]
+ - [35.59630, 32.70410]
+ - [35.60077, 32.70162]
+ - [35.60489, 32.69841]
+ - [35.60815, 32.69775]
+ - [35.61261, 32.69512]
+ - [35.61896, 32.69333]
+ - [35.62875, 32.68756]
+ - [35.63888, 32.68754]
+ - [35.64746, 32.68446]
+ - [35.65192, 32.68667]
+ - [35.66205, 32.68670]
+ - [35.66583, 32.68728]
+- id: jaffa_jerusalem_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.94
+ max_gap_m: 599
+ length_km: 61.0
+ points:
+ - [34.75345, 32.05224]
+ - [34.75758, 32.05497]
+ - [34.76043, 32.05587]
+ - [34.76235, 32.05185]
+ - [34.76529, 32.05030]
+ - [34.77181, 32.04491]
+ - [34.77885, 32.04003]
+ - [34.78229, 32.03906]
+ - [34.78744, 32.03622]
+ - [34.79053, 32.03536]
+ - [34.79619, 32.03211]
+ - [34.80976, 32.02052]
+ - [34.81146, 32.01732]
+ - [34.81851, 32.00829]
+ - [34.82057, 32.00451]
+ - [34.82329, 32.00174]
+ - [34.82440, 31.99927]
+ - [34.83409, 31.98558]
+ - [34.83808, 31.98122]
+ - [34.83972, 31.97772]
+ - [34.84264, 31.97466]
+ - [34.84461, 31.96927]
+ - [34.84799, 31.96680]
+ - [34.84879, 31.96418]
+ - [34.85122, 31.96141]
+ - [34.85586, 31.95398]
+ - [34.85877, 31.95146]
+ - [34.86107, 31.94874]
+ - [34.86160, 31.94669]
+ - [34.86479, 31.94364]
+ - [34.86594, 31.93942]
+ - [34.86726, 31.93666]
+ - [34.87044, 31.93228]
+ - [34.87093, 31.93017]
+ - [34.87515, 31.92804]
+ - [34.87927, 31.92325]
+ - [34.88305, 31.92042]
+ - [34.88642, 31.91918]
+ - [34.89352, 31.91304]
+ - [34.90073, 31.90911]
+ - [34.90605, 31.90508]
+ - [34.91138, 31.90269]
+ - [34.91524, 31.89935]
+ - [34.91721, 31.89629]
+ - [34.92070, 31.89302]
+ - [34.93094, 31.88723]
+ - [34.93936, 31.87851]
+ - [34.94794, 31.87177]
+ - [34.95051, 31.86786]
+ - [34.95440, 31.86480]
+ - [34.95673, 31.86126]
+ - [34.95769, 31.86113]
+ - [34.95946, 31.86200]
+ - [34.96029, 31.86172]
+ - [34.96849, 31.84541]
+ - [34.97681, 31.83608]
+ - [34.97727, 31.83156]
+ - [34.97831, 31.83022]
+ - [34.99017, 31.82795]
+ - [34.99858, 31.82811]
+ - [35.00099, 31.82748]
+ - [35.00545, 31.82741]
+ - [35.01506, 31.82518]
+ - [35.02339, 31.81857]
+ - [35.02553, 31.81569]
+ - [35.03065, 31.81320]
+ - [35.03206, 31.81100]
+ - [35.03583, 31.80862]
+ - [35.04184, 31.80795]
+ - [35.04544, 31.80637]
+ - [35.05042, 31.80546]
+ - [35.05797, 31.80838]
+ - [35.05969, 31.80857]
+ - [35.06742, 31.80502]
+ - [35.07188, 31.80406]
+ - [35.07668, 31.80156]
+ - [35.08321, 31.80238]
+ - [35.08973, 31.80227]
+ - [35.09368, 31.80511]
+ - [35.10037, 31.80545]
+ - [35.10827, 31.81123]
+ - [35.11394, 31.80841]
+ - [35.12029, 31.80326]
+ - [35.12406, 31.80224]
+ - [35.12698, 31.80075]
+ - [35.13162, 31.79976]
+ - [35.13883, 31.80019]
+ - [35.14398, 31.79993]
+ - [35.14575, 31.79900]
+ - [35.14770, 31.79658]
+ - [35.15273, 31.79601]
+ - [35.15702, 31.79382]
+ - [35.16217, 31.79410]
+ - [35.16509, 31.79348]
+ - [35.16966, 31.79656]
+ - [35.17522, 31.80138]
+ - [35.18106, 31.80168]
+ - [35.18432, 31.80248]
+ - [35.18981, 31.79723]
+ - [35.19874, 31.79174]
+ - [35.20440, 31.79059]
+ - [35.21007, 31.78793]
+ - [35.21453, 31.78681]
+ - [35.22174, 31.78243]
+ - [35.22569, 31.77933]
+- id: burma_road
+ kind: track
+ status: draft
+ from: '1948-06-14'
+ on_symbol: 0.91
+ max_gap_m: 146
+ length_km: 18.8
+ points:
+ - [34.93489, 31.82528]
+ - [34.93774, 31.82373]
+ - [34.94039, 31.82137]
+ - [34.94295, 31.82021]
+ - [34.94452, 31.81848]
+ - [34.95292, 31.81290]
+ - [34.95858, 31.81219]
+ - [34.96202, 31.81387]
+ - [34.96699, 31.81493]
+ - [34.97043, 31.81227]
+ - [34.97403, 31.81043]
+ - [34.98004, 31.80962]
+ - [34.98141, 31.80849]
+ - [34.98256, 31.80636]
+ - [34.98364, 31.80591]
+ - [34.98485, 31.80676]
+ - [34.98466, 31.80895]
+ - [34.98537, 31.80954]
+ - [34.98759, 31.81007]
+ - [34.99412, 31.80998]
+ - [34.99526, 31.81050]
+ - [34.99771, 31.81275]
+ - [34.99834, 31.81420]
+ - [34.99841, 31.82368]
+ - [34.99892, 31.82499]
+ - [35.00115, 31.82631]
+ - [35.00648, 31.82635]
+ - [35.01472, 31.82437]
+ - [35.02152, 31.81785]
+ - [35.02220, 31.81595]
+ - [35.01869, 31.81172]
+ - [35.01824, 31.80979]
+ - [35.02049, 31.80964]
+ - [35.02151, 31.80905]
+ - [35.02720, 31.80195]
+ - [35.03139, 31.79946]
+ - [35.03298, 31.79613]
+ - [35.03446, 31.79492]
+ - [35.03926, 31.79394]
+ - [35.04355, 31.79392]
+ - [35.05609, 31.79556]
+ - [35.06398, 31.79408]
+ - [35.06649, 31.79476]
+ - [35.06948, 31.79380]
+ - [35.07451, 31.79617]
+ - [35.07472, 31.79728]
+ - [35.07394, 31.79801]
+- id: tel_aviv_haifa_road
+ kind: road
+ status: draft
+ from: '1937'
+ on_symbol: 0.94
+ max_gap_m: 534
+ length_km: 104.3
+ points:
+ - [34.79070, 32.07785]
+ - [34.79859, 32.08241]
+ - [34.80494, 32.08300]
+ - [34.80700, 32.08368]
+ - [34.81971, 32.09044]
+ - [34.82399, 32.09137]
+ - [34.82591, 32.09246]
+ - [34.82988, 32.09251]
+ - [34.83258, 32.09353]
+ - [34.85370, 32.09370]
+ - [34.86073, 32.09328]
+ - [34.86314, 32.09302]
+ - [34.86547, 32.09191]
+ - [34.86812, 32.09145]
+ - [34.87687, 32.09160]
+ - [34.88151, 32.08995]
+ - [34.88563, 32.09015]
+ - [34.89026, 32.09303]
+ - [34.89476, 32.09690]
+ - [34.89783, 32.10344]
+ - [34.89963, 32.10592]
+ - [34.89999, 32.10897]
+ - [34.90185, 32.11188]
+ - [34.90318, 32.12205]
+ - [34.90295, 32.12583]
+ - [34.90102, 32.13049]
+ - [34.89411, 32.13863]
+ - [34.89404, 32.15883]
+ - [34.89314, 32.17147]
+ - [34.89229, 32.17292]
+ - [34.88786, 32.17654]
+ - [34.88719, 32.17776]
+ - [34.88830, 32.18992]
+ - [34.88240, 32.20358]
+ - [34.88185, 32.23059]
+ - [34.88209, 32.23219]
+ - [34.88365, 32.23466]
+ - [34.88882, 32.25281]
+ - [34.89023, 32.25542]
+ - [34.89421, 32.27966]
+ - [34.89778, 32.29649]
+ - [34.90085, 32.31709]
+ - [34.90172, 32.32101]
+ - [34.90331, 32.32432]
+ - [34.90336, 32.33001]
+ - [34.90460, 32.33711]
+ - [34.90570, 32.33958]
+ - [34.90623, 32.34625]
+ - [34.90571, 32.36510]
+ - [34.90690, 32.37076]
+ - [34.90691, 32.37655]
+ - [34.90536, 32.38670]
+ - [34.90126, 32.39685]
+ - [34.90108, 32.40439]
+ - [34.90231, 32.41308]
+ - [34.90588, 32.42757]
+ - [34.90766, 32.43800]
+ - [34.90827, 32.43871]
+ - [34.91017, 32.43916]
+ - [34.91615, 32.43771]
+ - [34.91944, 32.43971]
+ - [34.92648, 32.43922]
+ - [34.93386, 32.44380]
+ - [34.94674, 32.44415]
+ - [34.94821, 32.44476]
+ - [34.95020, 32.44667]
+ - [34.95755, 32.44882]
+ - [34.96016, 32.45133]
+ - [34.96626, 32.46683]
+ - [34.96866, 32.46934]
+ - [34.97283, 32.47117]
+ - [34.97437, 32.47262]
+ - [34.97489, 32.47393]
+ - [34.97444, 32.47668]
+ - [34.97005, 32.48377]
+ - [34.96934, 32.48638]
+ - [34.96620, 32.49261]
+ - [34.96156, 32.49854]
+ - [34.96093, 32.50289]
+ - [34.95840, 32.50781]
+ - [34.95463, 32.51089]
+ - [34.94784, 32.51285]
+ - [34.94633, 32.51693]
+ - [34.94519, 32.51786]
+ - [34.93112, 32.51838]
+ - [34.92947, 32.51901]
+ - [34.92868, 32.52055]
+ - [34.92751, 32.53401]
+ - [34.92760, 32.53878]
+ - [34.93007, 32.54298]
+ - [34.93009, 32.55672]
+ - [34.93066, 32.55976]
+ - [34.93707, 32.58074]
+ - [34.93953, 32.58681]
+ - [34.94469, 32.59225]
+ - [34.94524, 32.59506]
+ - [34.94795, 32.60200]
+ - [34.94852, 32.60677]
+ - [34.95039, 32.61154]
+ - [34.95479, 32.62861]
+ - [34.95589, 32.65159]
+ - [34.95939, 32.68497]
+ - [34.96576, 32.70014]
+ - [34.96801, 32.71444]
+ - [34.96778, 32.71675]
+ - [34.96451, 32.72224]
+ - [34.96424, 32.74462]
+ - [34.96042, 32.75473]
+ - [34.95962, 32.75891]
+ - [34.95961, 32.76570]
+ - [34.96064, 32.77234]
+ - [34.96057, 32.79297]
+ - [34.95937, 32.80106]
+ - [34.95553, 32.81058]
+ - [34.95413, 32.82226]
+ - [34.95516, 32.82399]
+ - [34.96099, 32.82851]
+ - [34.96408, 32.82945]
+ - [34.96682, 32.82961]
+ - [34.97420, 32.82717]
+ - [34.97952, 32.82295]
+ - [34.98244, 32.82149]
+ - [34.98553, 32.82065]
+ - [34.99686, 32.81952]
+- id: coastal_road_south
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.87
+ max_gap_m: 632
+ length_km: 115.7
+ points:
+ - [34.75345, 32.05224]
+ - [34.75758, 32.05497]
+ - [34.76043, 32.05587]
+ - [34.76246, 32.05174]
+ - [34.76529, 32.05030]
+ - [34.77872, 32.03990]
+ - [34.78332, 32.03850]
+ - [34.78744, 32.03622]
+ - [34.79053, 32.03536]
+ - [34.79602, 32.03199]
+ - [34.81003, 32.02023]
+ - [34.81146, 32.01732]
+ - [34.81851, 32.00829]
+ - [34.81974, 32.00567]
+ - [34.82232, 32.00247]
+ - [34.82204, 32.00131]
+ - [34.81365, 31.99184]
+ - [34.81155, 31.98733]
+ - [34.80664, 31.97131]
+ - [34.80284, 31.96607]
+ - [34.80256, 31.94932]
+ - [34.79817, 31.92544]
+ - [34.79705, 31.92465]
+ - [34.79344, 31.92448]
+ - [34.79070, 31.92345]
+ - [34.78503, 31.92310]
+ - [34.78229, 31.92161]
+ - [34.77302, 31.92074]
+ - [34.77165, 31.92013]
+ - [34.77037, 31.91246]
+ - [34.76747, 31.90955]
+ - [34.76560, 31.90663]
+ - [34.76480, 31.90285]
+ - [34.76361, 31.90037]
+ - [34.75553, 31.88783]
+ - [34.75467, 31.88463]
+ - [34.75165, 31.88098]
+ - [34.74840, 31.87136]
+ - [34.74633, 31.86744]
+ - [34.74427, 31.86524]
+ - [34.74240, 31.85956]
+ - [34.73096, 31.85095]
+ - [34.72171, 31.84278]
+ - [34.71654, 31.83433]
+ - [34.70506, 31.82091]
+ - [34.69549, 31.80807]
+ - [34.68818, 31.79713]
+ - [34.67414, 31.78446]
+ - [34.67174, 31.78310]
+ - [34.66895, 31.78321]
+ - [34.66739, 31.78166]
+ - [34.66590, 31.77218]
+ - [34.66720, 31.76953]
+ - [34.66853, 31.76387]
+ - [34.66689, 31.75846]
+ - [34.66123, 31.75244]
+ - [34.66010, 31.75209]
+ - [34.65560, 31.75272]
+ - [34.65318, 31.75101]
+ - [34.63760, 31.72532]
+ - [34.61550, 31.69407]
+ - [34.61106, 31.68487]
+ - [34.61049, 31.67581]
+ - [34.60745, 31.67055]
+ - [34.60668, 31.66707]
+ - [34.60204, 31.66082]
+ - [34.60018, 31.65448]
+ - [34.59403, 31.64512]
+ - [34.59244, 31.63869]
+ - [34.58776, 31.62934]
+ - [34.58367, 31.62232]
+ - [34.57878, 31.61641]
+ - [34.57791, 31.61355]
+ - [34.57335, 31.60420]
+ - [34.56505, 31.58987]
+ - [34.55456, 31.57788]
+ - [34.55284, 31.57188]
+ - [34.55029, 31.56764]
+ - [34.54814, 31.56208]
+ - [34.54754, 31.55842]
+ - [34.54231, 31.54701]
+ - [34.54120, 31.54170]
+ - [34.53870, 31.54022]
+ - [34.53441, 31.53925]
+ - [34.52016, 31.53366]
+ - [34.51398, 31.52980]
+ - [34.50505, 31.52691]
+ - [34.49338, 31.52039]
+ - [34.49242, 31.51907]
+ - [34.49256, 31.51819]
+ - [34.49890, 31.51219]
+ - [34.49954, 31.51043]
+ - [34.49316, 31.50429]
+ - [34.48841, 31.49741]
+ - [34.48411, 31.49376]
+ - [34.48262, 31.49374]
+ - [34.47965, 31.49650]
+ - [34.47656, 31.49802]
+ - [34.46982, 31.50428]
+ - [34.46794, 31.50429]
+ - [34.46540, 31.50109]
+ - [34.45858, 31.49726]
+ - [34.45599, 31.49331]
+ - [34.45100, 31.48789]
+ - [34.44057, 31.47926]
+ - [34.43759, 31.47428]
+ - [34.41247, 31.45369]
+ - [34.40858, 31.45235]
+ - [34.40635, 31.44994]
+ - [34.39965, 31.44514]
+ - [34.38729, 31.43460]
+ - [34.37648, 31.42420]
+ - [34.36275, 31.41263]
+ - [34.35972, 31.41086]
+ - [34.35835, 31.40925]
+ - [34.35766, 31.40706]
+ - [34.35396, 31.40251]
+ - [34.34401, 31.38727]
+ - [34.33634, 31.37848]
+ - [34.33515, 31.37599]
+ - [34.33414, 31.36984]
+ - [34.33305, 31.36819]
+ - [34.32937, 31.35811]
+ - [34.31826, 31.34829]
+ - [34.31595, 31.34330]
+ - [34.31259, 31.33977]
+ - [34.31228, 31.33802]
+ - [34.31360, 31.33538]
+ - [34.31303, 31.33292]
+ - [34.31415, 31.32952]
+ - [34.31647, 31.32527]
+ - [34.31726, 31.30239]
+ - [34.31652, 31.29476]
+ - [34.31212, 31.28567]
+ - [34.30886, 31.28126]
+ - [34.30524, 31.27821]
+ - [34.28344, 31.26980]
+ - [34.28155, 31.26967]
+ - [34.27709, 31.27164]
+ - [34.26833, 31.27174]
+ - [34.26644, 31.27246]
+- id: haifa_acre_naqura_road
+ kind: road
+ status: draft
+ from: '1933'
+ on_symbol: 0.94
+ max_gap_m: 482
+ length_km: 42.7
+ points:
+ - [34.99686, 32.81952]
+ - [34.99616, 32.81925]
+ - [34.99612, 32.81808]
+ - [35.00015, 32.81322]
+ - [34.99767, 32.81000]
+ - [35.00016, 32.80697]
+ - [35.00356, 32.80421]
+ - [35.00690, 32.80296]
+ - [35.01454, 32.79665]
+ - [35.01798, 32.79548]
+ - [35.02553, 32.78970]
+ - [35.02690, 32.78952]
+ - [35.03600, 32.79347]
+ - [35.04544, 32.79871]
+ - [35.04905, 32.80207]
+ - [35.05027, 32.80394]
+ - [35.05083, 32.80629]
+ - [35.06364, 32.80968]
+ - [35.07135, 32.81620]
+ - [35.07643, 32.82169]
+ - [35.07860, 32.83135]
+ - [35.09097, 32.84996]
+ - [35.09169, 32.85255]
+ - [35.09419, 32.87822]
+ - [35.09411, 32.88312]
+ - [35.09159, 32.89782]
+ - [35.09061, 32.90027]
+ - [35.08314, 32.91151]
+ - [35.07873, 32.91944]
+ - [35.07578, 32.92247]
+ - [35.07517, 32.92376]
+ - [35.07672, 32.92716]
+ - [35.07754, 32.93125]
+ - [35.08950, 32.95863]
+ - [35.09067, 32.96237]
+ - [35.09059, 32.97807]
+ - [35.09107, 32.98124]
+ - [35.09258, 32.98613]
+ - [35.09471, 32.99866]
+ - [35.09725, 33.00658]
+ - [35.09755, 33.01075]
+ - [35.09889, 33.01305]
+ - [35.09994, 33.01723]
+ - [35.10142, 33.03507]
+ - [35.10270, 33.03767]
+ - [35.10341, 33.04241]
+ - [35.10342, 33.04486]
+ - [35.10249, 33.04817]
+ - [35.10041, 33.05119]
+ - [35.10048, 33.05594]
+ - [35.10128, 33.05768]
+ - [35.10382, 33.05997]
+ - [35.10887, 33.06716]
+ - [35.11253, 33.07579]
+ - [35.11237, 33.07953]
+ - [35.10995, 33.08212]
+ - [35.10746, 33.08615]
+ - [35.10695, 33.09104]
+ - [35.10484, 33.09305]
+- id: jerusalem_hebron_beersheba_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.97
+ max_gap_m: 341
+ length_km: 82.8
+ points:
+ - [35.22569, 31.77933]
+ - [35.22380, 31.78051]
+ - [35.22271, 31.78028]
+ - [35.22243, 31.77364]
+ - [35.22372, 31.77013]
+ - [35.22574, 31.76736]
+ - [35.22586, 31.76503]
+ - [35.21750, 31.74678]
+ - [35.21573, 31.74430]
+ - [35.21532, 31.74249]
+ - [35.20693, 31.73072]
+ - [35.20267, 31.71849]
+ - [35.19575, 31.70648]
+ - [35.19032, 31.70054]
+ - [35.18346, 31.69640]
+ - [35.18123, 31.69563]
+ - [35.17213, 31.69523]
+ - [35.17007, 31.69471]
+ - [35.16738, 31.69290]
+ - [35.16523, 31.68971]
+ - [35.16166, 31.68770]
+ - [35.15822, 31.68484]
+ - [35.15222, 31.68211]
+ - [35.14895, 31.68178]
+ - [35.14871, 31.68107]
+ - [35.14995, 31.67902]
+ - [35.14937, 31.67742]
+ - [35.14227, 31.67343]
+ - [35.14132, 31.67245]
+ - [35.14120, 31.67070]
+ - [35.14345, 31.66719]
+ - [35.14352, 31.66500]
+ - [35.14648, 31.66003]
+ - [35.14669, 31.65842]
+ - [35.14394, 31.65341]
+ - [35.13883, 31.65056]
+ - [35.13471, 31.64980]
+ - [35.13245, 31.64717]
+ - [35.13153, 31.64425]
+ - [35.13165, 31.64030]
+ - [35.13282, 31.63738]
+ - [35.13230, 31.62642]
+ - [35.13143, 31.62552]
+ - [35.12767, 31.62448]
+ - [35.12389, 31.62229]
+ - [35.11909, 31.62154]
+ - [35.11555, 31.61809]
+ - [35.11363, 31.61165]
+ - [35.11383, 31.60478]
+ - [35.10837, 31.59952]
+ - [35.10554, 31.59440]
+ - [35.10533, 31.59060]
+ - [35.09913, 31.58036]
+ - [35.09831, 31.57393]
+ - [35.10031, 31.56267]
+ - [35.10037, 31.55667]
+ - [35.09858, 31.55301]
+ - [35.09802, 31.55053]
+ - [35.09804, 31.54716]
+ - [35.09900, 31.54219]
+ - [35.09900, 31.53648]
+ - [35.09814, 31.53107]
+ - [35.10040, 31.52761]
+ - [35.09814, 31.52729]
+ - [35.09145, 31.52870]
+ - [35.08576, 31.52565]
+ - [35.08150, 31.51790]
+ - [35.07707, 31.51336]
+ - [35.07857, 31.50765]
+ - [35.07837, 31.49975]
+ - [35.07736, 31.49627]
+ - [35.07342, 31.49369]
+ - [35.06812, 31.49188]
+ - [35.06381, 31.48847]
+ - [35.05368, 31.48627]
+ - [35.04785, 31.48277]
+ - [35.04362, 31.48286]
+ - [35.04354, 31.48204]
+ - [35.04501, 31.47970]
+ - [35.04452, 31.47765]
+ - [35.04252, 31.47550]
+ - [35.03926, 31.47361]
+ - [35.03430, 31.46959]
+ - [35.03325, 31.46681]
+ - [35.03032, 31.46344]
+ - [35.02346, 31.45246]
+ - [35.02225, 31.44734]
+ - [35.02134, 31.44602]
+ - [35.01712, 31.44301]
+ - [35.01283, 31.44115]
+ - [35.00682, 31.43974]
+ - [35.00218, 31.43621]
+ - [34.99903, 31.43539]
+ - [34.99788, 31.43152]
+ - [34.99307, 31.42537]
+ - [34.97729, 31.41403]
+ - [34.96809, 31.40603]
+ - [34.96517, 31.40237]
+ - [34.96465, 31.39856]
+ - [34.96290, 31.39519]
+ - [34.96099, 31.39314]
+ - [34.95731, 31.39064]
+ - [34.95574, 31.38727]
+ - [34.95550, 31.38464]
+ - [34.95313, 31.37863]
+ - [34.95259, 31.37526]
+ - [34.95120, 31.37382]
+ - [34.94839, 31.37217]
+ - [34.94631, 31.36939]
+ - [34.94613, 31.36742]
+ - [34.94885, 31.36529]
+ - [34.94835, 31.36309]
+ - [34.94554, 31.36064]
+ - [34.93970, 31.36003]
+ - [34.93524, 31.35723]
+ - [34.93426, 31.35488]
+ - [34.93375, 31.34359]
+ - [34.92991, 31.33876]
+ - [34.92637, 31.33143]
+ - [34.91994, 31.32409]
+ - [34.90712, 31.31251]
+ - [34.90485, 31.31084]
+ - [34.90073, 31.30905]
+ - [34.89026, 31.29916]
+ - [34.88614, 31.29684]
+ - [34.87824, 31.29049]
+ - [34.86211, 31.28633]
+ - [34.85404, 31.28149]
+ - [34.84501, 31.27334]
+ - [34.83876, 31.26586]
+ - [34.82760, 31.25902]
+ - [34.81919, 31.25201]
+ - [34.80924, 31.24575]
+ - [34.80014, 31.24147]
+ - [34.79310, 31.23935]
+ - [34.79156, 31.23974]
+ - [34.78970, 31.24106]
+ - [34.78586, 31.24517]
+ - [34.78538, 31.24664]
+- id: jerusalem_nablus_nazareth_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.95
+ max_gap_m: 341
+ length_km: 129.6
+ points:
+ - [35.22569, 31.77933]
+ - [35.22564, 31.78546]
+ - [35.22956, 31.79042]
+ - [35.23037, 31.79480]
+ - [35.23371, 31.80092]
+ - [35.23530, 31.80588]
+ - [35.23419, 31.81113]
+ - [35.22936, 31.81683]
+ - [35.22915, 31.82222]
+ - [35.22795, 31.82733]
+ - [35.22827, 31.82922]
+ - [35.22980, 31.83214]
+ - [35.22879, 31.83651]
+ - [35.23040, 31.84031]
+ - [35.23055, 31.84410]
+ - [35.22928, 31.84891]
+ - [35.22570, 31.85285]
+ - [35.22441, 31.85693]
+ - [35.22182, 31.86203]
+ - [35.22117, 31.86815]
+ - [35.21884, 31.87369]
+ - [35.21841, 31.87748]
+ - [35.22024, 31.88171]
+ - [35.22047, 31.88696]
+ - [35.21643, 31.89104]
+ - [35.21097, 31.90168]
+ - [35.21114, 31.90372]
+ - [35.21258, 31.90741]
+ - [35.21479, 31.90926]
+ - [35.21649, 31.91188]
+ - [35.21673, 31.91946]
+ - [35.22206, 31.92572]
+ - [35.22275, 31.92733]
+ - [35.22138, 31.93344]
+ - [35.22162, 31.93738]
+ - [35.21626, 31.94422]
+ - [35.21676, 31.94903]
+ - [35.21609, 31.95296]
+ - [35.21868, 31.95782]
+ - [35.22002, 31.95832]
+ - [35.22327, 31.95845]
+ - [35.22490, 31.95966]
+ - [35.22584, 31.96287]
+ - [35.22831, 31.96549]
+ - [35.22810, 31.96957]
+ - [35.22886, 31.97145]
+ - [35.23032, 31.97227]
+ - [35.23454, 31.97254]
+ - [35.23527, 31.97335]
+ - [35.23601, 31.98253]
+ - [35.23493, 31.98398]
+ - [35.22887, 31.98908]
+ - [35.22881, 31.99534]
+ - [35.22649, 31.99854]
+ - [35.22671, 32.00000]
+ - [35.22998, 32.00219]
+ - [35.23341, 32.00104]
+ - [35.23838, 32.00114]
+ - [35.23939, 32.00067]
+ - [35.24117, 31.99845]
+ - [35.24388, 31.99701]
+ - [35.24817, 31.99590]
+ - [35.24942, 31.99612]
+ - [35.25294, 31.99957]
+ - [35.25478, 32.00553]
+ - [35.25744, 32.00794]
+ - [35.26351, 32.01179]
+ - [35.26448, 32.01324]
+ - [35.26505, 32.01630]
+ - [35.26698, 32.01921]
+ - [35.26883, 32.02119]
+ - [35.27320, 32.02401]
+ - [35.27476, 32.02634]
+ - [35.27470, 32.02925]
+ - [35.27151, 32.03566]
+ - [35.26943, 32.03726]
+ - [35.26890, 32.03944]
+ - [35.26277, 32.04642]
+ - [35.26304, 32.04911]
+ - [35.25521, 32.05465]
+ - [35.24852, 32.05521]
+ - [35.24682, 32.05616]
+ - [35.24725, 32.05983]
+ - [35.24993, 32.06003]
+ - [35.24727, 32.06374]
+ - [35.24697, 32.06810]
+ - [35.24841, 32.07275]
+ - [35.25041, 32.07403]
+ - [35.25487, 32.07563]
+ - [35.25693, 32.07712]
+ - [35.26338, 32.08323]
+ - [35.26512, 32.08716]
+ - [35.26483, 32.09210]
+ - [35.26218, 32.09603]
+ - [35.26242, 32.09887]
+ - [35.25974, 32.10068]
+ - [35.26238, 32.10533]
+ - [35.25971, 32.10824]
+ - [35.25882, 32.11522]
+ - [35.25892, 32.12118]
+ - [35.25574, 32.12467]
+ - [35.25710, 32.13499]
+ - [35.25723, 32.15098]
+ - [35.25823, 32.15505]
+ - [35.26104, 32.16304]
+ - [35.26551, 32.16740]
+ - [35.26661, 32.16958]
+ - [35.27016, 32.17351]
+ - [35.27630, 32.18324]
+ - [35.28205, 32.19036]
+ - [35.28379, 32.19515]
+ - [35.28419, 32.20082]
+ - [35.28254, 32.20837]
+ - [35.26998, 32.21780]
+ - [35.26517, 32.22071]
+ - [35.26397, 32.22058]
+ - [35.26139, 32.21907]
+ - [35.25710, 32.22057]
+ - [35.25102, 32.22439]
+ - [35.24776, 32.22865]
+ - [35.24353, 32.23078]
+ - [35.23959, 32.23082]
+ - [35.23805, 32.23149]
+ - [35.22929, 32.23955]
+ - [35.22380, 32.24146]
+ - [35.21024, 32.24148]
+ - [35.20612, 32.24069]
+ - [35.20217, 32.24238]
+ - [35.19788, 32.24269]
+ - [35.19551, 32.24375]
+ - [35.18776, 32.25034]
+ - [35.18584, 32.25308]
+ - [35.18500, 32.25687]
+ - [35.18622, 32.26050]
+ - [35.18671, 32.26631]
+ - [35.18546, 32.26787]
+ - [35.17832, 32.27298]
+ - [35.17686, 32.27458]
+ - [35.17624, 32.27632]
+ - [35.17683, 32.27777]
+ - [35.18135, 32.28213]
+ - [35.18112, 32.28590]
+ - [35.18357, 32.28996]
+ - [35.18384, 32.29359]
+ - [35.18476, 32.29566]
+ - [35.18254, 32.29722]
+ - [35.18219, 32.30330]
+ - [35.17985, 32.30404]
+ - [35.17714, 32.30347]
+ - [35.17650, 32.30433]
+ - [35.17901, 32.30868]
+ - [35.18294, 32.31074]
+ - [35.18598, 32.31347]
+ - [35.18706, 32.31579]
+ - [35.18950, 32.31840]
+ - [35.19016, 32.32193]
+ - [35.19187, 32.32292]
+ - [35.19513, 32.32284]
+ - [35.19641, 32.32326]
+ - [35.20248, 32.32909]
+ - [35.20456, 32.33769]
+ - [35.20010, 32.34581]
+ - [35.19966, 32.34988]
+ - [35.20801, 32.35959]
+ - [35.21208, 32.36699]
+ - [35.21293, 32.36989]
+ - [35.21353, 32.38090]
+ - [35.21560, 32.38348]
+ - [35.21396, 32.38583]
+ - [35.21403, 32.38844]
+ - [35.22320, 32.40047]
+ - [35.22788, 32.41801]
+ - [35.22998, 32.42221]
+ - [35.23204, 32.42388]
+ - [35.23410, 32.42451]
+ - [35.23822, 32.42506]
+ - [35.24972, 32.42511]
+ - [35.25178, 32.42550]
+ - [35.26483, 32.43044]
+ - [35.27169, 32.43591]
+ - [35.27410, 32.43722]
+ - [35.28697, 32.44042]
+ - [35.29218, 32.44481]
+ - [35.29613, 32.44959]
+ - [35.29906, 32.45684]
+ - [35.29967, 32.46104]
+ - [35.30301, 32.46596]
+ - [35.30327, 32.46799]
+ - [35.30260, 32.47074]
+ - [35.29712, 32.48131]
+ - [35.29713, 32.48580]
+ - [35.29939, 32.49116]
+ - [35.29998, 32.50303]
+ - [35.30873, 32.51461]
+ - [35.31447, 32.52118]
+ - [35.31642, 32.52489]
+ - [35.31667, 32.53661]
+ - [35.31597, 32.56295]
+ - [35.30881, 32.57249]
+ - [35.29425, 32.58537]
+ - [35.29079, 32.59071]
+ - [35.28775, 32.59361]
+ - [35.28766, 32.60258]
+ - [35.28849, 32.60807]
+ - [35.28731, 32.61068]
+ - [35.28714, 32.62297]
+ - [35.29058, 32.65997]
+ - [35.29058, 32.66676]
+ - [35.28913, 32.67370]
+ - [35.28783, 32.67464]
+ - [35.28567, 32.67449]
+ - [35.28502, 32.67501]
+ - [35.28599, 32.67803]
+ - [35.28442, 32.68106]
+ - [35.28660, 32.68269]
+ - [35.28910, 32.68930]
+ - [35.28961, 32.69234]
+ - [35.28903, 32.69566]
+ - [35.28966, 32.69707]
+ - [35.29967, 32.70458]
+ - [35.30414, 32.70517]
+ - [35.30506, 32.70457]
+ - [35.30431, 32.70404]
+- id: tel_aviv_tulkarm_nablus_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.95
+ max_gap_m: 437
+ length_km: 67.4
+ points:
+ - [34.79070, 32.07785]
+ - [34.79842, 32.08235]
+ - [34.80580, 32.08320]
+ - [34.81919, 32.09022]
+ - [34.82399, 32.09137]
+ - [34.82591, 32.09246]
+ - [34.82988, 32.09251]
+ - [34.83241, 32.09350]
+ - [34.83584, 32.09370]
+ - [34.85370, 32.09370]
+ - [34.86245, 32.09315]
+ - [34.86575, 32.09183]
+ - [34.86915, 32.09133]
+ - [34.87704, 32.09158]
+ - [34.88116, 32.09002]
+ - [34.88453, 32.08988]
+ - [34.88597, 32.09018]
+ - [34.89215, 32.09438]
+ - [34.89507, 32.09546]
+ - [34.91000, 32.09671]
+ - [34.92710, 32.10407]
+ - [34.93237, 32.10318]
+ - [34.93629, 32.10635]
+ - [34.93747, 32.11391]
+ - [34.93678, 32.12802]
+ - [34.93769, 32.13267]
+ - [34.94027, 32.13892]
+ - [34.94526, 32.14749]
+ - [34.94582, 32.15214]
+ - [34.94713, 32.15406]
+ - [34.94777, 32.15723]
+ - [34.95497, 32.17176]
+ - [34.95729, 32.17467]
+ - [34.95968, 32.17989]
+ - [34.96020, 32.18382]
+ - [34.95851, 32.18644]
+ - [34.95889, 32.18818]
+ - [34.96064, 32.18998]
+ - [34.96548, 32.19234]
+ - [34.96882, 32.19777]
+ - [34.97071, 32.20270]
+ - [34.97046, 32.20576]
+ - [34.97153, 32.20765]
+ - [34.97190, 32.20997]
+ - [34.97868, 32.22057]
+ - [34.98292, 32.23248]
+ - [34.99219, 32.24816]
+ - [34.99331, 32.25397]
+ - [34.99675, 32.26006]
+ - [35.00093, 32.27182]
+ - [35.00795, 32.28662]
+ - [35.01228, 32.29794]
+ - [35.01496, 32.30723]
+ - [35.01935, 32.31111]
+ - [35.02552, 32.31193]
+ - [35.02794, 32.31481]
+ - [35.03188, 32.31625]
+ - [35.04218, 32.31907]
+ - [35.05797, 32.31913]
+ - [35.08286, 32.31568]
+ - [35.08904, 32.31586]
+ - [35.09488, 32.31190]
+ - [35.10793, 32.30904]
+ - [35.11325, 32.30833]
+ - [35.11651, 32.30660]
+ - [35.12784, 32.30473]
+ - [35.13020, 32.30244]
+ - [35.13154, 32.29649]
+ - [35.13483, 32.29156]
+ - [35.13687, 32.28691]
+ - [35.14243, 32.28340]
+ - [35.14732, 32.27922]
+ - [35.14820, 32.27777]
+ - [35.14854, 32.27530]
+ - [35.15068, 32.27310]
+ - [35.16372, 32.26791]
+ - [35.16904, 32.26529]
+ - [35.17315, 32.26108]
+ - [35.17729, 32.25324]
+ - [35.17865, 32.25316]
+ - [35.18209, 32.25526]
+ - [35.18432, 32.25529]
+ - [35.18529, 32.25459]
+ - [35.18610, 32.25181]
+ - [35.19470, 32.24452]
+ - [35.19805, 32.24283]
+ - [35.20234, 32.24242]
+ - [35.20560, 32.24084]
+ - [35.22397, 32.24148]
+ - [35.22792, 32.24037]
+ - [35.22976, 32.23927]
+ - [35.23770, 32.23195]
+ - [35.23976, 32.23094]
+ - [35.24351, 32.23071]
+ - [35.24697, 32.22951]
+ - [35.24820, 32.22855]
+ - [35.24884, 32.22653]
+ - [35.25014, 32.22510]
+ - [35.26036, 32.21955]
+- id: haifa_nazareth_tiberias_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.97
+ max_gap_m: 225
+ length_km: 65.0
+ points:
+ - [34.99686, 32.81952]
+ - [34.99616, 32.81925]
+ - [34.99612, 32.81808]
+ - [35.00015, 32.81322]
+ - [34.99767, 32.81000]
+ - [35.00031, 32.80683]
+ - [35.00356, 32.80421]
+ - [35.00706, 32.80284]
+ - [35.01420, 32.79689]
+ - [35.01763, 32.79499]
+ - [35.02639, 32.78764]
+ - [35.04715, 32.76873]
+ - [35.05886, 32.75689]
+ - [35.07694, 32.74151]
+ - [35.08098, 32.73625]
+ - [35.08304, 32.73519]
+ - [35.08716, 32.73456]
+ - [35.10020, 32.72475]
+ - [35.10673, 32.72179]
+ - [35.11102, 32.72194]
+ - [35.11411, 32.72121]
+ - [35.11926, 32.71603]
+ - [35.12183, 32.71451]
+ - [35.12406, 32.71370]
+ - [35.12921, 32.71310]
+ - [35.13402, 32.71122]
+ - [35.15788, 32.70854]
+ - [35.16252, 32.70633]
+ - [35.16767, 32.70766]
+ - [35.17024, 32.70777]
+ - [35.17711, 32.70648]
+ - [35.18655, 32.70326]
+ - [35.20200, 32.70332]
+ - [35.20607, 32.70098]
+ - [35.21058, 32.70028]
+ - [35.21779, 32.69746]
+ - [35.22380, 32.69415]
+ - [35.23030, 32.68873]
+ - [35.23120, 32.68714]
+ - [35.23061, 32.68488]
+ - [35.23255, 32.68393]
+ - [35.23650, 32.68068]
+ - [35.24096, 32.67810]
+ - [35.24508, 32.67731]
+ - [35.25023, 32.67367]
+ - [35.25453, 32.67283]
+ - [35.25727, 32.67351]
+ - [35.26534, 32.67933]
+ - [35.27133, 32.68246]
+ - [35.28165, 32.69183]
+ - [35.28789, 32.69403]
+ - [35.28941, 32.69693]
+ - [35.29332, 32.69945]
+ - [35.29881, 32.70412]
+ - [35.30053, 32.70489]
+ - [35.30486, 32.70526]
+ - [35.30672, 32.70592]
+ - [35.30696, 32.70709]
+ - [35.30407, 32.70967]
+ - [35.30431, 32.71126]
+ - [35.30843, 32.71361]
+ - [35.31169, 32.71301]
+ - [35.31307, 32.71363]
+ - [35.31330, 32.71516]
+ - [35.31144, 32.71805]
+ - [35.31136, 32.72062]
+ - [35.31721, 32.72612]
+ - [35.32244, 32.73004]
+ - [35.32282, 32.73105]
+ - [35.32248, 32.73365]
+ - [35.32326, 32.73592]
+ - [35.33149, 32.74059]
+ - [35.33526, 32.74505]
+ - [35.33613, 32.74866]
+ - [35.34100, 32.75429]
+ - [35.34231, 32.75675]
+ - [35.34654, 32.76025]
+ - [35.34894, 32.76067]
+ - [35.35872, 32.76067]
+ - [35.37143, 32.76316]
+ - [35.37486, 32.76426]
+ - [35.38001, 32.76760]
+ - [35.40044, 32.77580]
+ - [35.40336, 32.77650]
+ - [35.40919, 32.77667]
+ - [35.41554, 32.78053]
+ - [35.41966, 32.78097]
+ - [35.42241, 32.78208]
+ - [35.42911, 32.78244]
+ - [35.44627, 32.78189]
+ - [35.44797, 32.78261]
+ - [35.45074, 32.78547]
+ - [35.45262, 32.78663]
+ - [35.45709, 32.78714]
+ - [35.46121, 32.78849]
+ - [35.47545, 32.78865]
+ - [35.48387, 32.78815]
+ - [35.49314, 32.78636]
+ - [35.49657, 32.78763]
+ - [35.50017, 32.78819]
+ - [35.50721, 32.78827]
+ - [35.51064, 32.78918]
+ - [35.51373, 32.79110]
+ - [35.51559, 32.79312]
+ - [35.51671, 32.79644]
+ - [35.51888, 32.79793]
+ - [35.52318, 32.79618]
+ - [35.52649, 32.79781]
+ - [35.52798, 32.79781]
+ - [35.53272, 32.79624]
+ - [35.53330, 32.79442]
+- id: jerusalem_jericho_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.96
+ max_gap_m: 439
+ length_km: 32.9
+ points:
+ - [35.22569, 31.77933]
+ - [35.22553, 31.78283]
+ - [35.22641, 31.78400]
+ - [35.23324, 31.78385]
+ - [35.23765, 31.78437]
+ - [35.23905, 31.78298]
+ - [35.24066, 31.77641]
+ - [35.24154, 31.77520]
+ - [35.24714, 31.77290]
+ - [35.25005, 31.77298]
+ - [35.25199, 31.76989]
+ - [35.25418, 31.76930]
+ - [35.25573, 31.76952]
+ - [35.25882, 31.77203]
+ - [35.26184, 31.77297]
+ - [35.26642, 31.77668]
+ - [35.26861, 31.77559]
+ - [35.27075, 31.77704]
+ - [35.27213, 31.77588]
+ - [35.27547, 31.77903]
+ - [35.27873, 31.78092]
+ - [35.28079, 31.78148]
+ - [35.28611, 31.78161]
+ - [35.28953, 31.78350]
+ - [35.29103, 31.78662]
+ - [35.29924, 31.79567]
+ - [35.30396, 31.79927]
+ - [35.30791, 31.80057]
+ - [35.31323, 31.80035]
+ - [35.32044, 31.80173]
+ - [35.32474, 31.80358]
+ - [35.33006, 31.80733]
+ - [35.33916, 31.80916]
+ - [35.34317, 31.81178]
+ - [35.34465, 31.81406]
+ - [35.34671, 31.81512]
+ - [35.34980, 31.81528]
+ - [35.35357, 31.81664]
+ - [35.35924, 31.81695]
+ - [35.36096, 31.81672]
+ - [35.36370, 31.81522]
+ - [35.36731, 31.81444]
+ - [35.37280, 31.81519]
+ - [35.37692, 31.81828]
+ - [35.38035, 31.81961]
+ - [35.38622, 31.82524]
+ - [35.38825, 31.82577]
+ - [35.38957, 31.82564]
+ - [35.39028, 31.82498]
+ - [35.38982, 31.82062]
+ - [35.39238, 31.81099]
+ - [35.39622, 31.80623]
+ - [35.40054, 31.80660]
+ - [35.40423, 31.80200]
+ - [35.41210, 31.80063]
+ - [35.41554, 31.79814]
+ - [35.42172, 31.79669]
+ - [35.42447, 31.79657]
+ - [35.42774, 31.79947]
+ - [35.43113, 31.80111]
+ - [35.43494, 31.80472]
+ - [35.44074, 31.80895]
+ - [35.44272, 31.81113]
+ - [35.44365, 31.82164]
+ - [35.45173, 31.85022]
+ - [35.45281, 31.85183]
+ - [35.45552, 31.85384]
+ - [35.46000, 31.85576]
+- id: tiberias_metula_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.91
+ max_gap_m: 418
+ length_km: 58.8
+ points:
+ - [35.53330, 32.79442]
+ - [35.53346, 32.79629]
+ - [35.53479, 32.79828]
+ - [35.53471, 32.79921]
+ - [35.53023, 32.80164]
+ - [35.52583, 32.80644]
+ - [35.52359, 32.80776]
+ - [35.52129, 32.81000]
+ - [35.51744, 32.81851]
+ - [35.51471, 32.82212]
+ - [35.51083, 32.82515]
+ - [35.50900, 32.82904]
+ - [35.50951, 32.83236]
+ - [35.50877, 32.83712]
+ - [35.51581, 32.84808]
+ - [35.52851, 32.86539]
+ - [35.53064, 32.86971]
+ - [35.53210, 32.87074]
+ - [35.53536, 32.87115]
+ - [35.53859, 32.87280]
+ - [35.54418, 32.87724]
+ - [35.54532, 32.88081]
+ - [35.54713, 32.88370]
+ - [35.54630, 32.88648]
+ - [35.54875, 32.88754]
+ - [35.54959, 32.88844]
+ - [35.54675, 32.89292]
+ - [35.54466, 32.89797]
+ - [35.54062, 32.90229]
+ - [35.54119, 32.90346]
+ - [35.54549, 32.90532]
+ - [35.54721, 32.90777]
+ - [35.54685, 32.90950]
+ - [35.54440, 32.91252]
+ - [35.54334, 32.91641]
+ - [35.54244, 32.93587]
+ - [35.54469, 32.93975]
+ - [35.54510, 32.94163]
+ - [35.54295, 32.94897]
+ - [35.54281, 32.95445]
+ - [35.54161, 32.95747]
+ - [35.54138, 32.96007]
+ - [35.54196, 32.96179]
+ - [35.54796, 32.97015]
+ - [35.55166, 32.97404]
+ - [35.55513, 32.98080]
+ - [35.56436, 33.00327]
+ - [35.56403, 33.00442]
+ - [35.56108, 33.00758]
+ - [35.56093, 33.01061]
+ - [35.56283, 33.01512]
+ - [35.56670, 33.01617]
+ - [35.56922, 33.01896]
+ - [35.57093, 33.02644]
+ - [35.57055, 33.04846]
+ - [35.57258, 33.05795]
+ - [35.57411, 33.06975]
+ - [35.57377, 33.07766]
+ - [35.57244, 33.08385]
+ - [35.57347, 33.08931]
+ - [35.57347, 33.10082]
+ - [35.57200, 33.10873]
+ - [35.57089, 33.12310]
+ - [35.56784, 33.13360]
+ - [35.56952, 33.14639]
+ - [35.56970, 33.15904]
+ - [35.56890, 33.16277]
+ - [35.56857, 33.17053]
+ - [35.56571, 33.17542]
+ - [35.56506, 33.18993]
+ - [35.56538, 33.19180]
+ - [35.56750, 33.19510]
+ - [35.56766, 33.20372]
+ - [35.56948, 33.21779]
+ - [35.57524, 33.22541]
+ - [35.57659, 33.23158]
+ - [35.57850, 33.23460]
+ - [35.58067, 33.24106]
+ - [35.58048, 33.24294]
+ - [35.57944, 33.24474]
+ - [35.57599, 33.24688]
+ - [35.57314, 33.24749]
+ - [35.57210, 33.24841]
+ - [35.56944, 33.25584]
+ - [35.56959, 33.26417]
+ - [35.57456, 33.27063]
+ - [35.57506, 33.27536]
+ - [35.57601, 33.27737]
+ - [35.57536, 33.27881]
+- id: gaza_beersheba_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.96
+ max_gap_m: 358
+ length_km: 46.2
+ points:
+ - [34.46076, 31.50912]
+ - [34.46729, 31.50479]
+ - [34.47024, 31.50396]
+ - [34.47392, 31.50038]
+ - [34.47862, 31.49741]
+ - [34.48291, 31.49335]
+ - [34.48501, 31.49009]
+ - [34.49441, 31.48223]
+ - [34.50316, 31.48028]
+ - [34.51587, 31.47908]
+ - [34.52291, 31.47628]
+ - [34.53561, 31.46753]
+ - [34.55552, 31.45687]
+ - [34.56273, 31.45173]
+ - [34.57234, 31.44811]
+ - [34.57784, 31.44518]
+ - [34.58006, 31.44318]
+ - [34.58299, 31.44254]
+ - [34.59191, 31.43516]
+ - [34.59947, 31.43137]
+ - [34.60196, 31.42888]
+ - [34.60903, 31.41878]
+ - [34.61136, 31.41438]
+ - [34.61368, 31.40061]
+ - [34.61400, 31.38757]
+ - [34.61707, 31.38053]
+ - [34.61763, 31.37599]
+ - [34.61913, 31.37350]
+ - [34.62488, 31.36720]
+ - [34.64427, 31.34843]
+ - [34.64650, 31.34696]
+ - [34.65299, 31.34427]
+ - [34.65369, 31.34315]
+ - [34.65420, 31.33938]
+ - [34.65938, 31.33652]
+ - [34.66573, 31.33449]
+ - [34.66847, 31.33291]
+ - [34.67517, 31.33307]
+ - [34.67811, 31.33485]
+ - [34.67980, 31.33509]
+ - [34.68581, 31.33454]
+ - [34.68976, 31.33323]
+ - [34.69422, 31.33405]
+ - [34.69639, 31.33362]
+ - [34.69922, 31.33025]
+ - [34.70388, 31.32292]
+ - [34.70418, 31.32087]
+ - [34.70340, 31.31676]
+ - [34.70344, 31.31339]
+ - [34.70474, 31.31148]
+ - [34.70892, 31.30767]
+ - [34.70919, 31.30327]
+ - [34.71022, 31.29916]
+ - [34.71124, 31.29769]
+ - [34.71740, 31.29345]
+ - [34.72100, 31.29226]
+ - [34.72597, 31.28831]
+ - [34.73374, 31.28053]
+ - [34.73748, 31.27584]
+ - [34.73931, 31.27099]
+ - [34.74109, 31.26900]
+ - [34.74830, 31.26444]
+ - [34.75413, 31.26203]
+ - [34.75897, 31.25722]
+ - [34.76169, 31.25536]
+ - [34.77319, 31.25261]
+ - [34.78416, 31.24634]
+ - [34.78522, 31.24611]
+ - [34.78538, 31.24664]
+- id: beersheba_auja_road
+ kind: road
+ status: draft
+ from: '1946'
+ on_symbol: 0.97
+ max_gap_m: 261
+ length_km: 70.6
+ points:
+ - [34.78538, 31.24664]
+ - [34.78596, 31.24473]
+ - [34.79238, 31.23930]
+ - [34.79795, 31.23196]
+ - [34.79906, 31.22491]
+ - [34.80127, 31.22124]
+ - [34.80192, 31.21508]
+ - [34.80435, 31.21023]
+ - [34.80458, 31.20451]
+ - [34.80710, 31.19761]
+ - [34.80718, 31.17984]
+ - [34.80562, 31.17323]
+ - [34.80460, 31.16485]
+ - [34.80494, 31.16001]
+ - [34.80648, 31.15516]
+ - [34.80464, 31.14767]
+ - [34.80529, 31.14355]
+ - [34.80535, 31.13400]
+ - [34.80668, 31.12842]
+ - [34.81241, 31.12019]
+ - [34.81845, 31.11417]
+ - [34.82161, 31.10961]
+ - [34.82211, 31.10770]
+ - [34.82184, 31.10211]
+ - [34.82331, 31.10055]
+ - [34.82709, 31.09872]
+ - [34.82818, 31.09770]
+ - [34.82933, 31.09212]
+ - [34.83456, 31.08521]
+ - [34.83586, 31.08050]
+ - [34.83930, 31.07595]
+ - [34.83883, 31.06610]
+ - [34.83296, 31.06095]
+ - [34.83152, 31.05668]
+ - [34.81463, 31.04415]
+ - [34.80906, 31.03936]
+ - [34.80530, 31.03695]
+ - [34.79001, 31.02050]
+ - [34.77954, 31.01341]
+ - [34.77748, 31.01245]
+ - [34.77525, 31.01230]
+ - [34.76769, 31.01470]
+ - [34.76289, 31.01575]
+ - [34.76151, 31.01541]
+ - [34.76089, 31.01418]
+ - [34.75894, 31.00299]
+ - [34.76133, 30.99681]
+ - [34.76218, 30.99255]
+ - [34.75121, 30.98359]
+ - [34.74710, 30.98251]
+ - [34.72358, 30.97082]
+ - [34.71070, 30.96062]
+ - [34.70281, 30.95662]
+ - [34.69611, 30.95498]
+ - [34.67723, 30.95209]
+ - [34.67600, 30.95130]
+ - [34.67551, 30.94918]
+ - [34.67464, 30.94860]
+ - [34.66023, 30.94711]
+ - [34.65440, 30.94566]
+ - [34.65257, 30.94397]
+ - [34.64871, 30.93676]
+ - [34.64547, 30.93441]
+ - [34.64170, 30.93288]
+ - [34.63499, 30.92624]
+ - [34.63208, 30.92444]
+ - [34.62710, 30.92312]
+ - [34.62453, 30.92297]
+ - [34.61732, 30.92820]
+ - [34.61183, 30.92853]
+ - [34.60874, 30.93003]
+ - [34.60668, 30.93023]
+ - [34.60480, 30.92866]
+ - [34.60301, 30.92425]
+ - [34.60050, 30.92227]
+ - [34.59380, 30.91927]
+ - [34.58779, 30.91899]
+ - [34.58556, 30.91828]
+ - [34.58328, 30.91664]
+ - [34.57982, 30.91158]
+ - [34.57595, 30.90834]
+ - [34.57286, 30.90669]
+ - [34.56943, 30.90585]
+ - [34.55329, 30.89967]
+ - [34.55020, 30.89937]
+ - [34.54797, 30.89987]
+ - [34.54601, 30.90104]
+ - [34.54007, 30.90150]
+ - [34.53029, 30.90171]
+ - [34.52737, 30.90219]
+ - [34.52222, 30.90189]
+ - [34.51552, 30.90020]
+ - [34.51123, 30.89809]
+ - [34.50145, 30.89501]
+ - [34.49681, 30.89425]
+ - [34.48359, 30.89386]
+ - [34.47518, 30.89098]
+ - [34.45699, 30.88615]
+ - [34.45184, 30.88436]
+ - [34.44926, 30.88407]
+ - [34.44617, 30.88278]
+ - [34.43862, 30.88163]
+ - [34.43477, 30.87955]
+ - [34.43364, 30.87770]
diff --git a/content/map/routes_1948.yaml b/content/map/routes_1948.yaml
new file mode 100644
index 000000000..8728a39f2
--- /dev/null
+++ b/content/map/routes_1948.yaml
@@ -0,0 +1,413 @@
+# The railways and main roads of May 1948 (issue #35). Map-only: the sim never reads this file (ContentLoader reads
+# only its own files), so it does not move the content hash; the map draws it (RouteLayer) and the sim could own the
+# network later through road map actions (spec section 3: hexes hold infrastructure).
+#
+# Geometry: tools/routes_1948.py traces each route on the Survey of Palestine 1:250,000 map of 1946 (public domain;
+# scanned and georeferenced by Palestine Open Maps), from one waypoint to the next along the route's own map symbol (the
+# black railway line, the red main road; for the Burma Road, any track). The traced lines are in route_paths_1948.yaml.
+# Waypoints are towns or stations the sources name on the route, at the coordinates their Wikipedia article gives
+# (Wikipedia API prop=coordinates, as settlements_1948.yaml), or Wikidata's (CC0) where the article has none; they only
+# steer the trace, which snaps them to the symbol. Where an article's point is a modern town off the 1946 road (Kfar
+# Yona, Holon, Ashkelon for al-Majdal), the trace reaches it by a spur that the tool cuts, so the line passes up to
+# about 3 km from that waypoint and stays on the road.
+#
+# trace: the map symbol the trace follows when it is not the kind's own (the 1,050 mm narrow-gauge lines are a thin
+# line on the 1946 map, so they trace as `track`).
+# status: draft = traced and checked by eye against the 1946 map (route previews), not yet by a historian.
+# to_verify: what the sources leave open; a route with a to_verify line is not to be relied on beyond it.
+# opened: the year a cited source gives for the route's opening; left out where no source states it. Every route
+# except the Burma Road (1948) is on the 1946 map, so it ran by 1946 at the latest.
+# from / to: the window in which the map draws the route (RouteLayer shows it while the game date is inside it): a year
+# or a 'YYYY-MM-DD' date, quoted. `from` is the earliest date the cited sources support for the whole line as drawn
+# (1946, the map's date, where no source gives an earlier one); `to` is left out while the line still exists.
+map_source:
+ name: Survey of Palestine, Palestine 1:250,000, 1946 (three sheets)
+ url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ tiles: https://palopenmaps.org/tiles/pal250k-1946/{z}/{x}/{y}.jpg
+ licence: Public-Domain
+ note: PD-UKGov (expired Crown copyright, 50 years from publication for published works; HMSO treats the expiry as
+ worldwide) and PD-scan, as Wikimedia Commons files these sheets (e.g. File:Gaza_sh._04,_1946.jpg). Palestine Open
+ Maps scanned and georeferenced it; its About page calls its maps public domain under the UK Copyright, Designs and
+ Patents Act and publishes no terms of its own for the tiles or the georeferencing. The traced lines are our own
+ derivative and copy none of its layers. Checked against station coordinates (about 100 m).
+ checked: '2026-10-11'
+routes:
+# --- Railways (Palestine Railways, 1920-1948) ------------------------------------------------------------------------
+- id: jaffa_jerusalem_railway
+ name: Jaffa–Jerusalem railway
+ kind: rail
+ opened: 1892
+ from: '1920-10-05'
+ status: draft
+ note: Jaffa terminus to Lydda junction, then Ramla, the Sorek valley and Battir to Jerusalem; opened 1892 as a metre
+ gauge line. The Jaffa–Lydda track was removed by the Ottoman army in 1915 (Palestine Railways), relaid as a 600 mm
+ line in February 1918, and rebuilt to standard gauge, finished in September 1920 and inaugurated on 5 October 1920
+ (Jaffa–Jerusalem railway), so the line as drawn dates from then. Service stopped during the 1948 war (Jaffa–Jerusalem
+ railway); regular trains between Ramla and Jerusalem resumed in March 1950 (Palestine Railways).
+ to_verify:
+ - The Jaffa station's closing date (August 1948 in the earlier note) is not in the cited articles' text.
+ via:
+ - {name: Jaffa railway station, lon: 34.7614, lat: 32.059, url: 'https://en.wikipedia.org/wiki/Jaffa_railway_station'}
+ - {name: Lod railway station, lon: 34.87556, lat: 31.94583, url: 'https://en.wikipedia.org/wiki/Lod_railway_station'}
+ - {name: Ramla railway station, lon: 34.87684, lat: 31.92936, url: 'https://en.wikipedia.org/wiki/Ramla_railway_station'}
+ - {name: Beit Shemesh railway station (Artuf), lon: 34.99088, lat: 31.75744, url: 'https://en.wikipedia.org/wiki/Beit_Shemesh_railway_station'}
+ - {name: Battir, lon: 35.13667, lat: 31.72472, url: 'https://en.wikipedia.org/wiki/Battir'}
+ - {name: Jerusalem (Khan) railway station, lon: 35.22471, lat: 31.76685, url: 'https://www.wikidata.org/wiki/Q2920513'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Jaffa%E2%80%93Jerusalem_railway
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Palestine_Railways
+ checked: '2026-10-11'
+- id: kantara_main_line_south
+ name: Haifa–El Kantara main line (Lydda to Rafah)
+ kind: rail
+ opened: 1920
+ from: '1946'
+ status: draft
+ note: The Palestine Railways main line south of Lydda. It opened to passengers on 1 November 1920, linking El Kantara
+ by Gaza and Majdal to Lydda (Lod–Ashkelon railway); the more direct section Majdal–Isdud–Yibna–Lydda drawn here (the
+ 1946 map's) was built after it. Severed at the Gaza front in 1948; freight ran Lod–Majdal (Lod–Ashkelon railway).
+ to_verify:
+ - The year the direct Majdal–Isdud–Yibna–Lydda section opened (not given by the cited source), so the line as drawn
+ is dated from the 1946 map.
+ via:
+ - {name: Lod railway station, lon: 34.87556, lat: 31.94583, url: 'https://en.wikipedia.org/wiki/Lod_railway_station'}
+ - {name: Rehovot railway station, lon: 34.80639, lat: 31.90889, url: 'https://en.wikipedia.org/wiki/Rehovot_railway_station'}
+ - {name: Yibna, lon: 34.74639, lat: 31.86611, url: 'https://en.wikipedia.org/wiki/Yibna'}
+ - {name: Isdud, lon: 34.66167, lat: 31.75361, url: 'https://en.wikipedia.org/wiki/Isdud'}
+ - {name: 'Ashkelon (its article''s point, by al-Majdal)', lon: 34.56667, lat: 31.66667, url: 'https://en.wikipedia.org/wiki/Ashkelon'}
+ - {name: Dir Snid station, lon: 34.55776, lat: 31.58195, url: 'https://www.wikidata.org/wiki/Q6880658'}
+ - {name: Beit Hanoun, lon: 34.5372, lat: 31.5386, url: 'https://en.wikipedia.org/wiki/Beit_Hanoun'}
+ - {name: Gaza City, lon: 34.45972, lat: 31.5075, url: 'https://en.wikipedia.org/wiki/Gaza_City'}
+ - {name: Deir al-Balah, lon: 34.35167, lat: 31.41889, url: 'https://en.wikipedia.org/wiki/Deir_al-Balah'}
+ - {name: Khan Yunis, lon: 34.30306, lat: 31.34444, url: 'https://en.wikipedia.org/wiki/Khan_Yunis'}
+ - {name: Rafah, lon: 34.25861, lat: 31.2725, url: 'https://en.wikipedia.org/wiki/Rafah'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Lod%E2%80%93Ashkelon_railway
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Palestine_Railways
+ checked: '2026-10-11'
+- id: eastern_railway
+ name: Eastern Railway (Lydda to Hadera)
+ kind: rail
+ opened: 1915
+ from: '1915'
+ status: draft
+ note: Built by the Ottoman army in 1915 and converted to standard gauge by the British; the main north-south line of
+ the Mandate. Mandate stations Lydda, Kafr Jinis, Rantiya, Rosh HaAyin, Qalqilya, Tulkarm, Qaqun, Hadera. Israel
+ later bypassed the stretch through Tulkarm (not drawn here).
+ to_verify:
+ - The Tulkarm bypass date. The sources disagree. Palestine Railways says August 1948; Eastern Railway (Israel) says
+ 1949.
+ via:
+ - {name: Lod railway station, lon: 34.87556, lat: 31.94583, url: 'https://en.wikipedia.org/wiki/Lod_railway_station'}
+ - {name: Rosh HaAyin South railway station, lon: 34.93472, lat: 32.10417, url: 'https://www.wikidata.org/wiki/Q7223530'}
+ - {name: Qalqilya, lon: 34.96861, lat: 32.19028, url: 'https://en.wikipedia.org/wiki/Qalqilya'}
+ - {name: Tulkarm, lon: 35.02667, lat: 32.3125, url: 'https://en.wikipedia.org/wiki/Tulkarm'}
+ - {name: Qaqun (Ahituv station), lon: 35.00194, lat: 32.38356, url: 'https://www.wikidata.org/wiki/Q6777881'}
+ - {name: Hadera East railway station, lon: 34.95, lat: 32.44611, url: 'https://www.wikidata.org/wiki/Q7012759'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Eastern_Railway_(Israel)
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Palestine_Railways
+ checked: '2026-10-11'
+- id: hadera_haifa_railway
+ name: Main line, Hadera to Haifa
+ kind: rail
+ opened: 1918
+ from: '1918'
+ status: draft
+ note: The British Army's standard gauge line from Tulkarm "on a new route northwest to the coast and then northwards,
+ reaching Haifa by the end of 1918" (Palestine Railways); part of the main line. In 1948 Israel's trains ran on it
+ from Haifa as far south as Hadera (Palestine Railways).
+ via:
+ - {name: Hadera East railway station, lon: 34.95, lat: 32.44611, url: 'https://www.wikidata.org/wiki/Q7012759'}
+ - {name: Binyamina railway station, lon: 34.94972, lat: 32.51389, url: 'https://en.wikipedia.org/wiki/Binyamina_railway_station'}
+ - {name: Atlit railway station, lon: 34.9402, lat: 32.69275, url: 'https://en.wikipedia.org/wiki/Atlit_railway_station'}
+ - {name: Haifa East railway station, lon: 35.00472, lat: 32.81194, url: 'https://en.wikipedia.org/wiki/Haifa_East_railway_station'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Eastern_Railway_(Israel)
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Palestine_Railways
+ checked: '2026-10-11'
+- id: haifa_beirut_railway
+ name: Haifa–Acre line and the Haifa–Beirut–Tripoli railway
+ kind: rail
+ opened: 1913
+ from: '1942'
+ status: draft
+ note: Haifa to Acre (an extension of the Jezreel Valley line from Balad al-Sheikh, finished at the end of 1912 or in
+ 1913; the Jezreel Valley railway article gives both), continued north along the coast in 1942 by the wartime
+ Haifa–Beirut–Tripoli line through Nahariya and the Ras an-Naqura tunnels (Rosh HaNikra grottoes), so the whole line
+ as drawn dates from 1942. The Palmach destroyed the railway bridge at Rosh HaNikra in late February 1948, cutting the
+ line at the border (Rosh HaNikra grottoes); in 1948 Israel's trains ran north from Haifa to Kiryat Motzkin and later
+ Nahariya (Palestine Railways).
+ to_verify:
+ - The map's 1946 sheets show the line north of Acre; the Haifa–Acre alignment is the one the sheet shows, not checked
+ against the 1913 branch's own plans.
+ via:
+ - {name: Haifa East railway station, lon: 35.00472, lat: 32.81194, url: 'https://en.wikipedia.org/wiki/Haifa_East_railway_station'}
+ - {name: Acre railway station, lon: 35.08282, lat: 32.92815, url: 'https://en.wikipedia.org/wiki/Acre_railway_station'}
+ - {name: Nahariya railway station, lon: 35.09889, lat: 33.00528, url: 'https://en.wikipedia.org/wiki/Nahariya_railway_station'}
+ - {name: Rosh HaNikra grottoes, lon: 35.10477, lat: 33.09312, url: 'https://en.wikipedia.org/wiki/Rosh_HaNikra_grottoes'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Jezreel_Valley_railway
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Palestine_Railways
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Rosh_HaNikra_grottoes
+ checked: '2026-10-11'
+- id: jezreel_valley_railway
+ name: Jezreel Valley railway (Haifa to Samakh and al-Hamma)
+ kind: rail
+ opened: 1905
+ from: '1905-10-15'
+ status: draft
+ trace: track
+ note: The narrow gauge branch of the Hejaz Railway, Haifa to Daraa (beyond the map), inaugurated on 15 October 1905.
+ Its bridge between Samakh and al-Hamma was blown up in the Night of the Bridges (June 1946), cutting it off from
+ the rest of the Hejaz line; a bridge near Geva was blown on 2 March 1948 and the Jordan bridge at Gesher on 14 May
+ 1948 (Jezreel Valley railway). Israel Railways repaired Haifa–Afula; that service ended in 1949, with occasional use
+ until September 1951 (Jezreel Valley railway). The track stays drawn, as it still lay on the ground.
+ via:
+ - {name: Haifa East railway station, lon: 35.00472, lat: 32.81194, url: 'https://en.wikipedia.org/wiki/Haifa_East_railway_station'}
+ - {name: Kfar Yehoshua, lon: 35.15389, lat: 32.68361, url: 'https://en.wikipedia.org/wiki/Kfar_Yehoshua'}
+ - {name: Afula, lon: 35.28806, lat: 32.60639, url: 'https://en.wikipedia.org/wiki/Afula'}
+ - {name: Beit She'an former railway station, lon: 35.4936, lat: 32.5128, url: 'https://www.wikidata.org/wiki/Q15281118'}
+ - {name: Samakh railway station, lon: 35.587, lat: 32.7032, url: 'https://www.wikidata.org/wiki/Q7046720'}
+ - {name: Al-Hamma station, lon: 35.66648, lat: 32.68675, url: 'https://www.wikidata.org/wiki/Q18192250'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Jezreel_Valley_railway
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Palestine_Railways
+ checked: '2026-10-11'
+# --- Main roads (red on the 1946 map) -------------------------------------------------------------------------------
+- id: jaffa_jerusalem_road
+ name: Jaffa–Jerusalem road (by Latrun and Bab al-Wad)
+ kind: road
+ from: '1946'
+ status: draft
+ note: The road the convoys of the 1947-48 siege of Jerusalem drove; from Bab al-Wad (Sha'ar HaGai) it climbs past
+ Saris and al-Qastal. The Arab Legion held Latrun from 18 May 1948.
+ via:
+ - {name: Jaffa, lon: 34.75306, lat: 32.05222, url: 'https://en.wikipedia.org/wiki/Jaffa'}
+ - {name: Yazur, lon: 34.80472, lat: 32.02611, url: 'https://en.wikipedia.org/wiki/Yazur'}
+ - {name: Ramla, lon: 34.8625, lat: 31.9275, url: 'https://en.wikipedia.org/wiki/Ramla'}
+ - {name: Latrun, lon: 34.98139, lat: 31.83194, url: 'https://en.wikipedia.org/wiki/Latrun'}
+ - {name: Sha'ar HaGai (Bab al-Wad), lon: 35.03333, lat: 31.81667, url: 'https://en.wikipedia.org/wiki/Sha%27ar_HaGai'}
+ - {name: Al-Qastal, lon: 35.14417, lat: 31.79556, url: 'https://en.wikipedia.org/wiki/Al-Qastal,_Jerusalem'}
+ - {name: Jerusalem, lon: 35.22556, lat: 31.77889, url: 'https://en.wikipedia.org/wiki/Jerusalem'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Burma_Road_(Israel)
+ checked: '2026-10-11'
+ - url: https://en.wikipedia.org/wiki/Battles_of_Latrun_(1948)
+ checked: '2026-10-11'
+- id: burma_road
+ name: Burma Road (1948)
+ kind: track
+ opened: 1948
+ from: '1948-06-14'
+ status: draft
+ note: The makeshift bypass of Latrun built in May-June 1948, from just east of Dayr Muhaysin by Bayt Jiz and Bayt
+ Susin, up to Bayt Mahsir and Saris, joining the old Jerusalem road. The first jeep attempt failed on the night of
+ 30-31 May and a second got through the next night (31 May - 1 June); the steepest section opened to vehicles on 10
+ June and the road was completed on 14 June 1948 (Burma Road (Israel)), the date the map shows it from.
+ to_verify:
+ - Built after the 1946 map, so the trace follows the tracks the map shows between the places the source names; the
+ 1948 line differs where the builders cut new road (the steep ascent above Bayt Susin).
+ via:
+ - {name: Dayr Muhaysin, lon: 34.93444, lat: 31.82833, url: 'https://en.wikipedia.org/wiki/Dayr_Muhaysin'}
+ - {name: Bayt Jiz, lon: 34.95417, lat: 31.81278, url: 'https://en.wikipedia.org/wiki/Bayt_Jiz'}
+ - {name: Bayt Susin, lon: 34.98361, lat: 31.80611, url: 'https://en.wikipedia.org/wiki/Bayt_Susin'}
+ - {name: Bayt Mahsir, lon: 35.03472, lat: 31.79444, url: 'https://en.wikipedia.org/wiki/Bayt_Mahsir'}
+ - {name: Saris, lon: 35.07389, lat: 31.79806, url: 'https://en.wikipedia.org/wiki/Saris,_Jerusalem'}
+ sources:
+ - url: https://en.wikipedia.org/wiki/Burma_Road_(Israel)
+ checked: '2026-10-11'
+- id: tel_aviv_haifa_road
+ name: Tel Aviv–Haifa road (by Ra'anana and Hadera)
+ kind: road
+ opened: 1937
+ from: '1937'
+ status: draft
+ note: The inland coastal-plain road the 1946 map shows from Tel Aviv by Ra'anana, Kefar Yona and Hadera, then along
+ the foot of Mount Carmel by Fureidis and Atlit to Haifa.
+ to_verify:
+ - The opening year 1937 is the Hadera–Haifa section's (OpenHistoricalMap way dates); the southern section may be
+ older.
+ via:
+ - {name: Tel Aviv, lon: 34.78, lat: 32.08, url: 'https://en.wikipedia.org/wiki/Tel_Aviv'}
+ - {name: Ra'anana, lon: 34.86667, lat: 32.18333, url: 'https://en.wikipedia.org/wiki/Ra%27anana'}
+ - {name: Kfar Yona, lon: 34.93576, lat: 32.3171, url: 'https://en.wikipedia.org/wiki/Kfar_Yona'}
+ - {name: Hadera, lon: 34.91667, lat: 32.45, url: 'https://en.wikipedia.org/wiki/Hadera'}
+ - {name: Pardes Hanna-Karkur, lon: 34.9675, lat: 32.47111, url: 'https://en.wikipedia.org/wiki/Pardes_Hanna-Karkur'}
+ - {name: Fureidis, lon: 34.95056, lat: 32.59667, url: 'https://en.wikipedia.org/wiki/Fureidis'}
+ - {name: Atlit railway station, lon: 34.9402, lat: 32.69275, url: 'https://en.wikipedia.org/wiki/Atlit_railway_station'}
+ - {name: Haifa, lon: 34.99917, lat: 32.81917, url: 'https://en.wikipedia.org/wiki/Haifa'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+ - url: https://www.openhistoricalmap.org/way/201475508
+ checked: '2026-10-11'
+- id: coastal_road_south
+ name: Coastal road south (Jaffa to Gaza and Rafah)
+ kind: road
+ from: '1946'
+ status: draft
+ note: The main road south from Jaffa by Yibna, Isdud and Majdal to Gaza, Khan Yunis and Rafah.
+ via:
+ - {name: Jaffa, lon: 34.75306, lat: 32.05222, url: 'https://en.wikipedia.org/wiki/Jaffa'}
+ - {name: Holon, lon: 34.76667, lat: 32.01667, url: 'https://en.wikipedia.org/wiki/Holon'}
+ - {name: Yibna, lon: 34.74639, lat: 31.86611, url: 'https://en.wikipedia.org/wiki/Yibna'}
+ - {name: Isdud, lon: 34.66167, lat: 31.75361, url: 'https://en.wikipedia.org/wiki/Isdud'}
+ - {name: 'Ashkelon (its article''s point, by al-Majdal)', lon: 34.56667, lat: 31.66667, url: 'https://en.wikipedia.org/wiki/Ashkelon'}
+ - {name: Gaza City, lon: 34.45972, lat: 31.5075, url: 'https://en.wikipedia.org/wiki/Gaza_City'}
+ - {name: Khan Yunis, lon: 34.30306, lat: 31.34444, url: 'https://en.wikipedia.org/wiki/Khan_Yunis'}
+ - {name: Rafah, lon: 34.25861, lat: 31.2725, url: 'https://en.wikipedia.org/wiki/Rafah'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+- id: haifa_acre_naqura_road
+ name: Haifa–Acre–Ras an-Naqura road
+ kind: road
+ opened: 1933
+ from: '1933'
+ status: draft
+ note: The coast road north from Haifa by Acre and Nahariya to the Lebanese border at Ras an-Naqura.
+ via:
+ - {name: Haifa, lon: 34.99917, lat: 32.81917, url: 'https://en.wikipedia.org/wiki/Haifa'}
+ - {name: Acre, lon: 35.08167, lat: 32.92778, url: 'https://en.wikipedia.org/wiki/Acre,_Israel'}
+ - {name: Nahariya, lon: 35.09889, lat: 33.00583, url: 'https://en.wikipedia.org/wiki/Nahariya'}
+ - {name: Rosh HaNikra grottoes, lon: 35.10477, lat: 33.09312, url: 'https://en.wikipedia.org/wiki/Rosh_HaNikra_grottoes'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+ - url: https://www.openhistoricalmap.org/way/201490910
+ checked: '2026-10-11'
+- id: jerusalem_hebron_beersheba_road
+ name: Jerusalem–Hebron–Beersheba road
+ kind: road
+ from: '1946'
+ status: draft
+ note: South from Jerusalem by Bethlehem and Hebron, then down to Beersheba by ad-Dhahiriya.
+ via:
+ - {name: Jerusalem, lon: 35.22556, lat: 31.77889, url: 'https://en.wikipedia.org/wiki/Jerusalem'}
+ - {name: Bethlehem, lon: 35.20639, lat: 31.70444, url: 'https://en.wikipedia.org/wiki/Bethlehem'}
+ - {name: Hebron, lon: 35.09694, lat: 31.52861, url: 'https://en.wikipedia.org/wiki/Hebron'}
+ - {name: Ad-Dhahiriya, lon: 34.97222, lat: 31.40778, url: 'https://en.wikipedia.org/wiki/Ad-Dhahiriya'}
+ - {name: Beersheba, lon: 34.7867, lat: 31.2522, url: 'https://en.wikipedia.org/wiki/Beersheba'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+ - url: https://www.openhistoricalmap.org/way/202064412
+ checked: '2026-10-11'
+- id: jerusalem_nablus_nazareth_road
+ name: Jerusalem–Nablus–Jenin–Nazareth road
+ kind: road
+ from: '1946'
+ status: draft
+ note: The hill-country road north from Jerusalem by al-Bireh (Ramallah), Sinjil and Huwara to Nablus, then by Deir
+ Sharaf and Jaba' to Jenin, across the Jezreel
+ Valley at Afula to Nazareth.
+ via:
+ - {name: Jerusalem, lon: 35.22556, lat: 31.77889, url: 'https://en.wikipedia.org/wiki/Jerusalem'}
+ - {name: Al-Bireh, lon: 35.215, lat: 31.90528, url: 'https://en.wikipedia.org/wiki/Al-Bireh'}
+ - {name: Sinjil, lon: 35.26417, lat: 32.03306, url: 'https://en.wikipedia.org/wiki/Sinjil'}
+ - {name: Huwara, lon: 35.25667, lat: 32.1525, url: 'https://en.wikipedia.org/wiki/Huwara'}
+ - {name: Nablus, lon: 35.26083, lat: 32.22111, url: 'https://en.wikipedia.org/wiki/Nablus'}
+ - {name: Deir Sharaf, lon: 35.18806, lat: 32.25417, url: 'https://en.wikipedia.org/wiki/Deir_Sharaf'}
+ - {name: Jaba', lon: 35.22222, lat: 32.32389, url: 'https://en.wikipedia.org/wiki/Jaba%27,_Jenin'}
+ - {name: Jenin, lon: 35.3, lat: 32.46111, url: 'https://en.wikipedia.org/wiki/Jenin'}
+ - {name: Afula, lon: 35.28806, lat: 32.60639, url: 'https://en.wikipedia.org/wiki/Afula'}
+ - {name: Nazareth, lon: 35.30333, lat: 32.70194, url: 'https://en.wikipedia.org/wiki/Nazareth'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+- id: tel_aviv_tulkarm_nablus_road
+ name: Tel Aviv–Petah Tikva–Tulkarm–Nablus road
+ kind: road
+ from: '1946'
+ status: draft
+ note: East from Tel Aviv by Petah Tikva and Ras al-Ein, north by Qalqilya to Tulkarm, then up into the hills by
+ Anabta and Deir Sharaf to Nablus.
+ via:
+ - {name: Tel Aviv, lon: 34.78, lat: 32.08, url: 'https://en.wikipedia.org/wiki/Tel_Aviv'}
+ - {name: Petah Tikva, lon: 34.88639, lat: 32.08889, url: 'https://en.wikipedia.org/wiki/Petah_Tikva'}
+ - {name: Rosh HaAyin (Ras al-Ein), lon: 34.95667, lat: 32.09556, url: 'https://en.wikipedia.org/wiki/Rosh_HaAyin'}
+ - {name: Qalqilya, lon: 34.96861, lat: 32.19028, url: 'https://en.wikipedia.org/wiki/Qalqilya'}
+ - {name: Tulkarm, lon: 35.02667, lat: 32.3125, url: 'https://en.wikipedia.org/wiki/Tulkarm'}
+ - {name: Anabta, lon: 35.11694, lat: 32.30722, url: 'https://en.wikipedia.org/wiki/Anabta'}
+ - {name: Deir Sharaf, lon: 35.18806, lat: 32.25417, url: 'https://en.wikipedia.org/wiki/Deir_Sharaf'}
+ - {name: Nablus, lon: 35.26083, lat: 32.22111, url: 'https://en.wikipedia.org/wiki/Nablus'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+- id: haifa_nazareth_tiberias_road
+ name: Haifa–Nazareth–Tiberias road
+ kind: road
+ from: '1946'
+ status: draft
+ note: South-east from Haifa through the Jezreel Valley by Nahalal to Nazareth, then by Kafr Kanna down to Tiberias.
+ via:
+ - {name: Haifa, lon: 34.99917, lat: 32.81917, url: 'https://en.wikipedia.org/wiki/Haifa'}
+ - {name: Nahalal, lon: 35.19667, lat: 32.69, url: 'https://en.wikipedia.org/wiki/Nahalal'}
+ - {name: Nazareth, lon: 35.30333, lat: 32.70194, url: 'https://en.wikipedia.org/wiki/Nazareth'}
+ - {name: Kafr Kanna, lon: 35.35, lat: 32.75, url: 'https://en.wikipedia.org/wiki/Kafr_Kanna'}
+ - {name: Tiberias, lon: 35.53333, lat: 32.79444, url: 'https://en.wikipedia.org/wiki/Tiberias'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+- id: jerusalem_jericho_road
+ name: Jerusalem–Jericho road
+ kind: road
+ from: '1946'
+ status: draft
+ note: East from Jerusalem by al-Eizariya (Bethany) down to Jericho.
+ via:
+ - {name: Jerusalem, lon: 35.22556, lat: 31.77889, url: 'https://en.wikipedia.org/wiki/Jerusalem'}
+ - {name: Al-Eizariya (Bethany), lon: 35.26444, lat: 31.77, url: 'https://en.wikipedia.org/wiki/Bethany'}
+ - {name: Jericho, lon: 35.46, lat: 31.85611, url: 'https://en.wikipedia.org/wiki/Jericho'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+- id: tiberias_metula_road
+ name: Tiberias–Rosh Pinna–Metula road
+ kind: road
+ from: '1946'
+ status: draft
+ note: North from Tiberias along the Sea of Galilee to Rosh Pinna, then up the Hula Valley to Metula.
+ via:
+ - {name: Tiberias, lon: 35.53333, lat: 32.79444, url: 'https://en.wikipedia.org/wiki/Tiberias'}
+ - {name: Rosh Pinna, lon: 35.54222, lat: 32.97, url: 'https://en.wikipedia.org/wiki/Rosh_Pinna'}
+ - {name: Metula, lon: 35.57444, lat: 33.27889, url: 'https://en.wikipedia.org/wiki/Metula'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+- id: gaza_beersheba_road
+ name: Gaza–Beersheba road
+ kind: road
+ from: '1946'
+ status: draft
+ note: South-east from Gaza across the northern Negev to Beersheba.
+ via:
+ - {name: Gaza City, lon: 34.45972, lat: 31.5075, url: 'https://en.wikipedia.org/wiki/Gaza_City'}
+ - {name: Beersheba, lon: 34.7867, lat: 31.2522, url: 'https://en.wikipedia.org/wiki/Beersheba'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+ - url: https://www.openhistoricalmap.org/way/202059844
+ checked: '2026-10-11'
+- id: beersheba_auja_road
+ name: Beersheba–Auja al-Hafir road
+ kind: road
+ from: '1946'
+ status: draft
+ note: South-west from Beersheba across the Negev to Auja al-Hafir (Nitzana) on the Egyptian border.
+ via:
+ - {name: Beersheba, lon: 34.7867, lat: 31.2522, url: 'https://en.wikipedia.org/wiki/Beersheba'}
+ - {name: Auja al-Hafir, lon: 34.43694, lat: 30.87417, url: 'https://en.wikipedia.org/wiki/Auja_al-Hafir'}
+ sources:
+ - url: https://palopenmaps.org/en/maps?basemap=pal250k1946
+ checked: '2026-10-11'
+ - url: https://www.openhistoricalmap.org/way/202064413
+ checked: '2026-10-11'
diff --git a/docs/routes.md b/docs/routes.md
new file mode 100644
index 000000000..e084c6340
--- /dev/null
+++ b/docs/routes.md
@@ -0,0 +1,291 @@
+# Railways and roads of 1948 (issue #35)
+
+The map draws the railways and main roads of 1948, each from its sourced date, after the promo (`promo/final/03-gameplay-1936.png`,
+`02-map-diorama.png`, and the 0:21 close-up of `promo/demo/out/demo-16x9.mp4`). Civilian boats are out of scope (owner).
+
+## Files
+
+| What | Where |
+|---|---|
+| Routes, sources, waypoints, status (hand-written) | `content/map/routes_1948.yaml` |
+| Traced lines (generated) | `content/map/route_paths_1948.yaml` |
+| Tracer | `tools/routes_1948.py` (tests: `tools/tests/test_routes_1948.py`) |
+| Map layer | `unity/Assets/Scripts/Map/Routes/` (`RoutePaths`, `RouteLayer`, `RouteTrain`, `TrainModels`) |
+| Shader and materials | `unity/Assets/Shaders/Route.shader`; `Resources/Routes/Rail.mat`, `Road.mat` (`RouteMaterialAssets.Create`) |
+| Tests | `unity/Assets/Tests/EditMode/RouteTests.cs` |
+
+Both route files are map-only. `ContentLoader` never reads them, so the content hash and the goldens do not move
+(`RouteTests.TheRoutesDoNotMoveTheContentHash` loads the content with and without them). The game reads only the
+traced file, so the WebGL manifest ships only that one: `ContentManifest.ToolInputs` leaves the hand-written
+`routes_1948.yaml` out. If the traced file is missing or malformed (a stale manifest, an old content copy), the map
+builds without routes and logs a warning (`RoutePaths.ReadOrNone`). A route with an impossible date (year 0000, a 13th
+month) is skipped alone, with a warning.
+
+## The data
+
+**Source of every line:** the Survey of Palestine 1:250,000 map of 1946 (three sheets).
+- It is public domain: PD-UKGov. It is a Mandate government survey published in 1946. Crown copyright on published
+ works lasts 50 years from publication, and HMSO treats the expiry as worldwide. It is also PD-scan.
+ - That is how Wikimedia Commons files these sheets, for example `File:Gaza_sh._04,_1946.jpg` (checked 2026-10-11).
+- The scans and georeferencing are Palestine Open Maps' (credited in `NOTICE`).
+ - Their About page calls the maps public domain under the UK Copyright, Designs and Patents Act. It publishes no terms
+ of its own for the tiles or the georeferencing.
+ - The traced lines are our own derivative and copy none of its layers.
+ - Station coordinates fall on their map symbols to about 100 m.
+
+**How a line is made.** `tools/routes_1948.py` traces each route from waypoint to waypoint.
+- The waypoints are towns and stations that the cited sources name on the route. Their coordinates come from the
+ Wikipedia API (`prop=coordinates`, as `settlements_1948.yaml`), or from Wikidata (CC0) where the article has none.
+- Between two waypoints the line is the least-cost path over the scanned map. A pixel costs 1 on the route's own
+ symbol: the red main road, or the black railway (thick, with white dashes). A thin dark line costs 4 for a railway
+ (curves drawn thinner, as in the Sorek canyon). Any other pixel costs 40.
+- The 1,050 mm narrow-gauge Jezreel Valley line is drawn thin, so it traces as a `track`.
+- A waypoint first snaps to its symbol within 1.5 km. A waypoint off the line (a town circle, its name, a modern
+ town's point such as Ashkelon's for al-Majdal) is reached by an out-and-back spur, which the tool cuts.
+- The chain is smoothed over 15 pixels and simplified at 35 m. With 5 pixels, the close views showed a 100–200 m
+ wobble: the trace hops between the two edges of a thick symbol.
+- A hook at either end is cut. The line goes out to a waypoint just off the route's end and back; for example the Burma
+ Road began "just east of Dayr Muhaysin".
+- `--preview DIR` writes every traced segment over the map, which is how each was checked by eye.
+- The tool records each trace's quality in the generated file, and `test_routes_1948.py` guards both values, so an
+ invented chord cannot hide in a straight stretch:
+ - `on_symbol`: the share of traced pixels on the route's own symbol, at least 0.85; today 0.87–1.00.
+ - `max_gap_m`: the longest stretch of the kept line off that symbol, at most 800 m; today at most 632 m.
+ - Those stretches are names printed over a road, and towns.
+- Roads printed over the valleys' green tint read darker, about RGB (146, 64, 42) by the Sea of Galilee, so the road
+ colour rule takes those too. The hill tint's orange stays out, because its green and blue differ by 60 or more.
+
+**The routes.** Every route has `status: draft`: traced and checked by eye against the 1946 map, and reviewed once by a
+staff and historian review (2026-10-11), whose fixes are in. `to_verify` lines say what the sources leave open. Every
+note states only what its cited source says, and the source is named in the note.
+
+**Dates.** Each route has a display window, `from` and optionally `to`. The map shows a route only while the game date
+is inside it (review C1):
+- `RouteLayer` builds one ribbon group per window.
+- `RouteLayer.ShowAt` switches the groups. The game calls it with its date on every state change (`GameRoot`).
+- `ShowAt` also remembers the date on the map (`MapScene.RouteDate`), so a map rebuilt mid-game draws its routes as at
+ the game's date at once.
+- It is presentation only: the sim does not read the routes, and no golden moves.
+- `from` is the earliest date the sources support for the whole line as drawn. Where no source gives an earlier one, it
+ is 1946, the map's date.
+
+| Kind | Route | from | Notes |
+|---|---|---|---|
+| rail | Jaffa–Jerusalem railway | 1920-10-05 | Opened 1892. The Jaffa–Lydda track was removed in 1915, laid at 600 mm in 1918, and rebuilt to standard gauge (inaugurated 5 October 1920). Service stopped in the 1948 war; Ramla–Jerusalem trains resumed in March 1950. |
+| rail | Main line, Lydda to Rafah | 1946 | Opened 1 November 1920 by Gaza and Majdal to Lydda. The direct Majdal–Isdud–Yibna–Lydda section drawn here came later, with no year in the source (to-verify). |
+| rail | Eastern Railway, Lydda to Hadera | 1915 | The Tulkarm bypass is not drawn. Its date is to-verify: August 1948 (Palestine Railways) or 1949 (Eastern Railway). |
+| rail | Main line, Hadera to Haifa | 1918 | "Reaching Haifa by the end of 1918" (Palestine Railways). In 1948 Israel's trains ran on it from Haifa to Hadera. |
+| rail | Haifa–Acre and the Haifa–Beirut–Tripoli line | 1942 | Haifa–Acre opened 1913; the line north to Ras an-Naqura opened 1942. The Rosh HaNikra railway bridge was destroyed in late February 1948. |
+| rail | Jezreel Valley railway, Haifa to al-Hamma | 1905-10-15 | Cut off from the Hejaz line since the June 1946 Night of the Bridges, then cut at Geva (2 March 1948) and Gesher (14 May 1948). The track stays drawn. |
+| road | Jaffa–Jerusalem by Latrun and Bab al-Wad, the coastal road south to Rafah, Jerusalem–Hebron–Beersheba, Jerusalem–Nablus–Jenin–Nazareth, Tel Aviv–Tulkarm–Nablus, Haifa–Nazareth–Tiberias, Jerusalem–Jericho, Tiberias–Metula, Gaza–Beersheba, Beersheba–Auja al-Hafir | 1946 | Red main roads on the 1946 map. |
+| road | Tel Aviv–Haifa | 1937 | The Hadera–Haifa section's date (OpenHistoricalMap), to-verify. |
+| road | Haifa–Acre–Ras an-Naqura | 1933 | OpenHistoricalMap way dates. |
+| track | Burma Road | 1948-06-14 | Completed on 14 June 1948. The first jeep attempt failed on the night of 30–31 May; a second got through on 31 May – 1 June. Drawn along the 1946 tracks (to-verify). It is hidden at the 15 May start. |
+
+**Left out, on purpose.**
+- The Afula–Nablus–Tulkarm branch: its service ended in 1932 and 1938 (Palestine Railways article). Freight on the
+ Tulkarm–Nablus part ended in July 1946 (Jezreel Valley railway).
+- The Ottoman Beersheba line: dismantled after the First World War.
+- Branches with no 1948 source here: the Petah Tikva branch, and the port and quarry sidings.
+
+**Accuracy, measured but nothing copied.** `uv run tools/routes_accuracy.py --fetch` reproduces this table. It
+downloads the references into the git-ignored `tools/.cache/routes-accuracy/`.
+- OpenHistoricalMap (CC0) has the Jaffa–Jerusalem railway with its dates.
+- OpenStreetMap has today's lines and pieces of the abandoned ones. It is ODbL, which this repository's licence policy
+ does not allow, so its geometry is used only to measure ours.
+
+| Route | Reference | Median distance | Within 300 m |
+|---|---|---|---|
+| Jaffa–Jerusalem railway | OHM, 1890 ways | 68 m | 96% |
+| Eastern Railway | OSM rail, current and abandoned | 112 m | 87% |
+| Hadera–Haifa railway | OSM | 214 m | 84% |
+| Jezreel Valley railway | OSM | 152 m | 83% |
+| Haifa–Beirut railway | OSM | 242 m | 73% |
+| Main line south | OSM | 139 m | 58% |
+| Beersheba–Auja road | OHM roads valid in 1948 | 30 m | 100% |
+| Gaza–Beersheba road | OHM | 185 m | 93% |
+
+- The misses on the railways are the reference's, not the trace's. Today's lines were rebuilt off the old alignment:
+ near Rosh HaAyin the 1946 line runs past Rantiya and Wilhelma, and south of Ashkelon it differs too. OSM has almost
+ nothing in the Gaza Strip.
+- The rest is the 1:250,000 sheet's generalisation of tight curves.
+- OHM has 1948 roads only in patches, so most roads have no reference.
+
+## How it is drawn
+
+**Ribbons, not a texture.**
+- The roads and railways are meshes draped on the terrain: one mesh per look and display window.
+- The other way was to bake them into a texture the terrain shader samples, as promo-land does for its tracks
+ (`tracks.png`). It was not taken, for three reasons:
+ - A railway needs a coordinate along its line for the sleepers. A distance-field texture has only the distance across.
+ - At promo-land's 316 x 421 m texel, a 680 m wide railway is about two texels.
+ - The terrain shader and its bakes are being changed by promo-land and promo-sea at the same time, so a texture
+ would mean shared-shader edits on three branches. The ribbons need no terrain change.
+- The train needs the polyline anyway.
+
+**Symbolic widths**, measured on promo 03 at gameplay03 (about 35 m a pixel at 1920 px), after the units' scale
+measurement in `docs/units.md`:
+
+| Feature | Promo | Here |
+|---|---|---|
+| Railway bed | about 16 px | 680 m (its soft edges take about a sixth) |
+| Sleeper spacing | about 4 px | 150 m |
+| Dirt road | about 8 px | 300 m |
+| Burma Road | (not in the promo) | 200 m |
+| Train (six cars) | about 250 px, about 8.8 km | 8.8 km: locomotive, tender and four coaches at 80x real length and 1.5x stockier across (at a uniform 65x the first checkpoint drew a thin dark line) |
+
+**The mesh** (`RouteLayer.Ribbon`).
+- A cross-section every 120 m, square to the line's direction averaged over two steps each way.
+- Five vertices across each section. Each sits 20 m above the highest ground at its own point and half a step or half a
+ spacing around it, and takes the terrain's normal.
+- u runs across the ribbon and v along it, in metres.
+
+**The shader** (`Statecraft/Route`). It is transparent and has no new keywords; the shadow keywords are the terrain's.
+- The road is pale dirt with faint wheel ruts. At the country-wide pose (a pixel over 60–150 m), it darkens to a
+ grey-brown line, so it reads as the promo diorama's roads do instead of vanishing on pale ground.
+- The railway is a grey-brown ballast bed with darker shoulders, dark sleepers and two light steel rails, after the
+ promo video's 0:21 close-up.
+- Every pattern is box-filtered to the pixel, so it fades to its mean at the overview instead of shimmering.
+- It is lit like the ground: the sun with its shadows and the ambient probe. Then come the hex grid and the land haze
+ from `StatecraftMap.hlsl`.
+- Edges are soft. The soft edge is at least a pixel wide, and a ribbon narrower than a pixel fades by its coverage, so
+ far roads thin out instead of crawling (review M5).
+- Two passes split each ribbon at half coverage (review M3):
+ - The core (UniversalForward) writes a stencil bit. No later ribbon draws over it, so joins never double-blend.
+ - The soft rim (SRPDefaultUnlit) only tests the bit. A faint edge therefore cannot notch the next ribbon's core.
+ - The rail material draws first, so a railway stays on top of a road it crosses.
+
+**The train** (`RouteTrain`, `TrainModels`) is a showcase, not normal play.
+- **Controller ruling** (review I1, 2026-10-11): accuracy wins for facts. In normal play, no moving train runs where no
+ service is sourced for that date.
+- **Where the train appears:**
+ - the promo and art-checkpoint screenshots (`?shot` / `-shot`) and editor renders, where it stands still;
+ - `?train` or `?units` (desktop `-train` / `-units`), where it runs.
+- **Normal play has none** (`RouteLayer.ModeFor`), for two reasons:
+ - By the British withdrawal in May 1948, railway operations had effectively ceased. For the rest of 1948, Israel's
+ services ran only around Haifa: south to Hadera and north to Kiryat Motzkin and later Nahariya (Palestine Railways).
+ No specific 1948 date is sourced for that Haifa-area service.
+ - Jaffa to Lydda crossed the front until Lydda was taken in July 1948. Ramla–Jerusalem trains resumed in March 1950.
+- **How it is built:**
+ - code-built painted miniatures, made with the units' `MiniatureMesh` and palette;
+ - generic period shapes, with authored close-zoom models left to the AI-3D track;
+ - the wheels ride the ribbon's own centre height (the same max-of-samples rule, review M4).
+- **How it moves** in the showcase:
+ - it shuttles between Jaffa and Lydda junction, the stretch the promo draws, at 300 m/s of map;
+ - it stops for 6 s at each end, and the locomotive leads each way.
+- **Still position:** its middle by Mikve Israel, heading inland, as in the promo.
+- **A station correction:** the line's Tel Aviv station of 1920–1970 was Beit Hadar, "the original Tel Aviv South
+ station" (Jaffa–Jerusalem railway). The later Tel Aviv South opened when Beit Hadar closed.
+
+**Toggles.** `routes` (the ribbons) and `train` (when there is one) are visual toggles, so `?vprofile` prices each one.
+
+**Kits keep off the routes** (settlement kits and trees, #179).
+- `MapScene` reads the routes before building the kits, and hands `KitLayer.Build` every route's corridor
+ (`RouteLayer.Corridors`): half the drawn width plus `CorridorMarginM` (100 m).
+- `KitGround.OnRoute` (a 2 km segment grid) keeps building lots, landmarks and tree crowns out of these corridors.
+ B9 still keeps trees out of building lots.
+- Every route gets its corridor, whatever its date: the kits are built once, not per date, so the Burma Road's corridor
+ stays clear from the start.
+- `RouteTests.NoKitBuildingOrTreeStandsOnARoute` checks every lot and tree against every segment by brute force.
+
+## Measurements
+
+All of these are on `promo-roads`.
+
+**Checkpoints.** `tools/art_checkpoint.sh promo-roads-r0`, `-r1` and `-r2`. Images are in
+`captures/visual/promo-roads-r*/`, git-ignored. Close views come from `RouteCapture.Close`.
+
+| | promo-sea r1 (main's last recorded checkpoint, docs/visual-v1.md) | r2 (this branch) | promo |
+|---|---|---|---|
+| gameplay03 saturation, contrast, warmth | 0.48 / 0.174 / 0.102 | 0.48 / 0.174 / 0.100 | 0.38 / 0.203 / 0.064 |
+| gameplay03 palette distance | 0.60 | 0.58 | - |
+| diorama02 saturation, contrast, warmth | 0.42 / 0.187 / 0.117 | 0.42 / 0.187 / 0.117 | 0.43 / 0.200 / 0.145 |
+
+**Look test** (`RouteTests.AtTheGameplayPoseTheRailwayIsDarkAndTheRoadPale`, gameplay03, editor, review round):
+- the railway renders RGB (0.46, 0.40, 0.31) over ground (0.62, 0.59, 0.33);
+- the road renders (0.81, 0.71, 0.50) over ground (0.60, 0.57, 0.32).
+
+**Frame time.** Headless `?vprofile`, 1920x1080 at DPR 1, `machine_lock.py --exclusive`.
+- These numbers come from the first round, with the train shown in the profile.
+- The machine was loaded by other sessions (load average 4.3).
+
+| Pose | all | -routes | -train | none | routes cost | train cost |
+|---|---|---|---|---|---|---|
+| gameplay03 | 8.58 ms (p95 10) | 8.50 | 8.63 | 7.22 | 0.08 ms | below the noise (spread 0.18) |
+| diorama02 | 14.58 ms (p95 17, spread 1.44) | 14.38 | 14.50 | 10.77 | 0.20 ms | 0.08 ms |
+
+- **Read honestly** (review M6): the routes' and the train's deltas, 0.08–0.20 ms, are **below this run's noise**
+ (spreads 0.09–1.44 ms). They show the layer is cheap: 89k triangles, about a dozen draw calls, no CPU copy, and six
+ transforms a frame for the showcase train. They do not measure its cost to 0.1 ms.
+- diorama02's p95 is 17 ms, over the 16.7 ms budget. It is also 17 ms with `-routes`, so it is consistent with the base
+ scene on a loaded machine, but at 1 ms p95 granularity that is not proved.
+- The idle-machine re-measure is centralised (controller ruling) and is not repeated here.
+
+**Size.** The meshes, after the review round:
+- rail 18,100 vertices and roads 37,515;
+- 88,832 triangles in all, in 10 draw calls (one per display window and look);
+- uploaded without a CPU copy.
+
+The train is about 1,100 triangles; that figure is counted from the builders, not measured, and `TrainModelsAreRepeatable` bounds it under 5,000. The data file is 55 KB.
+
+**Tests.** `RouteTests` covers:
+- the data parses, and bad files name the file and the problem (dates included);
+- the content hash is unchanged, and the hand-written file is left out of the WebGL manifest;
+- resampling;
+- the ground clearance and bounds of the ribbons, and a pinned SHA-256 of the rail mesh. A fresh editor process must
+ build the same geometry, bit for bit.
+- the toggles, and the teardown freeing the meshes, the train's material and its palette texture;
+- the Burma Road, hidden at 15 May 1948 and shown from 14 June 1948 (and hidden again for an earlier date);
+- the window bounds;
+- a missing or malformed route file, which gives no routes, a warning and a map that still builds;
+- the train modes: still for `?shot` and editor renders, moving for `?train` and `?units`, none in normal play;
+- the still train's place and heading, on the ribbon's own height;
+- the shuttle's motion;
+- the train models;
+- GLES3 for the shader's two passes, and the materials' order;
+- the look at gameplay03.
+
+`tools/tests/test_routes_1948.py` checks the data against its sources, the windows (the Burma Road from 1948-06-14), the trace
+quality guards (`on_symbol`, `max_gap_m`), the validator (dates, a boolean `opened`), the tracer's pure parts, and a
+synthetic trace (where scikit-image is installed).
+
+## Integration with promo-land
+
+promo-land (`tools/land_bake.py`, `tracks.png`, `StatecraftLand.hlsl`) draws 110 m dust lines between towns. Its
+`track_links` joins every settlement to its three nearest within 40 km, and `track_points` bends each link by two
+seeded sine meanders. Those lines are invented routes. Where they do follow a real road, they would draw a second,
+thinner road beside this branch's ribbon. The proposal, for promo-land's next round:
+
+1. **Drop the town-to-town tracks from `tracks.png`** (`track_links`, `track_points`, `track_offsets`, the B channel
+ and `ScTrackHalfM`'s line in `ScLandUse`).
+ - The real 1948 roads are this branch's ribbons.
+ - Keep promo-land's field-scale "block-edge tracks", painted into `landuse.png`. They are farm texture, not routes,
+ and sit under the ribbons without competing.
+2. **If a finer network is wanted later**, trace it rather than invent it. The 1946 sheet draws secondary roads and
+ cart tracks as double dashed lines.
+ - `tools/routes_1948.py` already traces those (`kind: track`, as the Burma Road).
+ - `land_bake.py` could then read `content/map/route_paths_1948.yaml` (`kind: track` only) instead of
+ `track_links`, keeping its texture and shader exactly as they are.
+3. **Nothing else overlaps.**
+ - The ribbons are a transparent pass over whatever the terrain draws, so no shader or texture file is shared.
+ - Merging in either order needs no conflict resolution beyond `CHANGELOG.md`.
+
+## What still differs from the promo
+
+- **The towns.** The promo's line runs out of a dense Tel Aviv and Jaffa past orange groves; here it leaves
+ placeholder boxes over bare plain. That is the settlement and land-use tracks' job.
+- **Close zoom.** The promo video's 0:21 rail bed is raised and stony and its sleepers are timber blocks. Here they are
+ flat and painted, with lighting from the terrain's normals only. Shadows are received, but the bed casts no edge
+ shadow. A low embankment mesh, or a normal tilt at the shoulders, is the next step if the close zoom matters.
+- **The train.** It is generic code-built miniatures, as the units are: no smoke, no wheels, no Palestine Railways
+ livery source. Authored close-zoom models belong to the AI-3D track; `TrainModels` is the far-zoom fallback.
+- **Roads in the hills.** At gameplay03 they read clearly, but in the Judean hills the hill shading partly hides them.
+ The promo has no 1948 hill roads to compare against.
+- **The country-wide view.** The far grey-brown roads fit promo 02's road lines, but promo 02 draws modern highways;
+ 1948 had no such network.
+- **The Burma Road** is drawn along the 1946 tracks (to-verify), from 14 June 1948.
+- **Not drawn:** Israel's Tulkarm bypass (its date is to-verify), and lines and roads with no 1948 source here.
+- **No train in normal play.** The promo's moving train appears only as a showcase (`?train`, `?units`, the
+ screenshots). A sourced, dated 1948 Haifa-area service could add one in normal play later.
+- **Broken bridges.** The 1948 cuts (Rosh HaNikra in late February, Geva on 2 March, Gesher on 14 May) are in the
+ notes, not drawn. The track still lay on the ground.
diff --git a/tools/README.md b/tools/README.md
index bd113f987..83a86772d 100644
--- a/tools/README.md
+++ b/tools/README.md
@@ -13,6 +13,14 @@ Offline data tools (uv inline-script Python). Run from the repo root.
- `hexgrid.py` writes `content/map/hexes.json` from the heightmap and those committed precipitation inputs (no network).
- `settlement_hexes.py` writes `content/map/settlement_hexes.yaml` (committed): the hex that owns each settlement, by the
`hexgrid.settlement_hex` rule. The sim reads it, so it needs no projection maths.
+- `routes_1948.py [--fetch] [--only ID ...] [--preview DIR]` traces the railways and main roads of May 1948 (issue #35)
+ on the Survey of Palestine 1:250,000 map of 1946 (public domain; Palestine Open Maps' tiles, downloaded with `--fetch`
+ into `tools/.cache/pal250k-1946/`, not committed): it reads the hand-written routes, sources and waypoints in
+ `content/map/routes_1948.yaml` and writes the traced lines to `content/map/route_paths_1948.yaml` (committed; the map
+ draws it, the sim never reads it). `--preview` writes each traced segment over the map for checking by eye.
+- `routes_accuracy.py [--fetch]` measures how far those traced lines lie from OpenHistoricalMap (CC0) and OpenStreetMap
+ (ODbL) lines, downloaded with `--fetch` into `tools/.cache/routes-accuracy/` (never committed or copied into content),
+ and prints the accuracy table of `docs/routes.md`.
- `web_check.py` serves a WebGL build on http://localhost and opens it in headless Chrome for Testing (Playwright's
cache; macOS only, arm64 or x64); it passes when the console shows the expected lines (`GOLDEN OK ...`, `SMOKE OK ...`).
- `package_release.py` zips a Brotli WebGL build for sharing (`unity/Builds/statecraft-m3-web.zip`) and refuses
diff --git a/tools/routes_1948.py b/tools/routes_1948.py
new file mode 100644
index 000000000..28235f365
--- /dev/null
+++ b/tools/routes_1948.py
@@ -0,0 +1,494 @@
+# /// script
+# requires-python = ">=3.11"
+# dependencies = ["numpy==2.5.3", "pillow==12.3.0", "pyyaml==6.0.3", "scikit-image==0.26.0"]
+# ///
+"""The railways and main roads of May 1948 (issue #35): traced on the Survey of Palestine 1:250,000 map of 1946.
+
+Usage: uv run tools/routes_1948.py [--fetch] [--only ID ...] [--preview DIR]
+Reads content/map/routes_1948.yaml (hand-written: each route's kind, dates, sources and the named waypoints it passes,
+in order) and writes content/map/route_paths_1948.yaml (generated: each route as a lon/lat polyline). Between two
+waypoints the line is the least-cost path over the scanned map, where the cost is low on the route's own map symbol:
+ rail the black railway line (a thick dark stroke; the map's white dashes inside it are closed first);
+ road the red main road;
+ track any dark line (cart tracks, footpaths, the thin narrow-gauge railway symbol): the 1948 Burma Road, which the
+ 1946 map cannot show as a road, and the 1,050 mm lines (a route's `trace` names the symbol when it is not its
+ kind's).
+Each waypoint first snaps to the nearest pixel of its symbol within SNAP_M. The traced pixel chain is simplified
+(a SMOOTH_PX moving average, then Douglas-Peucker at SIMPLIFY_M) and written with 5 decimals (about 1 m).
+
+The map: Survey of Palestine 1:250,000 (1946), public domain (Crown copyright, published 1946, expired), scanned and
+georeferenced by Palestine Open Maps, read as web-mercator tiles at zoom TILE_ZOOM (about 16 m a pixel). --fetch
+downloads the tiles each route needs into tools/.cache/pal250k-1946/ (about 20 MB, not committed; one request at a
+time).
+Without --fetch a missing tile is an error. The sim never reads either routes file (map-only, like
+settlements_1948.yaml's coordinates), so neither moves the content hash.
+
+--preview DIR writes one PNG per route: the map under the window with the traced line, for checking by eye.
+"""
+from __future__ import annotations
+
+import argparse
+import math
+import re
+from datetime import date
+import os
+import sys
+import urllib.error
+import urllib.request
+from pathlib import Path
+
+import numpy as np
+import yaml
+from PIL import Image
+
+ROOT = Path(__file__).resolve().parents[1]
+ROUTES = ROOT / "content" / "map" / "routes_1948.yaml"
+PATHS = ROOT / "content" / "map" / "route_paths_1948.yaml"
+HEXES = ROOT / "content" / "map" / "hexes.json"
+
+TILE_URL = "https://palopenmaps.org/tiles/pal250k-1946/{z}/{x}/{y}.jpg"
+TILE_ZOOM = 13
+TILE_CACHE = Path(os.environ.get("STATECRAFT_TILE_CACHE", ROOT / "tools" / ".cache" / "pal250k-1946"))
+USER_AGENT = "statecraft-israel-routes/1.0 (+https://github.com/eyalgolan/statecraft-israel)"
+
+KINDS = ("rail", "road", "track")
+SNAP_M = 1500.0 # a waypoint (a town's or a station's coordinates) snaps to its symbol this close
+WINDOW_MARGIN_M = 3000.0 # the search window around two waypoints: their box grown by this (or 35% of their distance)
+SPUR_M = 130.0 # a trace that comes back this close to where it was cuts the loop (a waypoint off the line)
+SMOOTH_PX = 15 # moving average over the traced pixels (ends kept): the 16 m pixel staircase and the trace
+ # hopping between the two edges of a thick symbol drew a 100-200 m wobble at close zoom
+SIMPLIFY_M = 35.0 # Douglas-Peucker tolerance of the written line: about two map pixels, a tenth of a road's width
+OFF_SYMBOL_COST = 40.0 # cost of a pixel off the symbol (on it: 1), so a gap in the scan of up to ~40 px is bridged
+THIN_RAIL_COST = 4.0 # a rail trace's cost on a thin dark line (cost_raster)
+STATUSES = ("draft", "fact-checked")
+
+
+# --- web mercator ------------------------------------------------------------------------------------------------
+def lonlat_to_px(lon: float, lat: float, z: int = TILE_ZOOM) -> tuple[float, float]:
+ """Global pixel coordinates (x east, y south) of a point on the zoom-z tile pyramid (256 px tiles)."""
+ n = 256 * 2 ** z
+ x = (lon + 180.0) / 360.0 * n
+ y = (1.0 - math.asinh(math.tan(math.radians(lat))) / math.pi) / 2.0 * n
+ return x, y
+
+
+def px_to_lonlat(x: float, y: float, z: int = TILE_ZOOM) -> tuple[float, float]:
+ n = 256 * 2 ** z
+ lon = x / n * 360.0 - 180.0
+ lat = math.degrees(math.atan(math.sinh(math.pi * (1.0 - 2.0 * y / n))))
+ return lon, lat
+
+
+def metres_per_px(lat: float, z: int = TILE_ZOOM) -> float:
+ return 40075016.686 * math.cos(math.radians(lat)) / (256 * 2 ** z)
+
+
+def km_between(a: tuple[float, float], b: tuple[float, float]) -> float:
+ """Equirectangular distance (km) between two lon/lat points: plenty at this map's scale."""
+ lat = math.radians((a[1] + b[1]) / 2)
+ return math.hypot((b[0] - a[0]) * 111.32 * math.cos(lat), (b[1] - a[1]) * 110.57)
+
+
+def length_km(points: list[tuple[float, float]]) -> float:
+ return sum(km_between(a, b) for a, b in zip(points, points[1:]))
+
+
+# --- the symbols -------------------------------------------------------------------------------------------------
+def _shift_reduce(mask: np.ndarray, k: int, op) -> np.ndarray:
+ """Binary dilation (op=np.logical_or) or erosion (np.logical_and) by a k x k square, by shifted copies."""
+ r0, r1 = (k - 1) // 2, k // 2
+ pad = np.pad(mask, ((r0, r1), (r0, r1)), constant_values=op is np.logical_and)
+ out = None
+ h, w = mask.shape
+ for dy in range(k):
+ for dx in range(k):
+ s = pad[dy:dy + h, dx:dx + w]
+ out = s.copy() if out is None else op(out, s)
+ return out
+
+
+def dilate(mask: np.ndarray, k: int) -> np.ndarray:
+ return _shift_reduce(mask, k, np.logical_or)
+
+
+def erode(mask: np.ndarray, k: int) -> np.ndarray:
+ return _shift_reduce(mask, k, np.logical_and)
+
+
+def symbol_mask(rgb: np.ndarray, kind: str) -> np.ndarray:
+ """Where the map shows a route of this kind (RGB uint8 image -> bool). Tuned on the 1946 sheets:
+ road: the red fill of a main road: red over green by more than 90 with green and blue within 50 of each other (the
+ hill tint is orange, green well over blue, and passed a plain red-over-green test), red above 130; or, where
+ the road is printed over the valleys' green tint and reads darker (about 146, 64, 42 by the Sea of
+ Galilee), red over green by more than 65 with green and blue within 35 (the orange tint's are 60+ apart);
+ rail: dark, not blue, strokes at least about 4 px thick once the white dashes inside the line are closed, which
+ drops the thin double-dashed cart tracks, hairlines and road casings (lettering stays, but it is short);
+ track: any dark, not blue, pixel, dilated by one so a dashed track reads as continuous."""
+ if kind not in KINDS:
+ raise ValueError(f"unknown kind {kind!r}")
+ c = rgb.astype(np.int16)
+ r, g, b = c[..., 0], c[..., 1], c[..., 2]
+ if kind == "road":
+ return (((r - g) > 90) & (np.abs(g - b) < 50) & (r > 130)) | (((r - g) > 65) & (np.abs(g - b) < 35) & (r > 125))
+ dark = (np.maximum(np.maximum(r, g), b) < 110) & ((b - r) < 25)
+ if kind == "track":
+ return dilate(dark, 3)
+ closed = erode(dilate(dark, 5), 5)
+ return dilate(erode(closed, 4), 4)
+
+
+def cost_raster(rgb: np.ndarray, kind: str) -> np.ndarray:
+ """1 on the route's symbol, OFF_SYMBOL_COST off it. For rail, any dark pixel costs THIN_RAIL_COST: the line is drawn
+ thinner round tight curves (the Sorek canyon), where the thick-stroke mask breaks up and a cheaper chord cut across
+ the meanders."""
+ cost = np.where(symbol_mask(rgb, kind), 1.0, OFF_SYMBOL_COST)
+ if kind == "rail":
+ cost = np.where((cost > 1.0) & symbol_mask(rgb, "track"), THIN_RAIL_COST, cost)
+ return cost
+
+
+# --- tiles -------------------------------------------------------------------------------------------------------
+def tile_path(x: int, y: int, z: int = TILE_ZOOM) -> Path:
+ return TILE_CACHE / str(z) / str(x) / f"{y}.jpg"
+
+
+def fetch_tile(x: int, y: int, z: int = TILE_ZOOM) -> bool:
+ """Downloads one tile into the cache; False when the server has none (outside the sheets)."""
+ path = tile_path(x, y, z)
+ if path.exists():
+ return True
+ none = path.with_suffix(".none") # remembers a tile the server does not have (outside the sheets)
+ if none.exists():
+ return False
+ path.parent.mkdir(parents=True, exist_ok=True)
+ req = urllib.request.Request(TILE_URL.format(z=z, x=x, y=y), headers={"User-Agent": USER_AGENT})
+ try:
+ with urllib.request.urlopen(req, timeout=60) as resp:
+ data = resp.read()
+ except urllib.error.HTTPError as e:
+ if e.code == 404:
+ none.touch()
+ return False
+ raise
+ tmp = path.with_suffix(".part")
+ tmp.write_bytes(data)
+ tmp.replace(path)
+ return True
+
+
+def window(x0: int, y0: int, x1: int, y1: int, fetch: bool) -> np.ndarray:
+ """RGB pixels of the global pixel box [x0, x1) x [y0, y1) from cached tiles (white where no sheet covers it)."""
+ out = np.full((y1 - y0, x1 - x0, 3), 255, np.uint8)
+ for ty in range(y0 // 256, (y1 - 1) // 256 + 1):
+ for tx in range(x0 // 256, (x1 - 1) // 256 + 1):
+ path = tile_path(tx, ty)
+ if path.with_suffix(".none").exists():
+ continue
+ if not path.exists():
+ if not fetch:
+ raise FileNotFoundError(f"{path}: tile missing; run with --fetch")
+ if not fetch_tile(tx, ty):
+ continue
+ tile = np.asarray(Image.open(path).convert("RGB"))
+ gx0, gy0 = tx * 256, ty * 256
+ sx0, sy0 = max(x0, gx0), max(y0, gy0)
+ sx1, sy1 = min(x1, gx0 + 256), min(y1, gy0 + 256)
+ out[sy0 - y0:sy1 - y0, sx0 - x0:sx1 - x0] = tile[sy0 - gy0:sy1 - gy0, sx0 - gx0:sx1 - gx0]
+ return out
+
+
+# --- tracing -----------------------------------------------------------------------------------------------------
+def snap(cost: np.ndarray, p: tuple[int, int], radius_px: int) -> tuple[int, int]:
+ """The on-symbol pixel (cost 1) nearest to p=(row, col) within radius_px, else p itself."""
+ r, c = p
+ r0, r1 = max(r - radius_px, 0), min(r + radius_px + 1, cost.shape[0])
+ c0, c1 = max(c - radius_px, 0), min(c + radius_px + 1, cost.shape[1])
+ rows, cols = np.nonzero(cost[r0:r1, c0:c1] <= 1.0)
+ if rows.size == 0:
+ return p
+ d2 = (rows + r0 - r) ** 2 + (cols + c0 - c) ** 2
+ i = int(np.argmin(d2))
+ if d2[i] > radius_px ** 2:
+ return p
+ return int(rows[i] + r0), int(cols[i] + c0)
+
+
+def least_cost_path(cost: np.ndarray, start: tuple[int, int], end: tuple[int, int]) -> list[tuple[int, int]]:
+ from skimage.graph import route_through_array # only the trace needs it (the tests and CI do not)
+ path, _ = route_through_array(cost, start, end, fully_connected=True, geometric=True)
+ return [(int(r), int(c)) for r, c in path]
+
+
+def remove_spurs(chain: list[tuple[int, int]], radius_px: float) -> list[tuple[int, int]]:
+ """Cuts every out-and-back excursion: from each kept point the walk jumps to the last point of the chain within
+ radius_px of it, when that point is more than 3 radius_px steps further on. A waypoint off the line (a town circle,
+ its name, the next road over) is reached by a spur from the line and left the same way, so the whole spur goes; a
+ real line never comes back that close to itself (a hairpin would, which this map's railways and main roads do not
+ have at that scale: two legs of a hairpin are drawn at least a millimetre, 250 m, apart)."""
+ cell = max(int(math.ceil(radius_px)), 1)
+ r2 = radius_px * radius_px
+ grid: dict[tuple[int, int], list[int]] = {}
+ for k, (x, y) in enumerate(chain):
+ grid.setdefault((x // cell, y // cell), []).append(k)
+
+ def last_near(i: int) -> int:
+ x, y = chain[i]
+ cx, cy = x // cell, y // cell
+ return max((k for gx in (cx - 1, cx, cx + 1) for gy in (cy - 1, cy, cy + 1) for k in grid.get((gx, gy), ())
+ if (chain[k][0] - x) ** 2 + (chain[k][1] - y) ** 2 <= r2), default=i)
+
+ out, i = [], 0
+ while i < len(chain):
+ out.append(chain[i])
+ k = last_near(i)
+ i = k + 1 if k > i + 3 * radius_px else i + 1
+ if out[-1] != chain[-1]:
+ out.append(chain[-1])
+ return out
+
+
+def trim_end_hooks(chain: list[tuple[int, int]], radius_px: float) -> list[tuple[int, int]]:
+ """Cuts a hook at either end: a waypoint snapped a little off the route's end makes the line go out (to the town)
+ and come back, within radius_px of its end, which remove_spurs's smaller radius does not catch. Near the start, if
+ the distance from the first point rises and then falls again by more than a fifth of radius_px, the line starts at
+ that fall's lowest point (where it turns back onto the route); likewise at the end. A line that only moves away
+ from its ends is kept whole."""
+ def cut(c: list[tuple[int, int]]) -> int:
+ d = [math.dist(p, c[0]) for p in c]
+ window = next((k for k, v in enumerate(d) if v > radius_px), len(c))
+ if window < 2:
+ return 0
+ best, low, top = 0.0, 0, 0.0
+ for k in range(window): # the largest fall below the farthest point so far
+ top = max(top, d[k])
+ if top - d[k] > best:
+ best, low = top - d[k], k
+ return low if best > radius_px / 5 else 0
+
+ if len(chain) < 3:
+ return chain
+ chain = chain[cut(chain):]
+ rev = chain[::-1]
+ return rev[cut(rev):][::-1]
+
+
+def smooth(points: list[tuple[float, float]], window: int) -> list[tuple[float, float]]:
+ """Moving average over `window` points (odd), shrinking at the ends so both end points stay where they are."""
+ if window < 3 or len(points) < 3:
+ return list(points)
+ pts = np.asarray(points, float)
+ half = window // 2
+ out = []
+ for i in range(len(pts)):
+ h = min(half, i, len(pts) - 1 - i)
+ out.append(tuple(pts[i - h:i + h + 1].mean(axis=0)))
+ return out
+
+
+def simplify(points: list[tuple[float, float]], tol: float) -> list[tuple[float, float]]:
+ """Douglas-Peucker in the points' own units (iterative; keeps both ends)."""
+ if len(points) < 3:
+ return list(points)
+ pts = np.asarray(points, float)
+ keep = np.zeros(len(pts), bool)
+ keep[0] = keep[-1] = True
+ stack = [(0, len(pts) - 1)]
+ while stack:
+ i, j = stack.pop()
+ if j <= i + 1:
+ continue
+ a, b = pts[i], pts[j]
+ ab = b - a
+ n = np.hypot(*ab)
+ seg = pts[i + 1:j] - a
+ d = np.abs(ab[0] * seg[:, 1] - ab[1] * seg[:, 0]) / n if n > 0 else np.hypot(seg[:, 0], seg[:, 1])
+ k = int(np.argmax(d))
+ if d[k] > tol:
+ m = i + 1 + k
+ keep[m] = True
+ stack += [(i, m), (m, j)]
+ return [tuple(p) for p in pts[keep]]
+
+
+def trace_route(route: dict, fetch: bool, preview: Path | None = None) -> list[tuple[float, float]]:
+ """The route's lon/lat polyline: least-cost paths between its consecutive waypoints, joined and simplified."""
+ via = [(float(w["lon"]), float(w["lat"])) for w in route["via"]]
+ kind = route.get("trace", route["kind"])
+ chain: list[tuple[int, int]] = [] # global pixel (x, y)
+ on_symbol = total = 0
+ off: set[tuple[int, int]] = set() # global pixels traced off the symbol
+ on_limit = THIN_RAIL_COST if kind == "rail" else 1.0 # a rail's thin stretches are still its symbol
+ for a, b in zip(via, via[1:]):
+ mpp = metres_per_px((a[1] + b[1]) / 2)
+ ax, ay = lonlat_to_px(*a)
+ bx, by = lonlat_to_px(*b)
+ margin = max(WINDOW_MARGIN_M, 0.35 * km_between(a, b) * 1000) / mpp
+ x0, x1 = int(min(ax, bx) - margin), int(max(ax, bx) + margin) + 1
+ y0, y1 = int(min(ay, by) - margin), int(max(ay, by) + margin) + 1
+ rgb = window(x0, y0, x1, y1, fetch)
+ cost = cost_raster(rgb, kind)
+ rad = int(SNAP_M / mpp)
+ # A segment starts where the previous one ended, so the joins never jump.
+ start = (chain[-1][1] - y0, chain[-1][0] - x0) if chain else snap(cost, (int(ay - y0), int(ax - x0)), rad)
+ end = snap(cost, (int(by - y0), int(bx - x0)), rad)
+ seg = least_cost_path(cost, start, end)
+ for r, c in seg:
+ if cost[r, c] <= on_limit:
+ on_symbol += 1
+ else:
+ off.add((c + x0, r + y0))
+ total += len(seg)
+ glob = [(c + x0, r + y0) for r, c in seg]
+ chain += glob if not chain else glob[1:]
+ if preview is not None:
+ img = Image.fromarray(rgb)
+ from PIL import ImageDraw
+ d = ImageDraw.Draw(img)
+ d.line([(c, r) for r, c in seg], fill=(0, 160, 255), width=3)
+ for p in (start, end):
+ d.ellipse((p[1] - 6, p[0] - 6, p[1] + 6, p[0] + 6), outline=(0, 200, 0), width=3)
+ preview.mkdir(parents=True, exist_ok=True)
+ img.save(preview / f"{route['id']}_{len(list(preview.glob(route['id'] + '_*.png'))):02d}.png")
+ route["_on_symbol"] = on_symbol / max(total, 1)
+ chain = remove_spurs(chain, SPUR_M / metres_per_px(via[0][1]))
+ chain = trim_end_hooks(chain, 6 * SPUR_M / metres_per_px(via[0][1])) # a 400 m hook at the Burma Road's start
+ # The longest run of the kept line off its symbol (a stretch the trace bridged: a name over the road, a town).
+ gap = worst = 0
+ at = chain[0]
+ for p in chain:
+ gap = gap + 1 if p in off else 0
+ if gap > worst:
+ worst, at = gap, p
+ route["_max_gap_m"] = worst * metres_per_px(via[0][1])
+ route["_gap_at"] = px_to_lonlat(*at)
+ lonlat = [px_to_lonlat(x + 0.5, y + 0.5) for x, y in chain]
+ # Simplify in metres (a local equirectangular frame), then back to lon/lat.
+ lat0 = math.radians(sum(p[1] for p in lonlat) / len(lonlat))
+ kx, ky = 111320.0 * math.cos(lat0), 110570.0
+ simple = simplify(smooth([(lo * kx, la * ky) for lo, la in lonlat], SMOOTH_PX), SIMPLIFY_M)
+ return [(x / kx, y / ky) for x, y in simple]
+
+
+# --- files -------------------------------------------------------------------------------------------------------
+def load_routes(path: Path = ROUTES) -> dict:
+ doc = yaml.safe_load(path.read_text(encoding="utf-8"))
+ validate_routes(doc, json_bounds())
+ return doc
+
+
+def json_bounds() -> dict:
+ import json
+ return json.loads(HEXES.read_text())["bounds"]
+
+
+DATE_RULE = re.compile(r"\d{4}(-\d{2}-\d{2})?")
+
+
+def _as_date(v: str) -> date:
+ """A 'YYYY' (1 January) or 'YYYY-MM-DD' window bound."""
+ return date(int(v), 1, 1) if len(v) == 4 else date.fromisoformat(v)
+
+
+def validate_routes(doc: dict, bounds: dict) -> None:
+ """Raises ValueError naming the route and field for anything malformed in routes_1948.yaml."""
+ routes = doc.get("routes") if isinstance(doc, dict) else None
+ if not routes:
+ raise ValueError("routes_1948.yaml: no routes")
+ seen = set()
+ for r in routes:
+ rid = r.get("id")
+ if not isinstance(rid, str) or not rid or not rid.replace("_", "a").isalnum() or rid != rid.lower():
+ raise ValueError(f"routes_1948.yaml: bad id {rid!r}")
+ if rid in seen:
+ raise ValueError(f"routes_1948.yaml: duplicate id {rid}")
+ seen.add(rid)
+ if r.get("kind") not in KINDS or r.get("trace", r["kind"]) not in KINDS:
+ raise ValueError(f"{rid}: kind (and trace, when given) must be one of {KINDS}")
+ if r.get("status") not in STATUSES:
+ raise ValueError(f"{rid}: status must be one of {STATUSES}")
+ if not r.get("name"):
+ raise ValueError(f"{rid}: name required")
+ if "opened" in r and (isinstance(r["opened"], bool) or not isinstance(r["opened"], int) or r["opened"] > 1948):
+ raise ValueError(f"{rid}: opened, when given, must be a year <= 1948")
+ window = []
+ for key in ("from", "to"):
+ if key not in r:
+ continue
+ v = r[key]
+ if not isinstance(v, str) or not DATE_RULE.fullmatch(v):
+ raise ValueError(f"{rid}: {key} must be a quoted 'YYYY' or 'YYYY-MM-DD'")
+ window.append(_as_date(v))
+ if "from" not in r:
+ raise ValueError(f"{rid}: from is required (the date the map shows the route from)")
+ if len(window) == 2 and window[1] <= window[0]:
+ raise ValueError(f"{rid}: to must be after from")
+ if "opened" in r and window[0].year < r["opened"]:
+ raise ValueError(f"{rid}: from ({r['from']}) is before opened ({r['opened']})")
+ via = r.get("via") or []
+ if len(via) < 2:
+ raise ValueError(f"{rid}: needs at least two waypoints")
+ for w in via:
+ if not w.get("name") or not str(w.get("url", "")).startswith("https://"):
+ raise ValueError(f"{rid}: waypoint {w.get('name')!r} needs a name and an https url")
+ lon, lat = w.get("lon"), w.get("lat")
+ if not (isinstance(lon, (int, float)) and isinstance(lat, (int, float))
+ and bounds["lon0"] <= lon <= bounds["lon1"] and bounds["lat0"] <= lat <= bounds["lat1"]):
+ raise ValueError(f"{rid}: waypoint {w['name']} outside the map ({lon}, {lat})")
+ srcs = r.get("sources") or []
+ if not srcs or not all(str(s.get("url", "")).startswith("https://") and s.get("checked") for s in srcs):
+ raise ValueError(f"{rid}: every route needs sources with an https url and a checked date")
+
+
+HEADER = """\
+# GENERATED by tools/routes_1948.py from routes_1948.yaml and the Survey of Palestine 1:250,000 map of 1946 (public
+# domain; tiles by Palestine Open Maps). Do not edit by hand: change the waypoints in routes_1948.yaml and re-run.
+# Each route: its id, kind, status and display window (from, to) from routes_1948.yaml; the trace's quality (on_symbol:
+# the share of traced pixels on the route's own map symbol; max_gap_m: the longest run off it, in metres); its length
+# and its line as [lon, lat] pairs, 5 decimals.
+# Map-only: the sim never reads this file, so it does not move the content hash.
+"""
+
+
+def dump_paths(routes: list[dict], lines: dict[str, list[tuple[float, float]]]) -> str:
+ out = [HEADER, "routes:\n"]
+ for r in routes:
+ pts = lines[r["id"]]
+ out.append(f"- id: {r['id']}\n kind: {r['kind']}\n status: {r['status']}\n from: '{r['from']}'\n")
+ if "to" in r:
+ out.append(f" to: '{r['to']}'\n")
+ out.append(f" on_symbol: {r['_on_symbol']:.2f}\n max_gap_m: {round(r['_max_gap_m'])}\n")
+ out.append(f" length_km: {length_km(pts):.1f}\n points:\n")
+ for lon, lat in pts:
+ out.append(f" - [{lon:.5f}, {lat:.5f}]\n")
+ return "".join(out)
+
+
+def main(argv: list[str] | None = None) -> int:
+ ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
+ ap.add_argument("--fetch", action="store_true", help="download missing map tiles into the cache")
+ ap.add_argument("--only", nargs="*", help="trace only these route ids (the others keep their current lines)")
+ ap.add_argument("--preview", type=Path, help="write a PNG per segment with the traced line into this directory")
+ args = ap.parse_args(argv)
+ doc = load_routes()
+ routes = doc["routes"]
+ old = {}
+ if PATHS.exists():
+ for r in (yaml.safe_load(PATHS.read_text(encoding="utf-8")) or {}).get("routes", []):
+ old[r["id"]] = r
+ lines = {}
+ for r in routes:
+ if args.only and r["id"] not in args.only and r["id"] in old:
+ lines[r["id"]] = [tuple(p) for p in old[r["id"]]["points"]]
+ r["_on_symbol"], r["_max_gap_m"] = old[r["id"]]["on_symbol"], old[r["id"]]["max_gap_m"]
+ continue
+ lines[r["id"]] = trace_route(r, args.fetch, args.preview)
+ print(f"{r['id']:32} {r['kind']:5} {len(lines[r['id']]):5} points {length_km(lines[r['id']]):7.1f} km"
+ f" on its symbol {r['_on_symbol']:.0%}, longest gap {r['_max_gap_m']:.0f} m"
+ + (" ending at %.4f, %.4f" % r["_gap_at"] if "_gap_at" in r else ""))
+ PATHS.write_text(dump_paths(routes, lines), encoding="utf-8")
+ print(f"wrote {PATHS.relative_to(ROOT)}")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tools/routes_accuracy.py b/tools/routes_accuracy.py
new file mode 100644
index 000000000..4db57932e
--- /dev/null
+++ b/tools/routes_accuracy.py
@@ -0,0 +1,123 @@
+# /// script
+# requires-python = ">=3.11"
+# dependencies = ["numpy==2.5.3", "pyyaml==6.0.3", "scipy==1.18.1"]
+# ///
+"""How far the traced 1948 routes (content/map/route_paths_1948.yaml) lie from independent references: the accuracy
+table in docs/routes.md.
+
+Usage: uv run tools/routes_accuracy.py [--fetch]
+References, downloaded with --fetch into tools/.cache/routes-accuracy/ (never committed, never copied into content):
+ OpenHistoricalMap (CC0): railway ways starting by 1948, and primary to tertiary roads valid on 14 May 1948;
+ OpenStreetMap (ODbL): today's railways and the abandoned, disused and razed ones. ODbL is outside this repository's
+ licence policy, so its geometry is only measured against here, as the route files never contain any of it.
+For every route, every 50 m of its line: the distance to the nearest reference point (references densified every
+20 m); prints the median, the 90th percentile and the share within 300 m. A reference with no line near a route (OSM
+in the Gaza Strip, OHM for most 1948 roads) reads as a large distance: read the table with docs/routes.md's notes.
+"""
+from __future__ import annotations
+
+import argparse
+import json
+import math
+import sys
+import urllib.parse
+import urllib.request
+from pathlib import Path
+
+import numpy as np
+import yaml
+from scipy.spatial import cKDTree
+
+ROOT = Path(__file__).resolve().parents[1]
+PATHS = ROOT / "content" / "map" / "route_paths_1948.yaml"
+CACHE = ROOT / "tools" / ".cache" / "routes-accuracy"
+BBOX = "29.45,34.2,33.35,35.9" # south, west, north, east: the map's bounds (content/map/hexes.json)
+QUERIES = {
+ "ohm_rail.json": ("https://overpass-api.openhistoricalmap.org/api/interpreter",
+ f'[out:json][timeout:170];way["railway"]({BBOX});out tags geom;'),
+ "ohm_roads.json": ("https://overpass-api.openhistoricalmap.org/api/interpreter",
+ f'[out:json][timeout:170];way["highway"]({BBOX});out tags geom;'),
+ "osm_rail.json": ("https://overpass-api.de/api/interpreter https://z.overpass-api.de/api/interpreter https://lz4.overpass-api.de/api/interpreter",
+ f'[out:json][timeout:170];(way["railway"~"^(rail|abandoned|disused|razed|dismantled)$"]({BBOX});'
+ f'way["abandoned:railway"]({BBOX});way["disused:railway"]({BBOX}););out tags geom;'),
+}
+USER_AGENT = "statecraft-israel-routes/1.0 (+https://github.com/eyalgolan/statecraft-israel)"
+LAT0 = 31.8 # the equirectangular frame's standard parallel (the map's middle)
+
+
+def fetch() -> None:
+ CACHE.mkdir(parents=True, exist_ok=True)
+ for name, (urls, query) in QUERIES.items():
+ for url in urls.split(): # the main Overpass server is often busy: try its mirrors in turn
+ req = urllib.request.Request(url, data=urllib.parse.urlencode({"data": query}).encode(),
+ headers={"User-Agent": USER_AGENT})
+ try:
+ with urllib.request.urlopen(req, timeout=200) as resp:
+ body = resp.read()
+ json.loads(body) # an Overpass error page is HTML or XML: try the next server
+ except (OSError, ValueError) as e:
+ print(f"{name}: {url} failed ({e})", file=sys.stderr)
+ continue
+ (CACHE / name).write_bytes(body)
+ print(f"fetched {name} from {url} ({len(body)} bytes)")
+ break
+ else:
+ raise SystemExit(f"{name}: every Overpass server failed")
+
+
+def xy(lon: float, lat: float) -> np.ndarray:
+ return np.array([lon * 111320 * math.cos(math.radians(LAT0)), lat * 110570])
+
+
+def densify(points: list[tuple[float, float]], step: float) -> np.ndarray:
+ out = []
+ for a, b in zip(points, points[1:]):
+ pa, pb = xy(*a), xy(*b)
+ n = max(1, int(np.linalg.norm(pb - pa) / step))
+ out += [pa + (pb - pa) * t / n for t in range(n)]
+ out.append(xy(*points[-1]))
+ return np.array(out)
+
+
+def reference(files: list[str], keep) -> cKDTree:
+ pts = []
+ for name in files:
+ for e in json.loads((CACHE / name).read_text())["elements"]:
+ if e["type"] == "way" and keep(e.get("tags", {})):
+ pts.append(densify([(p["lon"], p["lat"]) for p in e["geometry"]], 20))
+ return cKDTree(np.concatenate(pts))
+
+
+def valid_1948(t: dict) -> bool:
+ return not (t.get("start_date", "") > "1948-05-14") and not (t.get("end_date", "9999") < "1948-05-14")
+
+
+def main(argv: list[str] | None = None) -> int:
+ ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
+ ap.add_argument("--fetch", action="store_true", help="download the references into the cache first")
+ args = ap.parse_args(argv)
+ if args.fetch:
+ fetch()
+ missing = [n for n in QUERIES if not (CACHE / n).exists()]
+ if missing:
+ print(f"missing references {missing}: run with --fetch", file=sys.stderr)
+ return 2
+ refs = {
+ "OHM rail by 1948": reference(["ohm_rail.json"], lambda t: t.get("start_date", "9")[:4] <= "1948"),
+ "OSM rail, current and abandoned": reference(["osm_rail.json"], lambda t: True),
+ "OHM roads valid in 1948": reference(["ohm_roads.json"], lambda t: t.get("highway") in (
+ "primary", "secondary", "tertiary", "trunk") and valid_1948(t)),
+ }
+ print("| Route | Reference | Median distance | 90th percentile | Within 300 m |")
+ print("|---|---|---|---|---|")
+ for r in yaml.safe_load(PATHS.read_text(encoding="utf-8"))["routes"]:
+ line = densify([tuple(p) for p in r["points"]], 50)
+ names = ["OHM rail by 1948", "OSM rail, current and abandoned"] if r["kind"] == "rail" else ["OHM roads valid in 1948"]
+ for name in names:
+ d, _ = refs[name].query(line)
+ print(f"| {r['id']} | {name} | {np.median(d):.0f} m | {np.percentile(d, 90):.0f} m | {np.mean(d < 300):.0%} |")
+ return 0
+
+
+if __name__ == "__main__":
+ sys.exit(main())
diff --git a/tools/tests/test_routes_1948.py b/tools/tests/test_routes_1948.py
new file mode 100644
index 000000000..336471b0d
--- /dev/null
+++ b/tools/tests/test_routes_1948.py
@@ -0,0 +1,199 @@
+"""Checks the committed 1948 routes (content/map/routes_1948.yaml and the traced route_paths_1948.yaml) and the pure parts
+of tools/routes_1948.py. The trace itself needs the map tiles (network) and scikit-image, so it runs only where both are
+present; CI checks the committed result."""
+import json
+import math
+from pathlib import Path
+
+import numpy as np
+import pytest
+import yaml
+
+import routes_1948 as rt
+
+ROOT = Path(__file__).resolve().parents[2]
+BOUNDS = json.loads((ROOT / "content" / "map" / "hexes.json").read_text())["bounds"]
+ROUTES = yaml.safe_load((ROOT / "content" / "map" / "routes_1948.yaml").read_text(encoding="utf-8"))
+PATHS = yaml.safe_load((ROOT / "content" / "map" / "route_paths_1948.yaml").read_text(encoding="utf-8"))["routes"]
+BY_ID = {r["id"]: r for r in PATHS}
+
+
+def test_routes_file_is_valid():
+ rt.validate_routes(ROUTES, BOUNDS)
+ assert ROUTES["map_source"]["licence"] == "Public-Domain" and ROUTES["map_source"]["checked"]
+
+
+def test_the_issue_routes_are_there():
+ """Issue #35 names the Jaffa-Jerusalem line, the coastal main line and the 1948 roads to Jerusalem."""
+ ids = {r["id"] for r in ROUTES["routes"]}
+ assert {"jaffa_jerusalem_railway", "kantara_main_line_south", "eastern_railway", "hadera_haifa_railway",
+ "jaffa_jerusalem_road", "burma_road", "tel_aviv_haifa_road", "coastal_road_south"} <= ids
+
+
+def test_paths_match_the_routes_file():
+ assert [r["id"] for r in PATHS] == [r["id"] for r in ROUTES["routes"]]
+ for src in ROUTES["routes"]:
+ p = BY_ID[src["id"]]
+ assert (p["kind"], p["status"]) == (src["kind"], src["status"]), src["id"]
+
+
[email protected]("route", ROUTES["routes"], ids=lambda r: r["id"])
+def test_each_path_runs_from_its_first_to_its_last_waypoint(route):
+ pts = [tuple(p) for p in BY_ID[route["id"]]["points"]]
+ assert len(pts) >= 2
+ for lon, lat in pts:
+ assert BOUNDS["lon0"] <= lon <= BOUNDS["lon1"] and BOUNDS["lat0"] <= lat <= BOUNDS["lat1"]
+ first, last = route["via"][0], route["via"][-1]
+ # A waypoint snaps to its symbol within SNAP_M (plus the spur cut at the ends).
+ assert rt.km_between(pts[0], (first["lon"], first["lat"])) <= rt.SNAP_M / 1000 + 0.3, route["id"]
+ assert rt.km_between(pts[-1], (last["lon"], last["lat"])) <= rt.SNAP_M / 1000 + 0.3, route["id"]
+ # No wild detours: the line is at least the waypoints' chord and at most twice it (hill roads wind).
+ chord = sum(rt.km_between((a["lon"], a["lat"]), (b["lon"], b["lat"])) for a, b in zip(route["via"], route["via"][1:]))
+ length = rt.length_km(pts)
+ assert 0.85 * chord <= length <= 2.0 * chord, (route["id"], chord, length)
+ assert abs(BY_ID[route["id"]]["length_km"] - length) < 0.06
+
+
[email protected]("route", ROUTES["routes"], ids=lambda r: r["id"])
+def test_each_path_passes_near_every_waypoint(route):
+ """Every waypoint is near the line (a trace that skipped one would be far from it). Up to 3.5 km: a waypoint at a
+ modern town's point off the 1946 road (Kfar Yona, Ashkelon) is reached by a spur, which the tool cuts."""
+ pts = np.asarray(BY_ID[route["id"]]["points"], float)
+ for w in route["via"]:
+ d = min(rt.km_between((w["lon"], w["lat"]), tuple(p)) for p in pts)
+ assert d <= 3.5, (route["id"], w["name"], d)
+
+
+def test_no_segment_jumps():
+ """Consecutive points are at most 7 km apart (the longest real straight is 6.5 km, on the Tel Aviv-Haifa road across
+ the Sharon plain); and the trace itself never bridged more than 800 m off its symbol (max_gap_m, measured by the
+ tool on the kept line), so no invented chord hides inside a straight."""
+ for r in PATHS:
+ pts = [tuple(p) for p in r["points"]]
+ worst = max(rt.km_between(a, b) for a, b in zip(pts, pts[1:]))
+ assert worst < 7.0, (r["id"], worst)
+ assert r["max_gap_m"] <= 800, (r["id"], r["max_gap_m"])
+
+
+def test_each_trace_follows_its_symbol():
+ """At least 85% of every route's traced pixels lie on its own map symbol (the rest: names over the road, towns)."""
+ for r in PATHS:
+ assert r["on_symbol"] >= 0.85, (r["id"], r["on_symbol"])
+
+
+def test_display_windows():
+ """Every route has a display window; the Burma Road shows from its completion on 14 June 1948 (C1), so it is not on
+ the map at the 15 May 1948 start; the rest are on the 1946 map and show from 1946 at the latest."""
+ for src in ROUTES["routes"]:
+ assert BY_ID[src["id"]]["from"] == src["from"] and BY_ID[src["id"]].get("to") == src.get("to")
+ if src["id"] != "burma_road":
+ assert rt._as_date(src["from"]) <= rt._as_date("1946"), src["id"]
+ assert BY_ID["burma_road"]["from"] == "1948-06-14"
+
+
[email protected]("change, message", [
+ ({"opened": True}, "opened"),
+ ({"opened": 1950}, "opened"),
+ ({"from": 1946}, "from must be a quoted"),
+ ({"from": "1946-6-1"}, "from must be a quoted"),
+ ({"from": "1890"}, "is before opened"),
+ ({"to": "1900"}, "to must be after from"),
+])
+def test_validate_rejects_bad_dates(change, message):
+ doc = yaml.safe_load((ROOT / "content" / "map" / "routes_1948.yaml").read_text(encoding="utf-8"))
+ doc["routes"][0].update(change)
+ with pytest.raises(ValueError, match=message):
+ rt.validate_routes(doc, BOUNDS)
+
+
+def test_validate_requires_from():
+ doc = yaml.safe_load((ROOT / "content" / "map" / "routes_1948.yaml").read_text(encoding="utf-8"))
+ del doc["routes"][0]["from"]
+ with pytest.raises(ValueError, match="from is required"):
+ rt.validate_routes(doc, BOUNDS)
+
+
+def test_the_jaffa_jerusalem_railway_is_its_real_length():
+ """Wikipedia: 86.6 km (Jaffa to Jerusalem). The trace starts at the Jaffa terminus and ends at the Jerusalem
+ station, so it must be close (within 10%)."""
+ assert 78.0 <= rt.length_km([tuple(p) for p in BY_ID["jaffa_jerusalem_railway"]["points"]]) <= 95.0
+
+
+def test_mercator_round_trip():
+ for lon, lat in [(34.2, 29.45), (35.9, 33.35), (34.78, 32.08)]:
+ x, y = rt.lonlat_to_px(lon, lat)
+ lo, la = rt.px_to_lonlat(x, y)
+ assert abs(lo - lon) < 1e-9 and abs(la - lat) < 1e-9
+ assert 15.0 < rt.metres_per_px(32.0) < 17.0 # zoom 13: about 16 m a pixel at 32 N
+
+
+def test_simplify_keeps_ends_and_tolerance():
+ line = [(float(x), 0.0 + (0.3 if x == 5 else 0.0)) for x in range(11)]
+ assert rt.simplify(line, 1.0) == [(0.0, 0.0), (10.0, 0.0)]
+ bent = [(0.0, 0.0), (5.0, 3.0), (10.0, 0.0)]
+ assert rt.simplify(bent, 1.0) == bent
+
+
+def test_smooth_keeps_the_ends():
+ pts = [(0.0, 0.0), (1.0, 1.0), (2.0, 0.0), (3.0, 1.0), (4.0, 0.0)]
+ out = rt.smooth(pts, 3)
+ assert out[0] == pts[0] and out[-1] == pts[-1] and len(out) == len(pts)
+ assert out[2] == pytest.approx((2.0, 2.0 / 3.0))
+
+
+def test_remove_spurs_drops_an_out_and_back():
+ line = [(x, 0) for x in range(30)]
+ spur = [(15, y) for y in range(1, 20)] + [(15, y) for y in range(18, 0, -1)]
+ chain = line[:16] + spur + line[15:]
+ out = rt.remove_spurs(chain, 2.0)
+ assert all(y == 0 for _, y in out) and out[0] == (0, 0) and out[-1] == (29, 0)
+ assert rt.remove_spurs(line, 2.0) == line
+
+
+def test_symbol_masks_on_the_map_colours():
+ def px(*rgb):
+ return np.array([[rgb]], np.uint8)
+ road, orange, cream, ink = px(205, 45, 50), px(235, 155, 70), px(252, 232, 182), px(30, 28, 25)
+ assert rt.symbol_mask(road, "road")[0, 0]
+ assert rt.symbol_mask(px(146, 64, 42), "road")[0, 0] # a road over the valleys' green tint
+ assert not rt.symbol_mask(px(200, 120, 40), "road")[0, 0] # darker orange tint
+ assert not rt.symbol_mask(orange, "road")[0, 0] # the hill tint is not a road
+ assert not rt.symbol_mask(cream, "road")[0, 0]
+ assert rt.symbol_mask(ink, "track")[0, 0]
+ # rail: a 6 px dark stroke survives the opening, a 2 px one (a cart track, a road's casing) does not
+ img = np.full((40, 60, 3), 250, np.uint8)
+ img[10:16, :] = 25
+ img[30:32, :] = 25
+ m = rt.symbol_mask(img, "rail")
+ assert m[12, 30] and not m[31, 30]
+
+
+def test_a_trace_follows_a_drawn_road():
+ pytest.importorskip("skimage")
+ img = np.full((120, 200, 3), (250, 230, 180), np.uint8)
+ rr = (60 + 30 * np.sin(np.linspace(0, 3, 200))).astype(int)
+ for c, r in enumerate(rr):
+ img[r - 2:r + 3, c] = (205, 45, 50)
+ cost = rt.cost_raster(img, "road")
+ path = rt.least_cost_path(cost, (rr[0], 0), (rr[-1], 199))
+ assert max(abs(r - rr[c]) for r, c in path) <= 3
+
+
+def test_trim_end_hooks_drops_a_hook_at_either_end():
+ hook = [(0, 0), (-3, 0), (-3, 1), (0, 1)]
+ line = [(x, 1) for x in range(1, 30)]
+ out = rt.trim_end_hooks(hook + line, 4.0)
+ assert out[0][0] >= 0 and out[-1] == (29, 1)
+ assert rt.trim_end_hooks(line, 4.0) == line, "a line that only moves away from its ends is kept whole"
+ back = rt.trim_end_hooks((hook + line)[::-1], 4.0)
+ assert back[0] == (29, 1) and back[-1] == (0, 1), "the same hook at the end"
+
+
+def test_accuracy_script_pure_parts():
+ """tools/routes_accuracy.py (the docs' accuracy table): densifying keeps the ends and the step; the 1948 filter."""
+ ra = pytest.importorskip("routes_accuracy")
+ d = ra.densify([(34.5, 31.5), (34.6, 31.5)], 20)
+ assert np.allclose(d[0], ra.xy(34.5, 31.5)) and np.allclose(d[-1], ra.xy(34.6, 31.5))
+ assert np.all(np.linalg.norm(np.diff(d, axis=0), axis=1) <= 20.01)
+ assert ra.valid_1948({"start_date": "1937-05"}) and ra.valid_1948({})
+ assert not ra.valid_1948({"start_date": "1975"}) and not ra.valid_1948({"end_date": "1948-01"})
diff --git a/unity/Assets/Editor/RouteCapture.cs b/unity/Assets/Editor/RouteCapture.cs
new file mode 100644
index 000000000..62ab96329
--- /dev/null
+++ b/unity/Assets/Editor/RouteCapture.cs
@@ -0,0 +1,54 @@
+using System.IO;
+using Statecraft.Game;
+using Statecraft.Game.Map;
+using UnityEditor;
+using UnityEditor.SceneManagement;
+using UnityEngine;
+
+/// <summary>Close looks at the 1948 railways and roads (docs/routes.md), for the art checkpoint's side-by-sides against the
+/// promo video's 0:21 close-up. Editor renders at the web tier, tilt-shift off, the train still. Run headless (with
+/// graphics, never -nographics):
+/// Unity -batchmode -CI false -GITHUB_ACTIONS false -TF_BUILD false -quit -projectPath unity -executeMethod RouteCapture.Close [-captureDir DIR]
+/// Writes routes-&lt;view&gt;.png (default captures/visual/routes, git-ignored).</summary>
+public static class RouteCapture
+{
+ /// <summary>(name, lon, lat, distance m, yaw): the still train east of Jaffa, Lydda junction, and Latrun to Bab al-Wad
+ /// with the Burma Road.</summary>
+ static readonly (string name, double lon, double lat, float distance, float yaw)[] Views =
+ {
+ ("train", 34.83, 32.01, 16000f, 10f),
+ ("lydda", 34.875, 31.945, 14000f, 10f),
+ ("latrun", 34.99, 31.82, 22000f, 0f),
+ };
+
+ public static void Close()
+ {
+ var args = System.Environment.GetCommandLineArgs();
+ int at = System.Array.IndexOf(args, "-captureDir");
+ var dir = at >= 0 && at + 1 < args.Length ? args[at + 1] : Path.Combine(Paths.RepoRoot, "captures", "visual", "routes");
+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);
+ var map = MapCapture.RequireMapScene(); map.Build();
+ var rig = Camera.main.GetComponent<CameraRig>();
+ int saved = QualitySettings.GetQualityLevel();
+ try
+ {
+ QualitySettings.SetQualityLevel(0, true);
+ if (System.Linq.Enumerable.Contains(VisualToggles.Names, "tiltshift")) VisualToggles.Set("tiltshift", false);
+ foreach (var v in Views)
+ {
+ rig.LookAt = map.Frame.ToWorld(v.lon, v.lat, 0); rig.Distance = v.distance; rig.Yaw = v.yaw; rig.TopInset = 0; rig.Apply();
+ Save(Camera.main, 1920, 1080, Path.Combine(dir, $"routes-{v.name}.png"));
+ }
+ }
+ finally { VisualToggles.SetAll(true); QualitySettings.SetQualityLevel(saved, true); }
+ }
+
+ static void Save(Camera cam, int w, int h, string path)
+ {
+ var rt = new RenderTexture(w, h, 24); cam.targetTexture = rt; cam.Render();
+ RenderTexture.active = rt; var tex = new Texture2D(w, h, TextureFormat.RGB24, false);
+ tex.ReadPixels(new Rect(0, 0, w, h), 0, 0); tex.Apply();
+ Directory.CreateDirectory(Path.GetDirectoryName(path)); File.WriteAllBytes(path, tex.EncodeToPNG());
+ cam.targetTexture = null; RenderTexture.active = null; Object.DestroyImmediate(rt); Object.DestroyImmediate(tex);
+ }
+}
diff --git a/unity/Assets/Editor/RouteCapture.cs.meta b/unity/Assets/Editor/RouteCapture.cs.meta
new file mode 100644
index 000000000..63cebf1f0
--- /dev/null
+++ b/unity/Assets/Editor/RouteCapture.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 083ae3a1ef05c4a7bba941751aac20fa
\ No newline at end of file
diff --git a/unity/Assets/Editor/RouteMaterialAssets.cs b/unity/Assets/Editor/RouteMaterialAssets.cs
new file mode 100644
index 000000000..31b29eb56
--- /dev/null
+++ b/unity/Assets/Editor/RouteMaterialAssets.cs
@@ -0,0 +1,39 @@
+using Statecraft.Game.Map.Routes;
+using UnityEditor;
+using UnityEngine;
+
+namespace Statecraft.Game.EditorTools
+{
+ /// <summary>Creates the route materials in Resources (RouteLayer): Rail.mat and Road.mat, both Statecraft/Route. The
+ /// rail draws first (queue 3000, roads 3001), so with the shader's stencil bit a railway stays on top of a road it
+ /// crosses. Idempotent.
+ /// Run headless: Unity -batchmode -CI false -GITHUB_ACTIONS false -TF_BUILD false -quit -projectPath unity -executeMethod Statecraft.Game.EditorTools.RouteMaterialAssets.Create</summary>
+ public static class RouteMaterialAssets
+ {
+ public const int RailQueue = 3000, RoadQueue = 3001;
+ /// <summary>The roads' opacity: packed dirt over the ground, a little of the ground's colour showing through.</summary>
+ public const float RoadOpacity = 0.9f;
+
+ public static void Create()
+ {
+ if (!AssetDatabase.IsValidFolder("Assets/Resources")) AssetDatabase.CreateFolder("Assets", "Resources");
+ if (!AssetDatabase.IsValidFolder(RouteLayer.Folder)) AssetDatabase.CreateFolder("Assets/Resources", "Routes");
+ Make(RouteLayer.RailMaterialResource, kind: 1f, opacity: 1f, RailQueue);
+ Make(RouteLayer.RoadMaterialResource, kind: 0f, opacity: RoadOpacity, RoadQueue);
+ AssetDatabase.SaveAssets();
+ }
+
+ static void Make(string resource, float kind, float opacity, int queue)
+ {
+ var path = "Assets/Resources/" + resource + ".mat";
+ var shader = Shader.Find("Statecraft/Route") ?? throw new System.InvalidOperationException("shader not found: Statecraft/Route"); // editor only
+ var mat = AssetDatabase.LoadAssetAtPath<Material>(path);
+ if (mat == null) { mat = new Material(shader); AssetDatabase.CreateAsset(mat, path); }
+ else mat.shader = shader;
+ mat.SetFloat("_Kind", kind);
+ mat.SetFloat("_Opacity", opacity);
+ mat.renderQueue = queue;
+ EditorUtility.SetDirty(mat);
+ }
+ }
+}
diff --git a/unity/Assets/Editor/RouteMaterialAssets.cs.meta b/unity/Assets/Editor/RouteMaterialAssets.cs.meta
new file mode 100644
index 000000000..afe99f917
--- /dev/null
+++ b/unity/Assets/Editor/RouteMaterialAssets.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 18a7260d2fb814da0badc698cea011b4
\ No newline at end of file
diff --git a/unity/Assets/Resources/Routes.meta b/unity/Assets/Resources/Routes.meta
new file mode 100644
index 000000000..0a67df7d2
--- /dev/null
+++ b/unity/Assets/Resources/Routes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: bc207cf94c80c483087f225476931c9c
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Resources/Routes/Rail.mat b/unity/Assets/Resources/Routes/Rail.mat
new file mode 100644
index 000000000..d35d566ac
--- /dev/null
+++ b/unity/Assets/Resources/Routes/Rail.mat
@@ -0,0 +1,32 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 8
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: Rail
+ m_Shader: {fileID: 4800000, guid: 6f7eb075e582e433b85c8c4d0d446f42, type: 3}
+ m_Parent: {fileID: 0}
+ m_ModifiedSerializedProperties: 0
+ m_ValidKeywords: []
+ m_InvalidKeywords: []
+ m_LightmapFlags: 4
+ m_EnableInstancingVariants: 0
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: 3000
+ stringTagMap: {}
+ disabledShaderPasses: []
+ m_LockedProperties:
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs: []
+ m_Ints: []
+ m_Floats:
+ - _Kind: 1
+ - _Opacity: 1
+ m_Colors: []
+ m_BuildTextureStacks: []
+ m_AllowLocking: 1
diff --git a/unity/Assets/Resources/Routes/Rail.mat.meta b/unity/Assets/Resources/Routes/Rail.mat.meta
new file mode 100644
index 000000000..c58ffd2c2
--- /dev/null
+++ b/unity/Assets/Resources/Routes/Rail.mat.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 39d20dc7a774347f883729c3df8fb4df
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 2100000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Resources/Routes/Road.mat b/unity/Assets/Resources/Routes/Road.mat
new file mode 100644
index 000000000..0336cf6c8
--- /dev/null
+++ b/unity/Assets/Resources/Routes/Road.mat
@@ -0,0 +1,32 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 8
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: Road
+ m_Shader: {fileID: 4800000, guid: 6f7eb075e582e433b85c8c4d0d446f42, type: 3}
+ m_Parent: {fileID: 0}
+ m_ModifiedSerializedProperties: 0
+ m_ValidKeywords: []
+ m_InvalidKeywords: []
+ m_LightmapFlags: 4
+ m_EnableInstancingVariants: 0
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: 3001
+ stringTagMap: {}
+ disabledShaderPasses: []
+ m_LockedProperties:
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs: []
+ m_Ints: []
+ m_Floats:
+ - _Kind: 0
+ - _Opacity: 0.9
+ m_Colors: []
+ m_BuildTextureStacks: []
+ m_AllowLocking: 1
diff --git a/unity/Assets/Resources/Routes/Road.mat.meta b/unity/Assets/Resources/Routes/Road.mat.meta
new file mode 100644
index 000000000..0b69a000e
--- /dev/null
+++ b/unity/Assets/Resources/Routes/Road.mat.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 5ae57140a121d4ecf84ae8f34a80b4ba
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 2100000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Scripts/Boot/ContentManifest.cs b/unity/Assets/Scripts/Boot/ContentManifest.cs
index 8c6979b3f..e327aec3c 100644
--- a/unity/Assets/Scripts/Boot/ContentManifest.cs
+++ b/unity/Assets/Scripts/Boot/ContentManifest.cs
@@ -17,16 +17,21 @@ namespace Statecraft.Game.Boot
/// (settlements); the precipitation files are tool inputs only.</summary>
public const string HexesJson = "map/hexes.json";
+ /// <summary>Map files that only the offline tools read, so players never download them: routes_1948.yaml is the
+ /// hand-written input of tools/routes_1948.py; the map reads its traced output (review M10).</summary>
+ public static readonly IReadOnlyCollection<string> ToolInputs = new HashSet<string> { "map/routes_1948.yaml" };
+
[Serializable] sealed class ManifestJson { public string[] files = new string[0]; }
- /// <summary>Every *.yaml in <paramref name="contentDir"/>, events/ and map/, plus map/hexes.json; ordinal order.</summary>
+ /// <summary>Every *.yaml in <paramref name="contentDir"/>, events/ and map/ (but <see cref="ToolInputs"/>), plus
+ /// map/hexes.json; ordinal order.</summary>
public static List<string> Collect(string contentDir)
{
IEnumerable<string> Yaml(string sub) => Directory.GetFiles(Path.Combine(contentDir, sub), "*.yaml")
.Select(f => (sub == "" ? "" : sub + "/") + Path.GetFileName(f));
if (!File.Exists(Path.Combine(contentDir, HexesJson))) throw new FileNotFoundException("content file missing", HexesJson);
return Yaml("").Concat(Yaml("events")).Concat(Yaml("map")).Append(HexesJson)
- .OrderBy(f => f, StringComparer.Ordinal).ToList();
+ .Where(f => !ToolInputs.Contains(f)).OrderBy(f => f, StringComparer.Ordinal).ToList();
}
public static string Write(IEnumerable<string> files) => JsonUtility.ToJson(new ManifestJson { files = files.ToArray() }, true);
diff --git a/unity/Assets/Scripts/Boot/GameInputs.cs b/unity/Assets/Scripts/Boot/GameInputs.cs
index d813d9c05..f37e039f8 100644
--- a/unity/Assets/Scripts/Boot/GameInputs.cs
+++ b/unity/Assets/Scripts/Boot/GameInputs.cs
@@ -14,6 +14,8 @@ namespace Statecraft.Game.Boot
public sealed class MapInputs
{
public string HeightmapJson = "", HexesJson = "", SettlementsYaml = "";
+ /// <summary>content/map/route_paths_1948.yaml: the traced railways and roads the map draws (issue #35; map-only).</summary>
+ public string RoutesYaml = "";
/// <summary>content/map/settlement_population_1945.yaml (the settlement kits' footprints; "" when absent). The sim
/// never reads it.</summary>
public string PopulationYaml = "";
@@ -35,10 +37,14 @@ namespace Statecraft.Game.Boot
HeightmapR16z = File.ReadAllBytes(Path.Combine(mapDir, HeightmapCodec.FileName)),
HexesJson = File.ReadAllText(Path.Combine(contentDir, "map", "hexes.json")),
SettlementsYaml = File.ReadAllText(Path.Combine(contentDir, "map", SettlementPlacer.DefaultFileName)),
+ RoutesYaml = ReadIfExists(Path.Combine(contentDir, "map", Statecraft.Game.Map.Routes.RoutePaths.DefaultFileName)),
PopulationYaml = File.Exists(Path.Combine(contentDir, "map", Statecraft.Game.Map.Kits.KitPopulation.FileName))
? File.ReadAllText(Path.Combine(contentDir, "map", Statecraft.Game.Map.Kits.KitPopulation.FileName)) : "",
};
+ /// <summary>A map-only, cosmetic input: "" when the file is missing (the map then skips that layer with a warning).</summary>
+ static string ReadIfExists(string path) => File.Exists(path) ? File.ReadAllText(path) : "";
+
public static GameInputs FromDisk(string contentDir, string mapDir) =>
new GameInputs { Content = ContentLoader.Load(contentDir), Map = MapFromDisk(contentDir, mapDir) };
@@ -54,6 +60,7 @@ namespace Statecraft.Game.Boot
{
HeightmapJson = heightmapJson, HeightmapR16z = r16z,
HexesJson = texts["map/hexes.json"], SettlementsYaml = texts["map/" + SettlementPlacer.DefaultFileName],
+ RoutesYaml = texts.TryGetValue("map/" + Statecraft.Game.Map.Routes.RoutePaths.DefaultFileName, out var routes) ? routes : "",
PopulationYaml = texts.TryGetValue("map/" + Statecraft.Game.Map.Kits.KitPopulation.FileName, out var pop) ? pop : "",
},
};
diff --git a/unity/Assets/Scripts/Map/Kits/KitGround.cs b/unity/Assets/Scripts/Map/Kits/KitGround.cs
index 12d91c8fe..bd3e644a5 100644
--- a/unity/Assets/Scripts/Map/Kits/KitGround.cs
+++ b/unity/Assets/Scripts/Map/Kits/KitGround.cs
@@ -76,6 +76,65 @@ namespace Statecraft.Game.Map.Kits
return false;
}
+ // Route corridors (the railways' and roads' ribbons, RouteLayer.Corridors): segments with their clear half-width, in
+ // a 2 km grid so a placement test scans only the segments near it.
+ const float CorridorCellM = 2000f;
+ readonly List<(Vector2 a, Vector2 b, float half)> corridorSegments = new List<(Vector2, Vector2, float)>();
+ readonly Dictionary<(int, int), List<int>> corridorCells = new Dictionary<(int, int), List<int>>();
+ float corridorMaxHalf;
+
+ /// <summary>Route segments registered with <see cref="AddCorridor"/>.</summary>
+ public int CorridorSegments => corridorSegments.Count;
+
+ /// <summary>Keeps buildings and trees off a route: no lot or crown may come within <paramref name="halfWidth"/> of
+ /// the polyline <paramref name="line"/> (world x, z). Call before SettlementKits.Build and Vegetation.Plant.</summary>
+ public void AddCorridor(IReadOnlyList<Vector2> line, float halfWidth)
+ {
+ for (int i = 0; i + 1 < line.Count; i++)
+ {
+ var a = line[i]; var b = line[i + 1];
+ int index = corridorSegments.Count;
+ corridorSegments.Add((a, b, halfWidth));
+ corridorMaxHalf = Mathf.Max(corridorMaxHalf, halfWidth);
+ int x0 = Mathf.FloorToInt((Mathf.Min(a.x, b.x) - halfWidth) / CorridorCellM), x1 = Mathf.FloorToInt((Mathf.Max(a.x, b.x) + halfWidth) / CorridorCellM);
+ int z0 = Mathf.FloorToInt((Mathf.Min(a.y, b.y) - halfWidth) / CorridorCellM), z1 = Mathf.FloorToInt((Mathf.Max(a.y, b.y) + halfWidth) / CorridorCellM);
+ for (int cz = z0; cz <= z1; cz++)
+ for (int cx = x0; cx <= x1; cx++)
+ {
+ if (!corridorCells.TryGetValue((cx, cz), out var list)) corridorCells[(cx, cz)] = list = new List<int>();
+ list.Add(index);
+ }
+ }
+ }
+
+ /// <summary>True when a disc of radius <paramref name="r"/> at <paramref name="p"/> reaches into any route corridor.</summary>
+ public bool OnRoute(Vector2 p, float r)
+ {
+ if (corridorSegments.Count == 0) return false;
+ float reach = r + corridorMaxHalf;
+ int x0 = Mathf.FloorToInt((p.x - reach) / CorridorCellM), x1 = Mathf.FloorToInt((p.x + reach) / CorridorCellM);
+ int z0 = Mathf.FloorToInt((p.y - reach) / CorridorCellM), z1 = Mathf.FloorToInt((p.y + reach) / CorridorCellM);
+ for (int cz = z0; cz <= z1; cz++)
+ for (int cx = x0; cx <= x1; cx++)
+ {
+ if (!corridorCells.TryGetValue((cx, cz), out var list)) continue;
+ foreach (var i in list)
+ {
+ var (a, b, half) = corridorSegments[i];
+ if (SegmentDistance(p, a, b) < half + r) return true;
+ }
+ }
+ return false;
+ }
+
+ /// <summary>Distance from <paramref name="p"/> to the segment a-b.</summary>
+ public static float SegmentDistance(Vector2 p, Vector2 a, Vector2 b)
+ {
+ var ab = b - a; float len2 = ab.sqrMagnitude;
+ float t = len2 > 0f ? Mathf.Clamp01(Vector2.Dot(p - a, ab) / len2) : 0f;
+ return (p - (a + ab * t)).magnitude;
+ }
+
public bool InTown(float x, float z, float share = 1f)
{
foreach (var f in Footprints)
diff --git a/unity/Assets/Scripts/Map/Kits/KitLayer.cs b/unity/Assets/Scripts/Map/Kits/KitLayer.cs
index 8ff54bf83..13c9a19de 100644
--- a/unity/Assets/Scripts/Map/Kits/KitLayer.cs
+++ b/unity/Assets/Scripts/Map/Kits/KitLayer.cs
@@ -16,17 +16,22 @@ namespace Statecraft.Game.Map.Kits
public sealed class Stats
{
- public int Buildings, Vertices, Triangles, Trees; public float BuildMs, PlantMs;
+ public int Buildings, Vertices, Triangles, Trees, CorridorSegments; public float BuildMs, PlantMs;
public override string ToString() =>
- $"KITS buildings={Buildings} vertices={Vertices} triangles={Triangles} trees={Trees} build_ms={BuildMs:0} plant_ms={PlantMs:0}";
+ $"KITS buildings={Buildings} vertices={Vertices} triangles={Triangles} trees={Trees} route_segments={CorridorSegments} build_ms={BuildMs:0} plant_ms={PlantMs:0}";
}
public static GameObject Build(IReadOnlyList<Settlement> settlements, Terrain terrain, GeoFrame frame, HexFile hexes, float elevMinM,
- Material kitMaterial, Material treeMaterial, MapRuntimeAssets assets, GameObject markers, out Stats stats)
+ Material kitMaterial, Material treeMaterial, MapRuntimeAssets assets, GameObject markers, out Stats stats,
+ IReadOnlyList<(List<Vector2> line, float halfWidth)>? corridors = null)
{
stats = new Stats();
var root = new GameObject(RootName);
var ground = new KitGround(terrain, frame, hexes, elevMinM);
+ // Buildings and trees stay off the railways and roads (RouteLayer.Corridors): every route, whatever its date,
+ // since the kits are not rebuilt when a dated route (the Burma Road) appears.
+ if (corridors != null) foreach (var (line, half) in corridors) ground.AddCorridor(line, half);
+ stats.CorridorSegments = ground.CorridorSegments;
var clock = System.Diagnostics.Stopwatch.StartNew();
var built = SettlementKits.Build(settlements, ground, out var lots);
foreach (var l in lots) ground.Lots.Add((l.centre, l.radius));
diff --git a/unity/Assets/Scripts/Map/Kits/SettlementKits.cs b/unity/Assets/Scripts/Map/Kits/SettlementKits.cs
index 7f0108b6d..57dd501bb 100644
--- a/unity/Assets/Scripts/Map/Kits/SettlementKits.cs
+++ b/unity/Assets/Scripts/Map/Kits/SettlementKits.cs
@@ -127,7 +127,7 @@ namespace Statecraft.Game.Map.Kits
{
float a = 2f * Mathf.PI * k / around, d = ring * r * 0.5f;
var p = want + new Vector2(Mathf.Cos(a), Mathf.Sin(a)) * d;
- if (!ground.Inside(p.x, p.y) || ground.Water(p.x, p.y) || !FreeAt(lots, p, r)) continue;
+ if (!ground.Inside(p.x, p.y) || ground.Water(p.x, p.y) || !FreeAt(lots, p, r) || ground.OnRoute(p, r)) continue;
lots.Add(new Lot { c = p, r = r, id = owner }); at = p; return true;
}
}
@@ -176,7 +176,7 @@ namespace Statecraft.Game.Map.Kits
if (!ground.Inside(p.x, p.y) || ground.Water(p.x, p.y) || !Mine(p)) continue;
float t = rr / R; // 0 at the heart, 1 at the edge
var b = Pick(arch, t, ref rnd, m);
- if (!Free(p, b.lotR)) continue;
+ if (!Free(p, b.lotR) || ground.OnRoute(p, b.lotR)) continue; // off the railways and roads too
if (ground.Slope(p.x, p.y, b.w) > (arch == Archetype.ArabTown || arch == Archetype.OldTown ? 0.6f : 0.35f)) continue;
// Corner and seaward checks: the whole footprint is dry.
if (ground.Water(p.x + b.w * 0.5f, p.y) || ground.Water(p.x - b.w * 0.5f, p.y) || ground.Water(p.x, p.y + b.d * 0.5f) || ground.Water(p.x, p.y - b.d * 0.5f)) continue;
diff --git a/unity/Assets/Scripts/Map/Kits/Vegetation.cs b/unity/Assets/Scripts/Map/Kits/Vegetation.cs
index 91f9952a1..3d1aab405 100644
--- a/unity/Assets/Scripts/Map/Kits/Vegetation.cs
+++ b/unity/Assets/Scripts/Map/Kits/Vegetation.cs
@@ -98,7 +98,9 @@ namespace Statecraft.Game.Map.Kits
{
// No crown reaches into a building's or landmark's lot (integration bug B9: palms through Tel Aviv's roofs,
// grove rows through blocks).
- if (ground.OnLot(x, z, CrownRadiusM(k) * s * size * 1.15f)) return;
+ // Nor into a railway's or road's corridor (the routes run through the groves otherwise).
+ float crown = CrownRadiusM(k) * s * size * 1.15f;
+ if (ground.OnLot(x, z, crown) || ground.OnRoute(new Vector2(x, z), crown)) return;
float y = ground.Y(x, z);
var scale = s * size * rnd.Range(0.85f, 1.15f);
float yaw = float.IsNaN(yawDeg) ? rnd.Range(0f, 360f) : yawDeg;
diff --git a/unity/Assets/Scripts/Map/MapScene.cs b/unity/Assets/Scripts/Map/MapScene.cs
index 15bc08ced..24f5f7884 100644
--- a/unity/Assets/Scripts/Map/MapScene.cs
+++ b/unity/Assets/Scripts/Map/MapScene.cs
@@ -6,7 +6,7 @@ using UnityEngine;
namespace Statecraft.Game.Map
{
- /// <summary>Builds the whole map: terrain, hexes, 1948 settlements, camera. Materials are editor-made assets
+ /// <summary>Builds the whole map: terrain, hexes, 1948 settlements, railways and roads, camera. Materials are editor-made assets
/// (M0 correction 1). Build is idempotent: it destroys what the previous Build made first. In play mode the Boot
/// component calls Build(inputs) once the inputs are loaded (fetched on WebGL); editor tools call Build().</summary>
public sealed class MapScene : MonoBehaviour
@@ -23,6 +23,9 @@ namespace Statecraft.Game.Map
public Material MarkerMaterial => markerMaterial;
/// <summary>The settlements the last Build placed (settlements_1948.yaml), for the UI's map labels.</summary>
public IReadOnlyList<Settlement> Settlements { get; private set; } = new List<Settlement>();
+ /// <summary>The game date the routes were last shown at (RouteLayer.ShowAt), so a rebuild draws them as at that date;
+ /// null before the game has set one (the routes then show as at the game's start).</summary>
+ public DateTime? RouteDate { get; set; }
/// <summary>The selected hex's outline: a child of the terrain (so a rebuild destroys it).</summary>
public const string SelectionName = "HexSelection";
@@ -151,6 +154,8 @@ namespace Statecraft.Game.Map
markers.transform.SetParent(transform, true);
DiagLog.BootPhase("settlements placed");
KitStats = null;
+ // The 1948 railways and roads (issue #35), read before the kits so buildings and trees keep off them.
+ var routes = Routes.RoutePaths.ReadOrNone(inputs.RoutesYaml, (meta.lon0, meta.lon1, meta.lat0, meta.lat1), Debug.LogWarning);
if (kitsOn)
{
// ?kitscale=, ?housescale=, ?treescale= in the WebGL player: the same layout at another symbolic scale (city
@@ -166,12 +171,16 @@ namespace Statecraft.Game.Map
// The kits replace the marker boxes; the boxes stay as the labels' and tests' anchors, and come back when the
// "kits" toggle turns the kits off (so settlements are never left undrawn).
var kits = Kits.KitLayer.Build(list, Terrain, Frame, Hexes, meta.elev_min_m, kitMaterial, treeMaterial,
- terrainGo.GetComponent<MapRuntimeAssets>(), markers, out var stats);
+ terrainGo.GetComponent<MapRuntimeAssets>(), markers, out var stats, Routes.RouteLayer.Corridors(Frame, routes));
kits.transform.SetParent(transform, true);
KitStats = stats;
DiagLog.BootPhase("kits built");
Debug.Log(stats.ToString());
}
+ // The routes are drawn map-only, as at the game's date (the start until the game sets one); a missing or malformed
+ // file means no routes and a warning; the train only in screenshots, editor renders and ?train.
+ Routes.RouteLayer.Build(Terrain, Frame, routes, Routes.RouteLayer.ModeForThisRun(), RouteDate ?? Routes.RouteLayer.DefaultDate);
+ DiagLog.BootPhase("routes built");
if (!cam.TryGetComponent(out CameraRig rig)) rig = cam.gameObject.AddComponent<CameraRig>();
rig.LookAt = Frame.ToWorld(34.95, 31.95, 0); rig.Init(); // central Israel: Tel Aviv–Jerusalem corridor
diff --git a/unity/Assets/Scripts/Map/Routes.meta b/unity/Assets/Scripts/Map/Routes.meta
new file mode 100644
index 000000000..10540605f
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 139298aa2177a4ea2b9c4ccd933e6275
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Scripts/Map/Routes/RouteGroup.cs b/unity/Assets/Scripts/Map/Routes/RouteGroup.cs
new file mode 100644
index 000000000..bc2ca9edb
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RouteGroup.cs
@@ -0,0 +1,12 @@
+#nullable enable
+using UnityEngine;
+
+namespace Statecraft.Game.Map.Routes
+{
+ /// <summary>Marks a group of route ribbons with its display window (RouteLayer.ShowAt switches the group on while the
+ /// game date is inside it).</summary>
+ public sealed class RouteGroup : MonoBehaviour
+ {
+ public RouteWindow Window;
+ }
+}
diff --git a/unity/Assets/Scripts/Map/Routes/RouteGroup.cs.meta b/unity/Assets/Scripts/Map/Routes/RouteGroup.cs.meta
new file mode 100644
index 000000000..aedfc17ff
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RouteGroup.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 7cbd5abe7a3394f129798949488b5e84
\ No newline at end of file
diff --git a/unity/Assets/Scripts/Map/Routes/RouteLayer.cs b/unity/Assets/Scripts/Map/Routes/RouteLayer.cs
new file mode 100644
index 000000000..e1185d736
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RouteLayer.cs
@@ -0,0 +1,245 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+
+namespace Statecraft.Game.Map.Routes
+{
+ /// <summary>The 1948 railways and roads on the map (issue #35): one ribbon mesh per look (rail; roads and the Burma
+ /// Road's track), draped on the terrain along the traced lines of route_paths_1948.yaml, drawn with the editor-made
+ /// Statecraft/Route materials in Resources (no runtime Shader.Find, no new serialized field on MapScene). Each route
+ /// shows only while the game date is inside its window (RoutePath.From/To; review C1: the Burma Road from 14 June
+ /// 1948): routes are grouped by window, one ribbon pair per group, and <see cref="ShowAt"/> switches the groups. A
+ /// steam train on the Jaffa–Jerusalem line is a showcase, never normal play (review I1, <see cref="ModeFor"/>). Widths are symbolic, measured on the
+ /// promo's gameplay frame like the settlements and units (docs/routes.md): a road about 8 px and the railway about
+ /// 16 px wide at 1920 px (the soft edges take about a sixth of the railway's width, so its bed is drawn 680 m), so they read at the gameplay zoom as the promo draws them. Registers the "routes" (ribbons)
+ /// and "train" visual toggles, so the frame profile prices each. Pure geometry from the data: the same file gives the
+ /// same meshes, vertex for vertex.</summary>
+ public static class RouteLayer
+ {
+ public const string RootName = "Routes", RibbonsName = "RouteRibbons", RoutesToggle = "routes", TrainToggle = "train";
+ public const string RailMaterialResource = "Routes/Rail", RoadMaterialResource = "Routes/Road";
+ public const string Folder = "Assets/Resources/Routes";
+
+ /// <summary>Full ribbon widths (m), soft edges included (the shader fades the outer 16-30%).</summary>
+ public const float RailWidthM = 680f, RoadWidthM = 300f, TrackWidthM = 200f;
+ /// <summary>Spacing (m) of the ribbon's cross-sections along its line: under the heightmap's 211 m N-S spacing, so
+ /// every terrain row gets a section; about 3 px at the gameplay zoom.</summary>
+ public const float StepM = 120f;
+ /// <summary>Vertices across a ribbon: its edges, its centre and the quarter lines, each on its own ground, so a
+ /// ribbon on a slope follows the slope instead of standing out flat.</summary>
+ public const int Across = 5;
+ /// <summary>Height above the highest ground sampled around each vertex; the shader's depth offset does the rest.</summary>
+ public const float ClearanceM = 20f;
+
+ /// <summary>The showcase train's route and stretch: the Jaffa–Jerusalem railway from its Jaffa end to Lydda junction,
+ /// the stretch the promo's train runs (promo/final/03). It is ambience for the promo frames, not a timetable: no
+ /// regular trains ran here from the British withdrawal in May 1948 until Lydda was taken in July and service resumed
+ /// later (Palestine Railways), which is why normal play shows no train (<see cref="ModeFor"/>).</summary>
+ public const string TrainRoute = "jaffa_jerusalem_railway";
+ public static readonly (double lon, double lat) TrainTurnAt = (34.87556, 31.94583); // Lod railway station
+
+ /// <summary>The date the map shows before the game tells it one (editor renders, screenshots before GAME OK): the
+ /// game's start, 15 May 1948.</summary>
+ public static readonly DateTime DefaultDate = new DateTime(1948, 5, 15);
+
+ public enum TrainMode { None, Still, Moving }
+
+ /// <summary>Whether there is a train and whether it moves (review I1): editor renders and screenshots (`?shot` /
+ /// `-shot`) show the promo's still train; `?train` or `?units` (desktop `-train` / `-units`) asks for the moving
+ /// showcase; normal play has none, as no service is sourced for the line at the game's dates.</summary>
+ public static TrainMode ModeFor(bool playing, bool shot, bool requested) =>
+ !playing || shot ? TrainMode.Still : requested ? TrainMode.Moving : TrainMode.None;
+
+ public static bool TrainRequested(string? url, string[] args, bool webgl) =>
+ webgl ? Boot.UrlFlags.Has(url, "train") || Boot.UrlFlags.Has(url, "units") : Array.IndexOf(args, "-train") >= 0 || Array.IndexOf(args, "-units") >= 0;
+
+ public static TrainMode ModeForThisRun() => ModeFor(Application.isPlaying, VisualShots.Requested(),
+ TrainRequested(Application.absoluteURL, Environment.GetCommandLineArgs(), Application.platform == RuntimePlatform.WebGLPlayer));
+
+ /// <summary>Shows the route groups whose window covers <paramref name="date"/> and hides the rest (the game calls it
+ /// on every state change; cheap: a few SetActive calls), and remembers the date on the map, so a rebuild of the map
+ /// (MapScene.Build) draws the routes as at the game's date at once. A map without routes is left alone.</summary>
+ public static void ShowAt(MapScene map, DateTime date)
+ {
+ if (map == null) return;
+ map.RouteDate = date; // a later rebuild of this map starts at the game's date (re-review nit 2)
+ if (map.Terrain == null) return;
+ var ribbons = map.Terrain.transform.Find($"{RootName}/{RibbonsName}");
+ if (ribbons == null) return;
+ foreach (var g in ribbons.GetComponentsInChildren<RouteGroup>(true)) g.gameObject.SetActive(g.Window.Covers(date));
+ }
+
+ /// <summary>Clearance (m) beyond a ribbon's drawn half-width that kit buildings and trees keep from it, so a lot's or
+ /// crown's edge never touches the soft edge of the road or the ballast.</summary>
+ public const float CorridorMarginM = 100f;
+
+ /// <summary>Every route's line (world x, z) with the half-width kits must keep clear of: half the drawn width plus
+ /// <see cref="CorridorMarginM"/>. All routes, whatever their window: the kits are built once, not per date, so a route
+ /// that appears later (the Burma Road) has its corridor from the start.</summary>
+ public static List<(List<Vector2> line, float halfWidth)> Corridors(GeoFrame frame, IEnumerable<RoutePath> routes) =>
+ routes.Select(r => (World(frame, r), WidthOf(r.Kind) / 2f + CorridorMarginM)).ToList();
+
+ public static float WidthOf(string kind) => kind switch
+ {
+ RoutePaths.Rail => RailWidthM,
+ RoutePaths.Road => RoadWidthM,
+ RoutePaths.Track => TrackWidthM,
+ _ => throw new ArgumentException($"unknown route kind '{kind}'", nameof(kind)),
+ };
+
+ /// <summary>Builds the routes under <paramref name="terrain"/> (so a map rebuild destroys them): one group per display
+ /// window (its rail and road ribbons), shown as at <paramref name="date"/>, and, when <paramref name="train"/> is not
+ /// None and the train's route is in <paramref name="routes"/>, the train (still: it stands at its still position, so
+ /// screenshots and editor renders repeat exactly). Meshes, the train's palette and its material copy are owned by
+ /// the root's own MapRuntimeAssets, which also unregisters the toggles. Returns the root.</summary>
+ public static GameObject Build(Terrain terrain, GeoFrame frame, IReadOnlyList<RoutePath> routes, TrainMode train, DateTime date)
+ {
+ if (terrain == null) throw new ArgumentNullException(nameof(terrain));
+ if (routes == null) throw new ArgumentNullException(nameof(routes));
+ var rail = Resources.Load<Material>(RailMaterialResource)
+ ?? throw new InvalidOperationException($"Resources/{RailMaterialResource}.mat is missing (run RouteMaterialAssets.Create)");
+ var road = Resources.Load<Material>(RoadMaterialResource)
+ ?? throw new InvalidOperationException($"Resources/{RoadMaterialResource}.mat is missing (run RouteMaterialAssets.Create)");
+
+ var root = new GameObject(RootName);
+ root.transform.SetParent(terrain.transform, false);
+ root.transform.position = Vector3.zero; // children are in world space
+ var assets = root.AddComponent<MapRuntimeAssets>();
+ var ribbons = new GameObject(RibbonsName);
+ ribbons.transform.SetParent(root.transform, false);
+ var data = terrain.terrainData; var origin = terrain.transform.position;
+
+ // One group per display window, in the order the windows open (deterministic names and draw order).
+ foreach (var group in routes.GroupBy(RoutePaths.WindowOf).OrderBy(g => g.Key.From).ThenBy(g => g.Key.To ?? DateTime.MaxValue))
+ {
+ var holder = new GameObject($"Window {group.Key}");
+ holder.transform.SetParent(ribbons.transform, false);
+ holder.AddComponent<RouteGroup>().Window = group.Key;
+ foreach (var (kinds, material, name) in new[]
+ {
+ (new[] { RoutePaths.Rail }, rail, "Rail"),
+ (new[] { RoutePaths.Road, RoutePaths.Track }, road, "Roads"),
+ })
+ {
+ var lines = group.Where(r => kinds.Contains(r.Kind)).Select(r => (World(frame, r), WidthOf(r.Kind))).ToList();
+ if (lines.Count == 0) continue;
+ var mesh = assets.Own(Ribbon(lines, data, origin, $"Route{name} {group.Key}"));
+ mesh.UploadMeshData(true);
+ var go = new GameObject(name);
+ go.transform.SetParent(holder.transform, false);
+ go.AddComponent<MeshFilter>().sharedMesh = mesh;
+ var r = go.AddComponent<MeshRenderer>();
+ r.sharedMaterial = material;
+ r.shadowCastingMode = UnityEngine.Rendering.ShadowCastingMode.Off;
+ r.receiveShadows = true;
+ }
+ holder.SetActive(group.Key.Covers(date));
+ }
+ assets.OnTeardown(VisualToggles.Register(RoutesToggle, on => { if (ribbons != null) ribbons.SetActive(on); }));
+
+ var trainRoute = routes.FirstOrDefault(r => r.Id == TrainRoute);
+ if (trainRoute != null && train != TrainMode.None)
+ {
+ var go = RouteTrain.Spawn(root.transform, assets, World(frame, trainRoute), data, origin,
+ frame.ToWorld(TrainTurnAt.lon, TrainTurnAt.lat, 0), frame.ToWorld(RouteTrain.StillAt.lon, RouteTrain.StillAt.lat, 0),
+ train == TrainMode.Still);
+ assets.OnTeardown(VisualToggles.Register(TrainToggle, on => { if (go != null) go.SetActive(on); }));
+ }
+ return root;
+ }
+
+ /// <summary>A route's points in world metres (x east, z north).</summary>
+ public static List<Vector2> World(GeoFrame frame, RoutePath route)
+ {
+ var w = new List<Vector2>(route.Points.Count);
+ foreach (var p in route.Points)
+ {
+ var v = frame.ToWorld(p[0], p[1], 0);
+ var q = new Vector2(v.x, v.z);
+ if (w.Count == 0 || (q - w[w.Count - 1]).sqrMagnitude > 1e-4f) w.Add(q);
+ }
+ return w;
+ }
+
+ /// <summary>Points every <paramref name="step"/> metres along a polyline, its last point included, and the
+ /// distance along it of each.</summary>
+ public static (List<Vector2> points, List<float> along) Resample(IReadOnlyList<Vector2> line, float step)
+ {
+ var pts = new List<Vector2>(); var along = new List<float>();
+ if (line.Count == 0) return (pts, along);
+ pts.Add(line[0]); along.Add(0f);
+ float s = 0f, next = step;
+ for (int i = 1; i < line.Count; i++)
+ {
+ var a = line[i - 1]; var b = line[i]; float len = (b - a).magnitude;
+ while (next <= s + len && len > 0f)
+ {
+ pts.Add(Vector2.Lerp(a, b, (next - s) / len)); along.Add(next);
+ next += step;
+ }
+ s += len;
+ }
+ if (s - along[along.Count - 1] > 1e-3f) { pts.Add(line[line.Count - 1]); along.Add(s); }
+ return (pts, along);
+ }
+
+ /// <summary>The height (world y) of a ribbon vertex at <paramref name="q"/>: <see cref="ClearanceM"/> above the highest
+ /// ground at q and half a step along <paramref name="along"/> (unit) and half a vertex spacing across, either way.
+ /// The ribbon and the train's wheels share it (review M4), so the bed never rises over the train on a grade.</summary>
+ public static float RibbonHeight(TerrainData data, Vector3 origin, Vector2 q, Vector2 along, float spacing)
+ {
+ var side = new Vector2(along.y, -along.x);
+ float y = Ground(data, origin, q);
+ foreach (var d in new[] { along * (StepM / 2), -along * (StepM / 2), side * (spacing / 2), -side * (spacing / 2) })
+ y = Mathf.Max(y, Ground(data, origin, q + d));
+ return y + ClearanceM;
+ }
+
+ /// <summary>The ground height (world y) under (x, z), clamped to the terrain.</summary>
+ public static float Ground(TerrainData data, Vector3 origin, Vector2 p) =>
+ origin.y + data.GetInterpolatedHeight(Mathf.Clamp01((p.x - origin.x) / data.size.x), Mathf.Clamp01((p.y - origin.z) / data.size.z));
+
+ /// <summary>One mesh for several ribbons. Along each line, a cross-section every <see cref="StepM"/>, square to the
+ /// line's direction (averaged over two steps each way, so a tight bend fans instead of folding); across it,
+ /// <see cref="Across"/> vertices, each <see cref="ClearanceM"/> above the highest ground at its own point and half a
+ /// step and half a spacing around it (so terrain between vertices cannot rise through the ribbon), with the
+ /// terrain's own normal (so the sun shades it as the ground). UV: u across (0 left edge, 1 right), v along (m).</summary>
+ public static Mesh Ribbon(IEnumerable<(List<Vector2> line, float width)> lines, TerrainData data, Vector3 origin, string name)
+ {
+ var verts = new List<Vector3>(); var normals = new List<Vector3>(); var uvs = new List<Vector2>(); var tris = new List<int>();
+ foreach (var (line, width) in lines)
+ {
+ if (line.Count < 2) continue;
+ var (pts, along) = Resample(line, StepM);
+ int n = pts.Count, first = verts.Count;
+ float spacing = width / (Across - 1);
+ for (int i = 0; i < n; i++)
+ {
+ var t = (pts[Math.Min(n - 1, i + 2)] - pts[Math.Max(0, i - 2)]).normalized;
+ var side = new Vector2(t.y, -t.x); // right of the direction of travel
+ for (int j = 0; j < Across; j++)
+ {
+ float a = (float)j / (Across - 1);
+ var q = pts[i] + side * ((a - 0.5f) * width);
+ verts.Add(new Vector3(q.x, RibbonHeight(data, origin, q, t, spacing), q.y));
+ normals.Add(data.GetInterpolatedNormal(Mathf.Clamp01((q.x - origin.x) / data.size.x), Mathf.Clamp01((q.y - origin.z) / data.size.z)));
+ uvs.Add(new Vector2(a, along[i]));
+ }
+ }
+ for (int i = 0; i + 1 < n; i++)
+ for (int j = 0; j + 1 < Across; j++)
+ {
+ int a = first + i * Across + j, b = a + 1, c = a + Across, d = c + 1;
+ tris.AddRange(new[] { a, c, b, b, c, d }); // the shader draws both faces
+ }
+ }
+ var mesh = new Mesh { name = name };
+ if (verts.Count > 65535) mesh.indexFormat = UnityEngine.Rendering.IndexFormat.UInt32;
+ mesh.SetVertices(verts); mesh.SetNormals(normals); mesh.SetUVs(0, uvs); mesh.SetTriangles(tris, 0);
+ mesh.RecalculateBounds();
+ return mesh;
+ }
+ }
+}
diff --git a/unity/Assets/Scripts/Map/Routes/RouteLayer.cs.meta b/unity/Assets/Scripts/Map/Routes/RouteLayer.cs.meta
new file mode 100644
index 000000000..aa01538ac
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RouteLayer.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: dd6af66467f994ce9b80cde5078176e1
\ No newline at end of file
diff --git a/unity/Assets/Scripts/Map/Routes/RoutePaths.cs b/unity/Assets/Scripts/Map/Routes/RoutePaths.cs
new file mode 100644
index 000000000..2553c63bc
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RoutePaths.cs
@@ -0,0 +1,138 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Text.RegularExpressions;
+using YamlDotNet.Core;
+using YamlDotNet.Serialization;
+using YamlDotNet.Serialization.NamingConventions;
+
+namespace Statecraft.Game.Map.Routes
+{
+ /// <summary>One traced route of content/map/route_paths_1948.yaml: a railway, a main road or a track (the 1948 Burma
+ /// Road), as a lon/lat polyline (issue #35; tools/routes_1948.py writes the file, routes_1948.yaml holds the sources).</summary>
+ public sealed class RoutePath
+ {
+ public string Id { get; set; } = "";
+ public string Kind { get; set; } = "";
+ public string Status { get; set; } = "";
+ public double LengthKm { get; set; }
+ /// <summary>The display window: a quoted 'YYYY' (1 January) or 'YYYY-MM-DD'. The map draws the route while the game
+ /// date is on or after From and, when To is given, before To (C1: the Burma Road from 14 June 1948).</summary>
+ public string From { get; set; } = "";
+ public string? To { get; set; }
+ /// <summary>The trace's quality, written by the tool: the share of traced pixels on the route's own map symbol,
+ /// and the longest run off it (m).</summary>
+ public double OnSymbol { get; set; }
+ public double MaxGapM { get; set; }
+ /// <summary>[lon, lat] pairs, in order along the route.</summary>
+ public List<List<double>> Points { get; set; } = new List<List<double>>();
+ }
+
+ public sealed class RoutePathFile { public List<RoutePath> Routes { get; set; } = new List<RoutePath>(); }
+
+ /// <summary>A route's display window as dates.</summary>
+ public readonly struct RouteWindow : IEquatable<RouteWindow>
+ {
+ public readonly DateTime From; public readonly DateTime? To;
+ public RouteWindow(DateTime from, DateTime? to) { From = from; To = to; }
+ public bool Covers(DateTime date) => date >= From && (To == null || date < To.Value);
+ public bool Equals(RouteWindow o) => From == o.From && To == o.To;
+ public override bool Equals(object? o) => o is RouteWindow w && Equals(w);
+ public override int GetHashCode() => HashCode.Combine(From, To);
+ public override string ToString() => To == null ? $"{From:yyyy-MM-dd}" : $"{From:yyyy-MM-dd}..{To:yyyy-MM-dd}";
+ }
+
+ /// <summary>Reads route_paths_1948.yaml. The map draws it (RouteLayer); the sim never reads it, so it is not in the
+ /// content hash (like settlements_1948.yaml's coordinates).</summary>
+ public static class RoutePaths
+ {
+ public const string DefaultFileName = "route_paths_1948.yaml";
+ public const string Rail = "rail", Road = "road", Track = "track";
+ static readonly HashSet<string> Kinds = new HashSet<string> { Rail, Road, Track };
+ static readonly Regex IdRule = new Regex(@"^[a-z][a-z0-9_]*\z");
+ static readonly Regex DateRule = new Regex(@"^\d{4}(-\d{2}-\d{2})?\z");
+
+ /// <summary>A window bound: 'YYYY' is 1 January of that year. Throws FormatException on anything else.</summary>
+ public static DateTime Bound(string text)
+ {
+ if (text == null || !DateRule.IsMatch(text)) throw new FormatException($"'{text}' is not 'YYYY' or 'YYYY-MM-DD'");
+ try
+ {
+ return text.Length == 4
+ ? new DateTime(int.Parse(text, CultureInfo.InvariantCulture), 1, 1)
+ : DateTime.ParseExact(text, "yyyy-MM-dd", CultureInfo.InvariantCulture);
+ }
+ catch (ArgumentOutOfRangeException e) { throw new FormatException($"'{text}' is not a date", e); } // year 0000
+ }
+
+ public static RouteWindow WindowOf(RoutePath r) => new RouteWindow(Bound(r.From), r.To == null ? (DateTime?)null : Bound(r.To));
+
+ /// <summary>The routes to draw, or none (with a warning through <paramref name="warn"/>) when the file is missing
+ /// (an empty text: a stale manifest or an old content copy) or malformed: a cosmetic layer never stops the map
+ /// from building (review I3, as promo-art reads its population file).</summary>
+ public static List<RoutePath> ReadOrNone(string? yaml, (double lon0, double lon1, double lat0, double lat1)? bounds,
+ Action<string> warn, string file = DefaultFileName)
+ {
+ if (string.IsNullOrWhiteSpace(yaml)) { warn($"{file}: missing, so the map draws no railways or roads"); return new List<RoutePath>(); }
+ try { return Parse(yaml!, bounds, file, warn); }
+ catch (InvalidDataException e) { warn($"{e.Message}; the map draws no railways or roads"); return new List<RoutePath>(); }
+ }
+
+ /// <summary>Parses the file. Every problem throws InvalidDataException naming <paramref name="file"/> and, for
+ /// content errors, the route id: YAML syntax, duplicate or unknown keys, no routes, a bad or duplicate id, an unknown
+ /// kind, fewer than two points, a point that is not a [lon, lat] pair of finite numbers or lies outside
+ /// <paramref name="bounds"/> when given, or a bad from/to (unless <paramref name="skipBadWindow"/> is given: then that
+ /// route alone is left out and reported through it).</summary>
+ public static List<RoutePath> Parse(string yaml, (double lon0, double lon1, double lat0, double lat1)? bounds = null,
+ string file = DefaultFileName, Action<string>? skipBadWindow = null)
+ {
+ RoutePathFile doc;
+ try
+ {
+ doc = new DeserializerBuilder().WithNamingConvention(UnderscoredNamingConvention.Instance).WithDuplicateKeyChecking()
+ .Build().Deserialize<RoutePathFile>(yaml);
+ }
+ catch (YamlException e) { throw new InvalidDataException($"{file}: {e.Message}", e); }
+ if (doc?.Routes == null || doc.Routes.Count == 0) throw new InvalidDataException($"{file}: no routes");
+ var ids = new HashSet<string>();
+ var skipped = new List<RoutePath>();
+ foreach (var r in doc.Routes)
+ {
+ if (r == null || string.IsNullOrWhiteSpace(r.Id)) throw new InvalidDataException($"{file}: a route has an empty id");
+ var at = $"{file}: '{r.Id}'";
+ if (!IdRule.IsMatch(r.Id)) throw new InvalidDataException($"{at} id must be lower snake_case");
+ if (!ids.Add(r.Id)) throw new InvalidDataException($"{at} duplicate id");
+ if (!Kinds.Contains(r.Kind)) throw new InvalidDataException($"{at} has unknown kind '{r.Kind}' (rail, road or track)");
+ if (r.Points == null || r.Points.Count < 2) throw new InvalidDataException($"{at} needs at least two points");
+ string? badWindow = null;
+ try
+ {
+ var window = WindowOf(r);
+ if (window.To != null && window.To <= window.From) badWindow = $"{at} to must be after from";
+ }
+ catch (FormatException e) { badWindow = $"{at} from/to: {e.Message}"; }
+ if (badWindow != null)
+ {
+ // The tolerant read (ReadOrNone) skips just this route with a warning (re-review nit 1); a strict read throws.
+ if (skipBadWindow == null) throw new InvalidDataException(badWindow);
+ skipBadWindow($"{badWindow}; that route is not drawn");
+ skipped.Add(r);
+ }
+ for (int i = 0; i < r.Points.Count; i++)
+ {
+ var p = r.Points[i];
+ if (p == null || p.Count != 2 || !IsFinite(p[0]) || !IsFinite(p[1]))
+ throw new InvalidDataException($"{at} point {i} is not a [lon, lat] pair of numbers");
+ if (bounds is { } b && (p[0] < b.lon0 || p[0] > b.lon1 || p[1] < b.lat0 || p[1] > b.lat1))
+ throw new InvalidDataException(FormattableString.Invariant($"{at} point {i} ({p[0]}, {p[1]}) is outside the map"));
+ }
+ }
+ doc.Routes.RemoveAll(skipped.Contains);
+ return doc.Routes;
+ }
+
+ static bool IsFinite(double v) => !double.IsNaN(v) && !double.IsInfinity(v);
+ }
+}
diff --git a/unity/Assets/Scripts/Map/Routes/RoutePaths.cs.meta b/unity/Assets/Scripts/Map/Routes/RoutePaths.cs.meta
new file mode 100644
index 000000000..05622ce68
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RoutePaths.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 4b112407845044abcb7d5db3ea027d20
\ No newline at end of file
diff --git a/unity/Assets/Scripts/Map/Routes/RouteTrain.cs b/unity/Assets/Scripts/Map/Routes/RouteTrain.cs
new file mode 100644
index 000000000..14baa4551
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RouteTrain.cs
@@ -0,0 +1,160 @@
+#nullable enable
+using System;
+using System.Collections.Generic;
+using Statecraft.Game.Map.Units;
+using UnityEngine;
+
+namespace Statecraft.Game.Map.Routes
+{
+ /// <summary>The steam train of the promo (promo/final/03 and the video's 0:21 close-up): a tank-and-tender locomotive and
+ /// four coaches, code-built as painted miniatures (MiniatureMesh, the units' palette and material), at the settlements'
+ /// symbolic scale (<see cref="Scale"/>), running on the railway ribbon. It shuttles along its route between the line's
+ /// start and the turn point (RouteLayer: Jaffa to Lydda), the locomotive leading each way, with a stop at each end.
+ /// A still train (screenshots, editor renders) stands at <see cref="StillAt"/>, heading inland, every run alike. Cheap:
+ /// six transforms set per frame from a precomputed table; no physics, no allocation after Spawn. A showcase for the
+ /// promo frames and `?train` / `?units`, never normal play (RouteLayer.ModeFor, review I1): the run is ambience, not a
+ /// sourced timetable.</summary>
+ public sealed class RouteTrain : MonoBehaviour
+ {
+ /// <summary>Times real size along the line, measured on the promo's gameplay frame: its six-car train is about 250 px
+ /// long at 1920 px (about 35 m/px there), about 8.8 km, so about 80 times this 110 m consist (the settlements' blocks
+ /// are about 60x, owner ruling 2026-10-11). Across and up it is <see cref="Chunk"/> times more, as the promo's
+ /// miniature train is stockier than a real one (a first checkpoint at a uniform 65x drew it a thin dark line).</summary>
+ public const float Scale = 80f, Chunk = 1.5f;
+ /// <summary>Symbolic speed along the line (m/s of map), so the train moves visibly at the gameplay zoom (about 9 px a
+ /// second); and the stop at each end (s).</summary>
+ public const float SpeedMps = 300f, DwellSeconds = 6f;
+ /// <summary>Where a still train's middle stands: on the line by Mikve Israel, east of Jaffa and Tel Aviv, inside the
+ /// gameplay03 frame, as in the promo.</summary>
+ public static readonly (double lon, double lat) StillAt = (34.83, 32.01);
+ /// <summary>Height of the wheels above the ribbon's line, so they sit on the ballast, not in it.</summary>
+ public const float RideM = 4f;
+ const float TableStepM = 50f;
+
+ readonly List<Transform> cars = new List<Transform>();
+ readonly List<float> carOffset = new List<float>(), carHalf = new List<float>(); // from the head, metres of map
+ float[] tableS = Array.Empty<float>();
+ Vector3[] tableP = Array.Empty<Vector3>();
+ float startS, endS, length;
+ float? still;
+
+ /// <summary>Distance along the line of the head (front of the locomotive) at time <paramref name="t"/>, and the
+ /// direction (+1 towards the turn point, -1 back).</summary>
+ public (float head, int dir) HeadAt(float t)
+ {
+ float run = Mathf.Max(endS - startS - length, 0f);
+ float leg = run / SpeedMps + DwellSeconds, period = 2f * leg;
+ float x = Mathf.Repeat(t, period);
+ if (x < leg)
+ {
+ float moved = Mathf.Min(x * SpeedMps, run);
+ return (startS + length + moved, +1);
+ }
+ float back = Mathf.Min((x - leg) * SpeedMps, run);
+ return (endS - length - back, -1);
+ }
+
+ public float? StillHead => still;
+ public IReadOnlyList<Transform> Cars => cars;
+ public float Length => length;
+ public (float start, float end) Stretch => (startS, endS);
+
+ void Update()
+ {
+ if (still.HasValue) return;
+ var (head, dir) = HeadAt(Time.time);
+ Place(head, dir);
+ }
+
+ /// <summary>Places every car with the head at <paramref name="head"/> metres along the line, running in direction
+ /// <paramref name="dir"/>: each car's centre on the line, its nose and tail on the line too, so it follows bends and
+ /// grades.</summary>
+ public void Place(float head, int dir)
+ {
+ for (int k = 0; k < cars.Count; k++)
+ {
+ float c = head - dir * carOffset[k];
+ var front = At(c + dir * carHalf[k]); var back = At(c - dir * carHalf[k]);
+ var mid = At(c);
+ var fwd = front - back;
+ cars[k].SetPositionAndRotation(mid, Quaternion.LookRotation(fwd.sqrMagnitude > 1e-6f ? fwd : Vector3.forward, Vector3.up));
+ }
+ }
+
+ /// <summary>The point of the line (on the ribbon, plus the ride height) at distance s, clamped to the line.</summary>
+ public Vector3 At(float s)
+ {
+ if (tableS.Length == 0) return Vector3.zero;
+ if (s <= 0f) return tableP[0];
+ if (s >= tableS[tableS.Length - 1]) return tableP[tableP.Length - 1];
+ int i = Mathf.Min((int)(s / TableStepM), tableS.Length - 2);
+ while (i > 0 && tableS[i] > s) i--;
+ while (i + 1 < tableS.Length - 1 && tableS[i + 1] < s) i++;
+ float f = (s - tableS[i]) / Mathf.Max(tableS[i + 1] - tableS[i], 1e-3f);
+ return Vector3.Lerp(tableP[i], tableP[i + 1], f);
+ }
+
+ /// <summary>Builds the train under <paramref name="parent"/> on <paramref name="line"/> (world x, z), its meshes,
+ /// palette and material owned by <paramref name="assets"/>. It runs from the line's start to the point nearest
+ /// <paramref name="turnAt"/>; a still train's middle stands at the point nearest <paramref name="stillAt"/> (both
+ /// world points). Returns the train's root.</summary>
+ public static GameObject Spawn(Transform parent, MapRuntimeAssets assets, IReadOnlyList<Vector2> line, TerrainData data,
+ Vector3 origin, Vector3 turnAt, Vector3 stillAt, bool stillTrain)
+ {
+ var template = Resources.Load<Material>(UnitMaterials.MiniatureResource)
+ ?? throw new InvalidOperationException($"Resources/{UnitMaterials.MiniatureResource}.mat is missing (run UnitMaterialAssets.Create)");
+ var palette = assets.Own(UnitPalette.MakeTexture(readable: false));
+ var paint = assets.Own(new Material(template) { name = "Train (palette)" });
+ paint.SetTexture("_BaseMap", palette);
+
+ var go = new GameObject("Train");
+ go.transform.SetParent(parent, false);
+ var train = go.AddComponent<RouteTrain>();
+ var (pts, along) = RouteLayer.Resample(line, TableStepM);
+ train.tableS = along.ToArray();
+ train.tableP = new Vector3[pts.Count];
+ for (int i = 0; i < pts.Count; i++)
+ {
+ // The ribbon's own centre height (the same max-of-samples rule, review M4) plus the ride height.
+ var dir = (pts[Math.Min(pts.Count - 1, i + 1)] - pts[Math.Max(0, i - 1)]).normalized;
+ float spacing = RouteLayer.RailWidthM / (RouteLayer.Across - 1);
+ train.tableP[i] = new Vector3(pts[i].x, RouteLayer.RibbonHeight(data, origin, pts[i], dir, spacing) + RideM, pts[i].y);
+ }
+ train.startS = 0f;
+ train.endS = train.Nearest(new Vector2(turnAt.x, turnAt.z));
+
+ float offset = 0f;
+ foreach (var (name, mesh, lengthM) in TrainModels.Consist())
+ {
+ assets.Own(mesh); mesh.UploadMeshData(true);
+ var car = new GameObject(name);
+ car.transform.SetParent(go.transform, false);
+ car.transform.localScale = new Vector3(Scale * Chunk, Scale * Chunk, Scale);
+ car.AddComponent<MeshFilter>().sharedMesh = mesh;
+ car.AddComponent<MeshRenderer>().sharedMaterial = paint;
+ float half = lengthM * Scale / 2f;
+ train.cars.Add(car.transform); train.carOffset.Add(offset + half); train.carHalf.Add(half);
+ offset += 2f * half + TrainModels.GapM * Scale;
+ }
+ train.length = offset - TrainModels.GapM * Scale;
+
+ float stillMiddle = train.Nearest(new Vector2(stillAt.x, stillAt.z));
+ float stillHead = Mathf.Clamp(stillMiddle + train.length / 2f, train.startS + train.length, train.endS);
+ train.still = stillTrain ? stillHead : (float?)null;
+ if (stillTrain) train.Place(stillHead, +1); else { var (h, d) = train.HeadAt(0f); train.Place(h, d); }
+ return go;
+ }
+
+ /// <summary>Distance along the line of its point nearest <paramref name="p"/> (to the table's resolution).</summary>
+ public float Nearest(Vector2 p)
+ {
+ float best = float.MaxValue, s = 0f;
+ for (int i = 0; i < tableP.Length; i++)
+ {
+ float d = (new Vector2(tableP[i].x, tableP[i].z) - p).sqrMagnitude;
+ if (d < best) { best = d; s = tableS[i]; }
+ }
+ return s;
+ }
+ }
+}
diff --git a/unity/Assets/Scripts/Map/Routes/RouteTrain.cs.meta b/unity/Assets/Scripts/Map/Routes/RouteTrain.cs.meta
new file mode 100644
index 000000000..596c6aee9
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/RouteTrain.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: e00cb901e797e42cb99f78d2442e144e
\ No newline at end of file
diff --git a/unity/Assets/Scripts/Map/Routes/TrainModels.cs b/unity/Assets/Scripts/Map/Routes/TrainModels.cs
new file mode 100644
index 000000000..df29ce61e
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/TrainModels.cs
@@ -0,0 +1,68 @@
+#nullable enable
+using System.Collections.Generic;
+using Statecraft.Game.Map.Units;
+using UnityEngine;
+
+namespace Statecraft.Game.Map.Routes
+{
+ /// <summary>The train's cars as painted miniatures (MiniatureMesh and the units' palette), in real metres, facing +Z,
+ /// origin on the rail at the car's middle: a tender locomotive (boiler, smokebox, chimney, dome, cab, red buffer beam),
+ /// its tender and four coaches (olive-brown sides, a window band and a light grey roof), after the promo's train. Generic
+ /// period shapes for the map's far zoom, not a model of a particular Palestine Railways class: the close zoom's
+ /// authored models are the AI-3D track's (owner ruling, 2026-10-11). Pure geometry: the same calls give the same mesh.</summary>
+ public static class TrainModels
+ {
+ public const float LocoLengthM = 17f, TenderLengthM = 7.5f, CoachLengthM = 20f, GapM = 1f;
+ public const int Coaches = 4;
+
+ /// <summary>The consist from the front: (name, mesh, length in real metres).</summary>
+ public static List<(string name, Mesh mesh, float lengthM)> Consist()
+ {
+ var cars = new List<(string, Mesh, float)>
+ {
+ ("Locomotive", Locomotive(), LocoLengthM),
+ ("Tender", Tender(), TenderLengthM),
+ };
+ for (int i = 0; i < Coaches; i++) cars.Add(($"Coach{i}", Coach($"TrainCoach{i}"), CoachLengthM));
+ return cars;
+ }
+
+ static Matrix4x4 Box(float x, float y, float z, float w, float h, float l) =>
+ Matrix4x4.TRS(new Vector3(x, y, z), Quaternion.identity, new Vector3(w, h, l));
+
+ public static Mesh Locomotive()
+ {
+ var m = new MiniatureMesh();
+ m.Box(Box(0, 0.7f, 0, 2.2f, 1.2f, 14f), UnitPalette.Waterline); // wheels and frames, dark
+ m.Box(Box(0, 1.4f, 0.4f, 2.9f, 0.3f, 16f), UnitPalette.PropBlack); // running board
+ m.Rod(new Vector3(0, 2.7f, -3.5f), new Vector3(0, 2.7f, 6.6f), 0.95f, 0.95f, UnitPalette.PropBlack, 14, rounded: false);
+ m.Rod(new Vector3(0, 2.7f, 6.6f), new Vector3(0, 2.7f, 7.8f), 1.0f, 1.0f, UnitPalette.Funnel, 14, rounded: false); // smokebox
+ m.Rod(new Vector3(0, 3.4f, 6.9f), new Vector3(0, 4.5f, 6.9f), 0.32f, 0.38f, UnitPalette.PropBlack, 10, rounded: false); // chimney
+ m.Ellipsoid(Matrix4x4.TRS(new Vector3(0, 3.6f, 1.8f), Quaternion.identity, new Vector3(0.5f, 0.45f, 0.65f)), UnitPalette.PropBlack, 10, 6);
+ m.Box(Box(0, 2.85f, -5.6f, 2.9f, 2.7f, 3.2f), UnitPalette.PropBlack); // cab
+ m.Box(Box(0, 4.3f, -5.6f, 3.1f, 0.25f, 3.6f), UnitPalette.Funnel); // cab roof
+ m.Box(Box(0, 3.1f, -5.6f, 2.95f, 0.7f, 1.6f), UnitPalette.Glass); // cab windows
+ m.Box(Box(0, 1.2f, 8.3f, 2.9f, 0.5f, 0.3f), UnitPalette.MarkingRed); // buffer beam
+ return m.Build("TrainLocomotive");
+ }
+
+ public static Mesh Tender()
+ {
+ var m = new MiniatureMesh();
+ m.Box(Box(0, 0.75f, 0, 2.3f, 1.1f, 6.8f), UnitPalette.Waterline);
+ m.Box(Box(0, 2.15f, 0, 2.8f, 2.3f, 7.2f), UnitPalette.PropBlack);
+ m.Box(Box(0, 3.35f, 0.3f, 2.4f, 0.25f, 5.6f), UnitPalette.Waterline); // coal
+ return m.Build("TrainTender");
+ }
+
+ public static Mesh Coach(string name)
+ {
+ var m = new MiniatureMesh();
+ m.Box(Box(0, 0.75f, 0, 2.3f, 1.1f, 18f), UnitPalette.Waterline); // bogies and underframe
+ m.Box(Box(0, 2.35f, 0, 2.9f, 2.5f, 19.4f), UnitPalette.Trousers); // body: olive-brown, as the promo's
+ m.Box(Box(0, 2.85f, 0, 2.96f, 0.7f, 17.4f), UnitPalette.Glass); // window band
+ m.Ellipsoid(Matrix4x4.TRS(new Vector3(0, 3.6f, 0), Quaternion.identity, new Vector3(1.55f, 0.35f, 9.9f)), UnitPalette.Underside, 12, 6); // roof: light grey
+ return m.Build(name);
+ }
+ }
+}
diff --git a/unity/Assets/Scripts/Map/Routes/TrainModels.cs.meta b/unity/Assets/Scripts/Map/Routes/TrainModels.cs.meta
new file mode 100644
index 000000000..0794b5c99
--- /dev/null
+++ b/unity/Assets/Scripts/Map/Routes/TrainModels.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 413a3fa4eb50a4e289199a8db917595f
\ No newline at end of file
diff --git a/unity/Assets/Scripts/UI/GameRoot.cs b/unity/Assets/Scripts/UI/GameRoot.cs
index e6fcf2765..05d71c174 100644
--- a/unity/Assets/Scripts/UI/GameRoot.cs
+++ b/unity/Assets/Scripts/UI/GameRoot.cs
@@ -228,6 +228,7 @@ namespace Statecraft.Game.UI
void RenderPlacementsIfChanged()
{
if (Bridge == null) return;
+ Statecraft.Game.Map.Routes.RouteLayer.ShowAt(map, Bridge.State.Date); // dated routes (the Burma Road from June 1948)
var now = Bridge.State.Placements.Select(p => (p.Action, p.Q, p.R, p.Date)).ToList();
if (drawn != null && drawn.SequenceEqual(now)) return;
drawn = now;
diff --git a/unity/Assets/Shaders/Route.shader b/unity/Assets/Shaders/Route.shader
new file mode 100644
index 000000000..e6207a965
--- /dev/null
+++ b/unity/Assets/Shaders/Route.shader
@@ -0,0 +1,174 @@
+// The 1948 railways and roads (issue #35, RouteLayer): ribbons draped on the terrain at the promo's symbolic width. One
+// shader for both looks, chosen by _Kind (a material value, so a uniform branch): 0 a pale dirt road with faint wheel ruts,
+// 1 a railway (a ballast bed, sleepers and two rails). The mesh gives u across the ribbon (0..1) and v along it (metres),
+// so the sleepers repeat at a fixed spacing; every pattern is box-filtered to the pixel (fwidth), so it fades to its mean
+// instead of shimmering as the camera pulls back. Lit like the ground beside it: the sun with its shadows plus the ambient
+// probe, then the hex grid and the land haze of StatecraftMap.hlsl, so the ribbons carry the terrain's relief shading and
+// fade with it. Transparent with soft edges; a stencil bit lets each pixel take one ribbon core only, so crossings and
+// joins never double-blend (the rail material draws first, so a railway stays on top of a road it crosses).
+Shader "Statecraft/Route"
+{
+ Properties
+ {
+ _Kind ("Kind (0 road, 1 rail)", Float) = 0
+ _Opacity ("Opacity", Range(0, 1)) = 1
+ }
+ SubShader
+ {
+ Tags { "RenderType" = "Transparent" "Queue" = "Transparent" "RenderPipeline" = "UniversalPipeline" "IgnoreProjector" = "True" }
+ HLSLINCLUDE
+ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
+ #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl"
+ #include "Assets/Shaders/StatecraftMap.hlsl"
+
+ CBUFFER_START(UnityPerMaterial)
+ float _Kind;
+ float _Opacity;
+ CBUFFER_END
+
+ // Colours (sRGB) after the promo's gameplay frame (promo/final/03): pale packed dirt; a grey-brown ballast bed
+ // with dark timber sleepers and light steel rails (promo video 0:21).
+ static const float3 RoadSrgb = float3(0.86, 0.78, 0.62);
+ static const float3 RutSrgb = float3(0.72, 0.63, 0.48);
+ static const float3 BallastSrgb = float3(0.50, 0.46, 0.41);
+ static const float3 BankSrgb = float3(0.42, 0.37, 0.31); // the embankment's shoulders, darker
+ static const float3 SleeperSrgb = float3(0.30, 0.22, 0.15);
+ // Far off (a pixel over FarFromM, full by FarToM: the country-wide pose), pale dirt on pale ground would vanish,
+ // so a road darkens to a grey-brown line, as the promo's diorama draws its roads (a symbolic far look).
+ static const float3 RoadFarSrgb = float3(0.50, 0.44, 0.36);
+ static const float FarFromM = 60.0, FarToM = 150.0;
+ static const float3 RailSrgb = float3(0.72, 0.70, 0.66); // light worn steel, as the promo video's close-up
+ // The railway's pattern, in metres along (v) and as a share of the ribbon across (u).
+ static const float SleeperSpacingM = 150.0, SleeperDuty = 0.4, SleeperHalfSpan = 0.29;
+ static const float RailOffset = 0.12, RailHalfWidth = 0.018;
+ static const float RutOffset = 0.16, RutHalfWidth = 0.05;
+
+ struct Attributes { float4 positionOS : POSITION; float3 normalOS : NORMAL; float2 uv : TEXCOORD0; };
+ struct Varyings { float4 positionCS : SV_POSITION; float3 positionWS : TEXCOORD0; float3 normalWS : TEXCOORD1; float2 uv : TEXCOORD2; };
+
+ Varyings Vert(Attributes input)
+ {
+ Varyings o;
+ VertexPositionInputs p = GetVertexPositionInputs(input.positionOS.xyz);
+ o.positionCS = p.positionCS; o.positionWS = p.positionWS;
+ o.normalWS = TransformObjectToWorldNormal(input.normalOS);
+ o.uv = input.uv;
+ return o;
+ }
+
+ // Integral of a pulse train (1 for the first `duty` of each `period`, 0 after), for its box filter.
+ float PulseIntegral(float x, float period, float duty)
+ {
+ float k = floor(x / period);
+ return k * duty * period + min(x - k * period, duty * period);
+ }
+
+ // Share of a pixel `w` wide (same units) centred at x covered by the pulse train.
+ float PulseBox(float x, float w, float period, float duty)
+ {
+ w = max(w, 1e-4);
+ return (PulseIntegral(x + 0.5 * w, period, duty) - PulseIntegral(x - 0.5 * w, period, duty)) / w;
+ }
+
+ // Share of a pixel `w` wide covered by a band of half-width h around c (all in the same units), thinned when the
+ // band is narrower than the pixel, so a line far away fades rather than staying a full pixel wide.
+ float Band(float x, float c, float h, float w)
+ {
+ w = max(w, 1e-4);
+ return saturate((h - abs(x - c)) / w + 0.5) * saturate(2.0 * h / w);
+ }
+
+ // The ribbon's colour and its coverage (before the material's opacity).
+ half4 Shade(Varyings input)
+ {
+ float u = input.uv.x, v = input.uv.y;
+ float du = max(fwidth(u), 1e-5), dv = max(fwidth(v), 1e-3);
+ float2 mapM = input.positionWS.xz - _ScMapOrigin.xz;
+ float grid = ScGridAmount(mapM, input.positionWS); // uniform control flow (it takes derivatives)
+ float3 albedo;
+ float alpha;
+ [branch] if (_Kind > 0.5)
+ {
+ albedo = lerp(SRGBToLinear(BankSrgb), SRGBToLinear(BallastSrgb), smoothstep(0.12, 0.3, 0.5 - abs(u - 0.5)));
+ float across = Band(u, 0.5, SleeperHalfSpan, du);
+ float sleeper = across * PulseBox(v, dv, SleeperSpacingM, SleeperDuty);
+ albedo = lerp(albedo, SRGBToLinear(SleeperSrgb), sleeper);
+ float rails = saturate(Band(u, 0.5 - RailOffset, RailHalfWidth, du) + Band(u, 0.5 + RailOffset, RailHalfWidth, du));
+ albedo = lerp(albedo, SRGBToLinear(RailSrgb), rails);
+ float e = max(0.16, du); // the soft edge, at least a pixel wide (review M5)
+ alpha = smoothstep(0.0, e, u) * smoothstep(1.0, 1.0 - e, u);
+ }
+ else
+ {
+ albedo = SRGBToLinear(RoadSrgb);
+ float ruts = saturate(Band(u, 0.5 - RutOffset, RutHalfWidth, du) + Band(u, 0.5 + RutOffset, RutHalfWidth, du));
+ albedo = lerp(albedo, SRGBToLinear(RutSrgb), 0.6 * ruts);
+ albedo = lerp(albedo, SRGBToLinear(RoadFarSrgb), smoothstep(FarFromM, FarToM, dv));
+ float e = max(0.3, du);
+ alpha = smoothstep(0.0, e, u) * smoothstep(1.0, 1.0 - e, u);
+ }
+ albedo = lerp(albedo, SRGBToLinear(ScGridLandSrgb), grid * _ScGrid.x);
+ float3 n = normalize(input.normalWS);
+ Light sun = GetMainLight(TransformWorldToShadowCoord(input.positionWS));
+ float3 lit = albedo * (sun.color * saturate(dot(n, sun.direction)) * sun.shadowAttenuation * sun.distanceAttenuation + SampleSH(n));
+ // A ribbon narrower than a pixel (the country-wide pose) covers only part of it: fade it by its coverage, so it
+ // thins out instead of crawling (review M5).
+ alpha *= saturate(1.0 / du);
+ float h = _ScHaze.a * ScHazeAmount(input.positionWS);
+ return half4(lerp(lit, _ScHaze.rgb, h), alpha);
+ }
+ ENDHLSL
+
+ // Two passes split each ribbon at half coverage (review M3). The core (coverage 0.5 and up) writes the stencil bit,
+ // so no later ribbon draws over it; the soft rim only tests the bit and never writes it, so a ribbon's faint edge
+ // cannot cut a notch out of the next ribbon's core where roads join or cross the railway. URP draws both: the core
+ // as UniversalForward, the rim as SRPDefaultUnlit.
+ Pass
+ {
+ Name "RouteCore"
+ Tags { "LightMode" = "UniversalForward" }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ZWrite Off
+ ZTest LEqual
+ Cull Off
+ Offset -1, -4
+ Stencil { Ref 32 ReadMask 32 WriteMask 32 Comp NotEqual Pass Replace }
+ HLSLPROGRAM
+ #pragma vertex Vert
+ #pragma fragment Frag
+ // The main light's shadows, as the terrain and Sea.shader have them.
+ #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
+ #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
+ half4 Frag(Varyings input) : SV_Target
+ {
+ half4 c = Shade(input);
+ clip(c.a - 0.5);
+ return half4(c.rgb, c.a * _Opacity);
+ }
+ ENDHLSL
+ }
+ Pass
+ {
+ Name "RouteRim"
+ Tags { "LightMode" = "SRPDefaultUnlit" }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ZWrite Off
+ ZTest LEqual
+ Cull Off
+ Offset -1, -4
+ Stencil { Ref 32 ReadMask 32 Comp NotEqual }
+ HLSLPROGRAM
+ #pragma vertex Vert
+ #pragma fragment Frag
+ #pragma multi_compile _ _MAIN_LIGHT_SHADOWS _MAIN_LIGHT_SHADOWS_CASCADE _MAIN_LIGHT_SHADOWS_SCREEN
+ #pragma multi_compile_fragment _ _SHADOWS_SOFT _SHADOWS_SOFT_LOW _SHADOWS_SOFT_MEDIUM _SHADOWS_SOFT_HIGH
+ half4 Frag(Varyings input) : SV_Target
+ {
+ half4 c = Shade(input);
+ clip(0.5 - c.a);
+ return half4(c.rgb, c.a * _Opacity);
+ }
+ ENDHLSL
+ }
+ }
+}
diff --git a/unity/Assets/Shaders/Route.shader.meta b/unity/Assets/Shaders/Route.shader.meta
new file mode 100644
index 000000000..e14f05477
--- /dev/null
+++ b/unity/Assets/Shaders/Route.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 6f7eb075e582e433b85c8c4d0d446f42
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/unity/Assets/Tests/EditMode/GameInputsTests.cs b/unity/Assets/Tests/EditMode/GameInputsTests.cs
index 03437b2ef..19f42da80 100644
--- a/unity/Assets/Tests/EditMode/GameInputsTests.cs
+++ b/unity/Assets/Tests/EditMode/GameInputsTests.cs
@@ -59,6 +59,7 @@ public class GameInputsTests
CollectionAssert.AreEqual(disk.Map.HeightmapR16z, fetched.Map.HeightmapR16z);
Assert.AreEqual(disk.Map.HeightmapJson, fetched.Map.HeightmapJson);
Assert.AreEqual(disk.Map.SettlementsYaml, fetched.Map.SettlementsYaml);
+ Assert.AreEqual(disk.Map.RoutesYaml, fetched.Map.RoutesYaml);
Assert.AreEqual(disk.Map.HexesJson, fetched.Map.HexesJson);
Assert.AreEqual(disk.Content.Events.Count, fetched.Content.Events.Count);
Assert.AreEqual(Simulation.NewGame(disk.Content, 7, Mode.Historical).Hash(), Simulation.NewGame(fetched.Content, 7, Mode.Historical).Hash());
diff --git a/unity/Assets/Tests/EditMode/HudTests.cs b/unity/Assets/Tests/EditMode/HudTests.cs
index bf356525a..9f73e63b3 100644
--- a/unity/Assets/Tests/EditMode/HudTests.cs
+++ b/unity/Assets/Tests/EditMode/HudTests.cs
@@ -370,6 +370,7 @@ public class HudTests
("PortraitFraming.cs", "offset / (h - boxH) * 100f", "a portrait's background-position-y in percent (layout, not text)"),
("MapShaderGlobals.cs", "RiftHazeTopM = -100f", "a real elevation in metres for the rift haze (shader input, not a displayed number)"),
("SettlementKits.cs", "DefaultHouses = 100f", "the owner's symbolic scale for houses and trees (100x real size), not a displayed number"),
+ ("RouteLayer.cs", "CorridorMarginM = 100f", "a clearance in map metres that kit buildings and trees keep from a route (geometry, not a displayed number)"),
};
[Test]
diff --git a/unity/Assets/Tests/EditMode/RouteTests.cs b/unity/Assets/Tests/EditMode/RouteTests.cs
new file mode 100644
index 000000000..6586f4607
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/RouteTests.cs
@@ -0,0 +1,489 @@
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using NUnit.Framework;
+using Statecraft.Game;
+using Statecraft.Game.Map;
+using Statecraft.Game.Map.Routes;
+using Statecraft.Sim;
+using UnityEditor;
+using UnityEditor.SceneManagement;
+using UnityEngine;
+
+/// <summary>The 1948 railways and roads (issue #35): the traced data, the ribbons, the train, the toggles and the look.</summary>
+public class RouteTests
+{
+ static readonly (double, double, double, double) Bounds = (34.2, 35.9, 29.45, 33.35);
+ static string CommittedYaml => File.ReadAllText(Path.Combine(Paths.Content, "map", RoutePaths.DefaultFileName));
+
+ [Test]
+ public void TheCommittedRoutesParse()
+ {
+ var routes = RoutePaths.Parse(CommittedYaml, Bounds);
+ Assert.GreaterOrEqual(routes.Count, 19);
+ var ids = routes.Select(r => r.Id).ToList();
+ CollectionAssert.IsSubsetOf(new[] { "jaffa_jerusalem_railway", "kantara_main_line_south", "eastern_railway",
+ "hadera_haifa_railway", "jaffa_jerusalem_road", "burma_road", "tel_aviv_haifa_road", "coastal_road_south" }, ids);
+ Assert.AreEqual(RoutePaths.Rail, routes.First(r => r.Id == RouteLayer.TrainRoute).Kind);
+ Assert.IsTrue(routes.All(r => r.Status == "draft" || r.Status == "fact-checked"));
+ }
+
+ [TestCase("routes: []", "no routes")]
+ [TestCase("routes:\n- {id: a, kind: canal, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}", "unknown kind 'canal'")]
+ [TestCase("routes:\n- {id: a, kind: road, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5]]}", "'a' needs at least two points")]
+ [TestCase("routes:\n- {id: a, kind: road, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [40.0, 31.6]]}", "'a' point 1 (40, 31.6) is outside the map")]
+ [TestCase("routes:\n- {id: a, kind: road, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [34.6]]}", "'a' point 1 is not a [lon, lat] pair")]
+ [TestCase("routes:\n- {id: Bad, kind: road, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}", "'Bad' id must be lower snake_case")]
+ [TestCase("routes:\n- {id: a, kind: road, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}\n- {id: a, kind: rail, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}", "'a' duplicate id")]
+ [TestCase("routes:\n- {id: a, kind: road, status: draft, length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}", "'a' from/to")]
+ [TestCase("routes:\n- {id: a, kind: road, status: draft, from: '1948-6-1', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}", "'a' from/to")]
+ [TestCase("routes:\n- {id: a, kind: road, status: draft, from: '1948', to: '1947', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}", "'a' to must be after from")]
+ [TestCase("routes:\n- {id: a, kind: road, colour: red, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}", "colour")]
+ public void BadRouteFilesNameTheFileAndTheProblem(string yaml, string expected)
+ {
+ var e = Assert.Throws<InvalidDataException>(() => RoutePaths.Parse(yaml, Bounds, "r.yaml"));
+ StringAssert.StartsWith("r.yaml:", e.Message);
+ StringAssert.Contains(expected, e.Message);
+ }
+
+ /// <summary>Map-only: the sim's content hash is the same with and without the route files (so neither moves the
+ /// goldens), and the WebGL manifest ships the traced file the map reads.</summary>
+ [Test]
+ public void TheRoutesDoNotMoveTheContentHash()
+ {
+ var copy = Path.Combine(Path.GetTempPath(), "statecraft-noroutes-" + System.Guid.NewGuid().ToString("N"));
+ try
+ {
+ Statecraft.Game.Boot.ContentManifest.Copy(Paths.Content, copy);
+ foreach (var f in Directory.GetFiles(Path.Combine(copy, "map"), "route*_1948.yaml")) File.Delete(f);
+ Assert.AreEqual(ContentLoader.Load(Paths.Content).Hash, ContentLoader.Load(copy).Hash);
+ var manifest = Statecraft.Game.Boot.ContentManifest.Collect(Paths.Content);
+ CollectionAssert.Contains(manifest, "map/" + RoutePaths.DefaultFileName);
+ CollectionAssert.DoesNotContain(manifest, "map/routes_1948.yaml", "the tracer's hand-written input is never downloaded (review M10)");
+ }
+ finally { if (Directory.Exists(copy)) Directory.Delete(copy, true); }
+ }
+
+ [Test]
+ public void ResampleKeepsTheEndsAndTheSpacing()
+ {
+ var (pts, along) = RouteLayer.Resample(new List<Vector2> { new Vector2(0, 0), new Vector2(250, 0), new Vector2(250, 100) }, 120f);
+ Assert.AreEqual(new Vector2(0, 0), pts[0]);
+ Assert.AreEqual(new Vector2(250, 100), pts[pts.Count - 1]);
+ Assert.AreEqual(350f, along[along.Count - 1], 1e-3f);
+ for (int i = 1; i + 1 < along.Count; i++) Assert.AreEqual(120f * i, along[i], 1e-3f);
+ }
+
+ static MapScene BuildMap()
+ {
+ EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single);
+ var map = new GameObject("MapScene").AddComponent<MapScene>();
+ map.Configure(Load("Terrain"), Load("SettlementMarker"), Load("HexSelection"), Load("Sea"), Load("BorderLand"));
+ map.Build();
+ return map;
+ }
+
+ static Material Load(string name) => AssetDatabase.LoadAssetAtPath<Material>($"Assets/Materials/{name}.mat");
+
+ static Transform RoutesRoot(MapScene map) => map.Terrain.transform.Find(RouteLayer.RootName);
+
+ static IEnumerable<MeshFilter> Ribbons(Transform root, string name) =>
+ root.Find(RouteLayer.RibbonsName).GetComponentsInChildren<MeshFilter>(true).Where(f => f.name == name);
+
+ /// <summary>The rail ribbon's vertices, hashed (SHA-256 over their float bits). Pinned below, so a fresh editor process
+ /// building the committed data must give the same geometry bit for bit (review M11), and an unintended geometry
+ /// change fails here. A deliberate change (new data, new widths) updates the constant.</summary>
+ static string Hash(Mesh m)
+ {
+ var bytes = new List<byte>();
+ foreach (var v in m.vertices) { bytes.AddRange(System.BitConverter.GetBytes(v.x)); bytes.AddRange(System.BitConverter.GetBytes(v.y)); bytes.AddRange(System.BitConverter.GetBytes(v.z)); }
+ foreach (var uv in m.uv) { bytes.AddRange(System.BitConverter.GetBytes(uv.x)); bytes.AddRange(System.BitConverter.GetBytes(uv.y)); }
+ using var sha = System.Security.Cryptography.SHA256.Create();
+ return string.Concat(sha.ComputeHash(bytes.ToArray()).Select(b => b.ToString("x2")));
+ }
+ const string RailMeshHash = "10b9365cce450aa2e425bbbe5869c850f6014e68d056f1e1b44b3a2d36bc8fea";
+
+ [Test]
+ public void TheMapBuildsRibbonsOnTheGroundAndTheTogglesHideThem()
+ {
+ var map = BuildMap();
+ List<Object> owned;
+ try
+ {
+ var root = RoutesRoot(map);
+ Assert.IsNotNull(root, "MapScene.Build adds the routes under the terrain (a rebuild destroys them)");
+ var rail = Ribbons(root, "Rail").ToList(); var roads = Ribbons(root, "Roads").ToList();
+ Assert.IsTrue(rail.Count > 0 && roads.Count > 0);
+ Assert.AreSame(Resources.Load<Material>(RouteLayer.RailMaterialResource), rail[0].GetComponent<MeshRenderer>().sharedMaterial);
+ // Budget: well under 100k triangles in all (WebGL's integrated GPUs draw millions), one draw call per window
+ // group and look (about a dozen).
+ int tris = (int)(rail.Concat(roads).Sum(f => (long)f.sharedMesh.GetIndexCount(0)) / 3);
+ int railVerts = rail.Sum(f => f.sharedMesh.vertexCount), roadVerts = roads.Sum(f => f.sharedMesh.vertexCount);
+ TestContext.WriteLine($"rail {railVerts} vertices, roads {roadVerts}, {tris} triangles, {rail.Count + roads.Count} draw calls");
+ Assert.Less(tris, 100000);
+ Assert.LessOrEqual(rail.Count + roads.Count, 20);
+ // The meshes are freed after upload (no CPU copy), so check a fresh build of the same data: every vertex
+ // clears the ground under it by the clearance, and lies on the terrain.
+ var routes = RoutePaths.Parse(CommittedYaml, Bounds);
+ var data = map.Terrain.terrainData; var origin = map.Terrain.transform.position;
+ var check = RouteLayer.Ribbon(routes.Where(r => r.Kind == RoutePaths.Rail).Select(r => (RouteLayer.World(map.Frame, r), RouteLayer.RailWidthM)), data, origin, "check");
+ try
+ {
+ Assert.AreEqual(railVerts, check.vertexCount, "the same data gives the same vertices");
+ foreach (var v in check.vertices)
+ {
+ Assert.GreaterOrEqual(v.y - RouteLayer.Ground(data, origin, new Vector2(v.x, v.z)), RouteLayer.ClearanceM - 0.01f);
+ Assert.That(v.x, Is.InRange(origin.x, origin.x + data.size.x)); Assert.That(v.z, Is.InRange(origin.z, origin.z + data.size.z));
+ }
+ var hash = Hash(check);
+ TestContext.WriteLine($"rail mesh hash {hash}");
+ Assert.AreEqual(RailMeshHash, hash, "the committed data builds the pinned rail geometry in a fresh process");
+ }
+ finally { Object.DestroyImmediate(check); }
+
+ CollectionAssert.Contains(VisualToggles.Names, RouteLayer.RoutesToggle);
+ CollectionAssert.Contains(VisualToggles.Names, RouteLayer.TrainToggle);
+ VisualToggles.Set(RouteLayer.RoutesToggle, false);
+ Assert.IsFalse(root.Find(RouteLayer.RibbonsName).gameObject.activeSelf);
+ Assert.IsTrue(root.Find("Train").gameObject.activeSelf, "each toggle prices its own part");
+ VisualToggles.Set(RouteLayer.TrainToggle, false);
+ Assert.IsFalse(root.Find("Train").gameObject.activeSelf);
+ VisualToggles.SetAll(true);
+ Assert.IsTrue(root.Find(RouteLayer.RibbonsName).gameObject.activeSelf && root.Find("Train").gameObject.activeSelf);
+ owned = root.GetComponentsInChildren<MeshFilter>(true).Select(f => (Object)f.sharedMesh).ToList();
+ var paint = root.Find("Train/Locomotive").GetComponent<MeshRenderer>().sharedMaterial;
+ owned.Add(paint); owned.Add(paint.GetTexture("_BaseMap"));
+ Assert.IsTrue(owned.All(o => o != null));
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ Assert.IsTrue(owned.All(o => o == null), "destroying the map frees the route meshes, the train's material and its palette texture");
+ CollectionAssert.DoesNotContain(VisualToggles.Names, RouteLayer.RoutesToggle, "the map's teardown removes the switches");
+ CollectionAssert.DoesNotContain(VisualToggles.Names, RouteLayer.TrainToggle);
+ }
+
+ /// <summary>C1: the Burma Road shows only from its completion on 14 June 1948; the start (15 May 1948) does not have
+ /// it, every other route is there from the start.</summary>
+ [Test]
+ public void TheBurmaRoadAppearsOn14June1948()
+ {
+ var map = BuildMap();
+ try
+ {
+ var groups = RoutesRoot(map).Find(RouteLayer.RibbonsName).GetComponentsInChildren<RouteGroup>(true).ToList();
+ var burma = groups.Single(g => g.Window.From == new System.DateTime(1948, 6, 14));
+ Assert.IsFalse(burma.gameObject.activeSelf, "built as at the game's start, 15 May 1948");
+ Assert.IsTrue(groups.Where(g => g != burma).All(g => g.gameObject.activeSelf), "the rest are on the 1946 map");
+ RouteLayer.ShowAt(map, new System.DateTime(1948, 6, 13));
+ Assert.IsFalse(burma.gameObject.activeSelf);
+ RouteLayer.ShowAt(map, new System.DateTime(1948, 6, 14));
+ Assert.IsTrue(burma.gameObject.activeSelf);
+ RouteLayer.ShowAt(map, new System.DateTime(1948, 5, 15));
+ Assert.IsFalse(burma.gameObject.activeSelf, "a reloaded earlier save hides it again");
+ RouteLayer.ShowAt(map, new System.DateTime(1910, 1, 1));
+ Assert.IsTrue(groups.Where(g => g.Window.From.Year > 1910).All(g => !g.gameObject.activeSelf), "nothing before its window");
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
+ [Test]
+ public void WindowsAndBounds()
+ {
+ Assert.AreEqual(new System.DateTime(1946, 1, 1), RoutePaths.Bound("1946"));
+ Assert.AreEqual(new System.DateTime(1948, 6, 14), RoutePaths.Bound("1948-06-14"));
+ Assert.Throws<System.FormatException>(() => RoutePaths.Bound("48"));
+ var w = new RouteWindow(new System.DateTime(1948, 6, 14), new System.DateTime(1949, 1, 1));
+ Assert.IsFalse(w.Covers(new System.DateTime(1948, 6, 13))); Assert.IsTrue(w.Covers(new System.DateTime(1948, 6, 14)));
+ Assert.IsFalse(w.Covers(new System.DateTime(1949, 1, 1)), "to is exclusive");
+ }
+
+ /// <summary>I3: a missing or malformed route file means no routes and a warning, never a broken map.</summary>
+ [Test]
+ public void AMissingOrBadRouteFileLeavesTheMapWithoutRoutes()
+ {
+ var warnings = new List<string>();
+ Assert.IsEmpty(RoutePaths.ReadOrNone("", Bounds, warnings.Add));
+ Assert.IsEmpty(RoutePaths.ReadOrNone("routes: [", Bounds, warnings.Add));
+ Assert.AreEqual(2, warnings.Count);
+ StringAssert.Contains("missing", warnings[0]);
+ Assert.Greater(RoutePaths.ReadOrNone(CommittedYaml, Bounds, warnings.Add).Count, 0);
+ Assert.AreEqual(2, warnings.Count, "the committed file reads without a warning");
+
+ EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single);
+ var map = new GameObject("MapScene").AddComponent<MapScene>();
+ map.Configure(Load("Terrain"), Load("SettlementMarker"), Load("HexSelection"), Load("Sea"), Load("BorderLand"));
+ var inputs = Statecraft.Game.Boot.GameInputs.MapFromDisk(Paths.Content, Paths.StreamingMap);
+ inputs.RoutesYaml = "";
+ UnityEngine.TestTools.LogAssert.Expect(LogType.Warning, new System.Text.RegularExpressions.Regex("route_paths_1948.yaml: missing"));
+ try
+ {
+ map.Build(inputs);
+ Assert.IsNotNull(map.Terrain, "the map still builds");
+ Assert.IsEmpty(RoutesRoot(map).GetComponentsInChildren<MeshFilter>(true), "no ribbons and no train");
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
+ /// <summary>Re-review nit 1: a route with an impossible date (year 0000, a 13th month) is skipped with a warning by the
+ /// tolerant read, and the map still builds with every other route; the strict parse still rejects it.</summary>
+ [Test]
+ public void ABadDateSkipsOnlyThatRoute()
+ {
+ const string good = "- {id: a, kind: road, status: draft, from: '1946', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}\n";
+ foreach (var bad in new[] { "0000", "1948-13-40" })
+ {
+ var yaml = "routes:\n" + good + $"- {{id: b, kind: road, status: draft, from: '{bad}', length_km: 1, points: [[34.5, 31.5], [34.6, 31.6]]}}\n";
+ var warnings = new List<string>();
+ var routes = RoutePaths.ReadOrNone(yaml, Bounds, warnings.Add);
+ CollectionAssert.AreEqual(new[] { "a" }, routes.Select(r => r.Id).ToList(), bad);
+ Assert.AreEqual(1, warnings.Count, bad);
+ StringAssert.Contains("'b' from/to", warnings[0]);
+ var e = Assert.Throws<InvalidDataException>(() => RoutePaths.Parse(yaml, Bounds, "r.yaml"));
+ StringAssert.Contains("'b' from/to", e.Message);
+ }
+
+ EditorSceneManager.NewScene(NewSceneSetup.DefaultGameObjects, NewSceneMode.Single);
+ var map = new GameObject("MapScene").AddComponent<MapScene>();
+ map.Configure(Load("Terrain"), Load("SettlementMarker"), Load("HexSelection"), Load("Sea"), Load("BorderLand"));
+ var inputs = Statecraft.Game.Boot.GameInputs.MapFromDisk(Paths.Content, Paths.StreamingMap);
+ Assert.IsTrue(inputs.RoutesYaml.Contains("from: '1948-06-14'"));
+ inputs.RoutesYaml = inputs.RoutesYaml.Replace("from: '1948-06-14'", "from: '0000'");
+ UnityEngine.TestTools.LogAssert.Expect(LogType.Warning, new System.Text.RegularExpressions.Regex("'burma_road' from/to"));
+ try
+ {
+ map.Build(inputs);
+ var groups = RoutesRoot(map).Find(RouteLayer.RibbonsName).GetComponentsInChildren<RouteGroup>(true);
+ Assert.Greater(groups.Length, 0, "the other routes are drawn");
+ Assert.IsFalse(groups.Any(g => g.Window.From.Year == 1948), "only the bad route is left out");
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
+ /// <summary>Re-review nit 2: a map rebuilt mid-game draws its routes as at the game's date at once, not as at 15 May
+ /// until the next state change.</summary>
+ [Test]
+ public void ARebuiltMapKeepsTheGameDate()
+ {
+ var map = BuildMap();
+ try
+ {
+ Assert.IsNull(map.RouteDate);
+ RouteLayer.ShowAt(map, new System.DateTime(1948, 7, 1));
+ Assert.AreEqual(new System.DateTime(1948, 7, 1), map.RouteDate);
+ map.Build();
+ var burma = RoutesRoot(map).Find(RouteLayer.RibbonsName).GetComponentsInChildren<RouteGroup>(true)
+ .Single(g => g.Window.From == new System.DateTime(1948, 6, 14));
+ Assert.IsTrue(burma.gameObject.activeSelf, "shown at once after the rebuild");
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
+ /// <summary>Kits and routes together (#179 on main): no kit building, landmark or tree reaches into any route's
+ /// corridor, half the drawn width plus RouteLayer.CorridorMarginM, the Burma Road included (the kits are built once,
+ /// not per date). Checked by brute force against every segment, independent of KitGround's grid.</summary>
+ [Test]
+ public void NoKitBuildingOrTreeStandsOnARoute()
+ {
+ EditorSceneManager.OpenScene("Assets/Map.unity", OpenSceneMode.Single);
+ var map = Object.FindFirstObjectByType<MapScene>();
+ try
+ {
+ map.Build();
+ Assert.IsNotNull(map.KitStats, "Map.unity builds the kits");
+ var routes = RoutePaths.Parse(CommittedYaml, Bounds);
+ var corridors = RouteLayer.Corridors(map.Frame, routes);
+ Assert.AreEqual(corridors.Sum(c => c.line.Count - 1), map.KitStats.CorridorSegments, "the map hands every route to the kits");
+ Assert.IsTrue(routes.Any(r => r.Id == "burma_road"), "the dated Burma Road keeps its corridor from the start");
+
+ // The same placement the map runs, with the same corridors.
+ var g = new Statecraft.Game.Map.Kits.KitGround(map.Terrain, map.Frame, map.Hexes, HeightmapLoader.Load(Paths.StreamingMap).meta.elev_min_m);
+ foreach (var (line, half) in corridors) g.AddCorridor(line, half);
+ var built = Statecraft.Game.Map.Kits.SettlementKits.Build(map.Settlements, g, out var lots);
+ foreach (var k in built) Object.DestroyImmediate(k.mesh);
+ foreach (var l in lots) g.Lots.Add((l.centre, l.radius));
+ var trees = Statecraft.Game.Map.Kits.Vegetation.Plant(map.Settlements, g);
+ Assert.Greater(lots.Count, 200); Assert.Greater(trees.Count, 1000); // 264 lots and about 7,000 trees (306 lots without the corridors)
+
+ float Clearance(Vector2 p) => corridors.Min(c =>
+ {
+ float best = float.MaxValue;
+ for (int i = 0; i + 1 < c.line.Count; i++)
+ best = Mathf.Min(best, Statecraft.Game.Map.Kits.KitGround.SegmentDistance(p, c.line[i], c.line[i + 1]) - c.halfWidth);
+ return best;
+ });
+ int badLots = lots.Count(l => Clearance(l.centre) < l.radius - 0.01f);
+ int badTrees = trees.Count(t =>
+ {
+ Vector3 p = t.Item2.GetColumn(3);
+ float crown = Statecraft.Game.Map.Kits.Vegetation.CrownRadiusM(t.Item1) * ((Vector3)t.Item2.GetColumn(0)).magnitude;
+ return Clearance(new Vector2(p.x, p.z)) < crown - 0.01f;
+ });
+ TestContext.WriteLine($"{lots.Count} lots, {trees.Count} trees, {map.KitStats.CorridorSegments} route segments: {badLots} lots and {badTrees} trees on a route");
+ Assert.AreEqual(0, badLots, "no building or landmark lot reaches a route corridor");
+ Assert.AreEqual(0, badTrees, "no tree crown reaches a route corridor");
+ Assert.AreEqual(map.Settlements.Count, lots.Select(l => l.id).Distinct().Count(), "every town still has buildings");
+ }
+ finally
+ {
+ Object.DestroyImmediate(map.gameObject);
+ Statecraft.Game.Map.Kits.KitScale.Reset();
+ EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
+ }
+ }
+
+ /// <summary>I1 and M11: the train is a showcase. Editor renders and `?shot` hold it still (the promo frames); `?train`
+ /// or `?units` runs it; normal play has none.</summary>
+ [Test]
+ public void TheTrainIsAShowcaseOnly()
+ {
+ Assert.AreEqual(RouteLayer.TrainMode.Still, RouteLayer.ModeFor(playing: false, shot: false, requested: false), "editor renders");
+ Assert.AreEqual(RouteLayer.TrainMode.Still, RouteLayer.ModeFor(playing: true, shot: true, requested: false), "?shot freezes it");
+ Assert.AreEqual(RouteLayer.TrainMode.Still, RouteLayer.ModeFor(playing: true, shot: true, requested: true));
+ Assert.AreEqual(RouteLayer.TrainMode.Moving, RouteLayer.ModeFor(playing: true, shot: false, requested: true));
+ Assert.AreEqual(RouteLayer.TrainMode.None, RouteLayer.ModeFor(playing: true, shot: false, requested: false), "normal play: no train");
+ Assert.IsTrue(RouteLayer.TrainRequested("https://x/index.html?train", new string[0], true));
+ Assert.IsTrue(RouteLayer.TrainRequested("https://x/index.html?golden&units", new string[0], true));
+ Assert.IsFalse(RouteLayer.TrainRequested("https://x/index.html?golden&smoke=5", new string[0], true));
+ Assert.IsFalse(RouteLayer.TrainRequested("https://x/index.html?trainx", new string[0], true));
+ Assert.IsTrue(RouteLayer.TrainRequested(null, new[] { "player", "-train" }, false));
+ Assert.IsFalse(RouteLayer.TrainRequested(null, new[] { "player", "-shot" }, false));
+ Assert.IsTrue(VisualShots.Requested("https://x/?golden&shot", new string[0], true), "the flag ModeForThisRun reads for ?shot");
+
+ var map = BuildMap();
+ try
+ {
+ var data = map.Terrain.terrainData;
+ var routes = RoutePaths.Parse(CommittedYaml, Bounds);
+ var none = RouteLayer.Build(map.Terrain, map.Frame, routes, RouteLayer.TrainMode.None, RouteLayer.DefaultDate);
+ Assert.IsNull(none.GetComponentInChildren<RouteTrain>(true), "no train in normal play");
+ var moving = RouteLayer.Build(map.Terrain, map.Frame, routes, RouteLayer.TrainMode.Moving, RouteLayer.DefaultDate);
+ Assert.IsNull(moving.GetComponentInChildren<RouteTrain>().StillHead, "the showcase runs");
+ Object.DestroyImmediate(none); Object.DestroyImmediate(moving);
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
+ [Test]
+ public void TheStillTrainStandsOnTheLineInTheGameplayView()
+ {
+ var map = BuildMap();
+ try
+ {
+ var train = RoutesRoot(map).GetComponentInChildren<RouteTrain>();
+ Assert.IsNotNull(train.StillHead, "an editor build holds the train still (screenshots repeat)");
+ Assert.AreEqual(2 + TrainModels.Coaches, train.Cars.Count);
+ // Its middle by Mikve Israel, east of Jaffa, as the promo's train.
+ var still = map.Frame.ToWorld(RouteTrain.StillAt.lon, RouteTrain.StillAt.lat, 0);
+ var mid = Vector3.Lerp(train.Cars[0].position, train.Cars[train.Cars.Count - 1].position, 0.5f);
+ Assert.Less(new Vector2(mid.x - still.x, mid.z - still.z).magnitude, 1500f);
+ // About the promo's 8.8 km, and each car on the ribbon (ground + clearance + ride), heading inland (east) first.
+ Assert.That(train.Length, Is.InRange(6000f, 10000f));
+ var data = map.Terrain.terrainData; var origin = map.Terrain.transform.position;
+ // On the ribbon's own centre height (the same max-of-samples rule, review M4) plus the ride height: never below
+ // the ribbon's bed at the car's middle.
+ foreach (var c in train.Cars)
+ {
+ var p = new Vector2(c.position.x, c.position.z);
+ float bed = RouteLayer.RibbonHeight(data, origin, p, new Vector2(c.forward.x, c.forward.z).normalized, RouteLayer.RailWidthM / (RouteLayer.Across - 1));
+ Assert.AreEqual(bed + RouteTrain.RideM, c.position.y, 40f, c.name);
+ Assert.GreaterOrEqual(c.position.y, RouteLayer.Ground(data, origin, p) + RouteLayer.ClearanceM, c.name);
+ }
+ Assert.Greater(train.Cars[0].position.x, train.Cars[train.Cars.Count - 1].position.x, "the locomotive leads towards Lydda");
+ var cam = Camera.main; PromoPose.Gameplay03.Apply(cam.GetComponent<CameraRig>(), map.Frame);
+ foreach (var c in train.Cars)
+ {
+ var vp = cam.WorldToViewportPoint(c.position);
+ Assert.That(vp.x, Is.InRange(0.05f, 0.95f), c.name); Assert.That(vp.y, Is.InRange(0.05f, 0.95f), c.name);
+ }
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
+ [Test]
+ public void TheTrainShuttlesWithTheLocomotiveLeading()
+ {
+ var map = BuildMap();
+ try
+ {
+ var train = RoutesRoot(map).GetComponentInChildren<RouteTrain>();
+ var (start, end) = train.Stretch;
+ Assert.Greater(end - start, 2f * train.Length, "Jaffa to Lydda is longer than the train");
+ var (h0, d0) = train.HeadAt(0f);
+ Assert.AreEqual(start + train.Length, h0, 1e-2f); Assert.AreEqual(1, d0);
+ float leg = (end - start - train.Length) / RouteTrain.SpeedMps + RouteTrain.DwellSeconds;
+ var (h1, d1) = train.HeadAt(leg - 0.01f);
+ Assert.AreEqual(end, h1, 1f, "at Lydda before turning"); Assert.AreEqual(1, d1);
+ var (h2, d2) = train.HeadAt(leg + 0.01f);
+ Assert.AreEqual(-1, d2, "back towards Jaffa");
+ Assert.AreEqual(end - train.Length, h2, 5f, "the consist stays where it stopped; the locomotive is now at the other end");
+ // Smooth: no jump between consecutive frames while running.
+ float prev = train.HeadAt(1f).head;
+ for (float t = 1f + 1f / 60f; t < leg - RouteTrain.DwellSeconds; t += 1f / 60f)
+ {
+ float h = train.HeadAt(t).head;
+ Assert.Less(Mathf.Abs(h - prev), RouteTrain.SpeedMps / 60f + 0.01f);
+ prev = h;
+ }
+ }
+ finally { Object.DestroyImmediate(map.gameObject); }
+ }
+
+ [Test]
+ public void TrainModelsAreRepeatable()
+ {
+ var a = TrainModels.Consist(); var b = TrainModels.Consist();
+ int tris = 0;
+ for (int i = 0; i < a.Count; i++)
+ {
+ CollectionAssert.AreEqual(a[i].mesh.vertices, b[i].mesh.vertices, a[i].name);
+ CollectionAssert.AreEqual(a[i].mesh.triangles, b[i].mesh.triangles, a[i].name);
+ tris += a[i].mesh.triangles.Length / 3;
+ }
+ Assert.Less(tris, 5000, $"train triangles {tris}");
+ foreach (var c in a.Concat(b)) Object.DestroyImmediate(c.mesh);
+ }
+
+ [Test]
+ public void TheRouteShaderRunsOnWebGL2()
+ {
+ CollectionAssert.IsEmpty(ShaderChecks.Gles3Errors(Shader.Find("Statecraft/Route")));
+ var rail = Resources.Load<Material>(RouteLayer.RailMaterialResource); var road = Resources.Load<Material>(RouteLayer.RoadMaterialResource);
+ Assert.AreEqual(1f, rail.GetFloat("_Kind")); Assert.AreEqual(0f, road.GetFloat("_Kind"));
+ Assert.Less(rail.renderQueue, road.renderQueue, "the railway draws first, so it stays on top where it crosses a road");
+ }
+
+ /// <summary>The look at gameplay03 (promo 03): the railway reads darker than the ground beside it (ballast and
+ /// sleepers) and a road lighter (pale dirt), and switching the routes off restores the ground.</summary>
+ [Test]
+ public void AtTheGameplayPoseTheRailwayIsDarkAndTheRoadPale()
+ {
+ var map = BuildMap();
+ try
+ {
+ RenderSample.TiltShift(false);
+ VisualToggles.Set(RouteLayer.TrainToggle, false);
+ var cam = Camera.main; var rig = cam.GetComponent<CameraRig>();
+ PromoPose.Gameplay03.Apply(rig, map.Frame);
+ var routes = RoutePaths.Parse(CommittedYaml, Bounds);
+ // A railway point and a road point in open country near the pose's centre (east of Tel Aviv).
+ Vector3 OnRoute(string id, double lon, double lat)
+ {
+ var line = RouteLayer.World(map.Frame, routes.First(r => r.Id == id));
+ var want = map.Frame.ToWorld(lon, lat, 0);
+ var best = line.OrderBy(p => (p - new Vector2(want.x, want.z)).sqrMagnitude).First();
+ return new Vector3(best.x, RouteLayer.Ground(map.Terrain.terrainData, map.Terrain.transform.position, best), best.y);
+ }
+ var railAt = OnRoute("eastern_railway", 34.93, 32.06);
+ var roadAt = OnRoute("tel_aviv_tulkarm_nablus_road", 34.92, 32.09);
+ var px = new Vector2[2];
+ var on = RenderSample.Render(cam, 1920, 1080, new[] { railAt, roadAt }, px);
+ VisualToggles.Set(RouteLayer.RoutesToggle, false);
+ var off = RenderSample.Render(cam, 1920, 1080);
+ Color railOn = on.Mean((int)px[0].x, (int)px[0].y, 1), railOff = off.Mean((int)px[0].x, (int)px[0].y, 1);
+ Color roadOn = on.Mean((int)px[1].x, (int)px[1].y, 1), roadOff = off.Mean((int)px[1].x, (int)px[1].y, 1);
+ TestContext.WriteLine($"rail {railOn} over ground {railOff}; road {roadOn} over ground {roadOff}");
+ Assert.Less(RenderSample.Luma(railOn), RenderSample.Luma(railOff) - 0.05f, "the railway is darker than the ground");
+ Assert.Greater(RenderSample.Luma(roadOn), RenderSample.Luma(roadOff) + 0.03f, "the road is paler than the ground");
+ }
+ finally { VisualToggles.SetAll(true); Object.DestroyImmediate(map.gameObject); }
+ }
+}
diff --git a/unity/Assets/Tests/EditMode/RouteTests.cs.meta b/unity/Assets/Tests/EditMode/RouteTests.cs.meta
new file mode 100644
index 000000000..19462a0e9
--- /dev/null
+++ b/unity/Assets/Tests/EditMode/RouteTests.cs.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: db6935e4d31d9439ca12316b785b81eb
\ No newline at end of file