ตารางเวลาคำนวณได้ + หน้ารายละเอียดป้ายขับเคลื่อนด้วยข้อมูล + แผนที่ Leaflet

Schedules — กติกา "จุดนี้ = เวลาจุดอ้างอิง ± n นาที"
- ฟิลด์ derive { from_station_id, offset_min } คำนวณที่ ui/partials/schedules.js (ท่อเดียว) รองรับอ้างจุดข้ามทิศ
- จุดย่อยของ "8 other_stop" ใช้ offsets_min จับคู่ตามลำดับ (เช่น ตลาดสามโก้ = ตลาดท่าช้าง +45 นาที)
- เครื่องมือ resource/tools/derive-times.py + ตาราง resource/data/derive-times.csv (--check / --audit ชี้จุดที่ควรตั้งกฎ)
- แยกตารางเป็นรายสาย: scheduleslist/schedules<route_id>.json และ schedules.json เป็นสารบัญ (โหลดแบบ lazy + cache)
- ตรวจจับวันทำงาน/วันหยุด + schema 3 (weekday/holiday → directions) · ไฟล์ข้อมูลเป็น CRLF ทั้งชุด
- ล้างค่าที่ไม่ใช่ HH:MM ที่ฝังใน times (ทำให้ KPI เพี้ยน) + กันค่าหลอกในตัวสรุปเวลา

UI
- หน้ารายละเอียดป้าย/ตารางเวลา ขับเคลื่อนด้วย JSON (stopDetail.init.js) · จุดขึ้นรถประจำทางอื่นๆ รองรับหลายจุดต่อสาย
- #/stops: แสดง 6 ป้ายแรก + ปุ่ม "แสดงป้ายทั้งหมด" (โหลดรูปเฉพาะที่แสดง) · ชิปสาย → #/routes/<route_id>
- หน้าแรก: ตัดตัวเลือก "ทุกสถานีในจังหวัดนี้" · ตัวกรองจังหวัด/สถานี + ปุ่มแชร์ (share URL)
- การ์ดติดต่อ: ไอคอน/ชื่อ/สีเปลี่ยนตามชนิด URL (Facebook / LINE / เว็บไซต์) + ปุ่มเปิดลิงก์จาก web_url
- รูปรองรับหลายนามสกุล (.jpg → .jpeg → .webp → .png) · ป้าย "ประมาณ" + หมายเหตุสำหรับตารางที่คำนวณ
- หน้าเครดิตเหลือ 3 หมวด · แก้ข้อความหมวดแผนที่ให้ตรงกับข้อมูลจริง
- แผนที่ Leaflet (vendor ในโปรเจกต์ ไม่ใช้ CDN): เส้นทาง + หมุด + ป๊อปอัป · แก้ CSS ที่ทำให้ SVG ยุบ 0x0

เครื่องมือและเอกสาร
- qgis-to-web.py อ่าน .shp ตรง → geojson-web (สร้างใหม่ 10 ไฟล์) + audit-geojson.py ตรวจ 3 ส่วน
- stop-km.py วัดระยะ กม. ตามเส้นจริง → stop-km.json · schedules-editor.html (แก้ทีละไฟล์ · มุมมองตารางแบบ Excel)
- AGENTS.md: กติกา derive · offsets_min · นามสกุลรูป · ชิปสาย · หน้ารายละเอียดป้ายมาจากไหน
This commit is contained in:
Bkk1234 committed 2026-09-30 03:25:18 +07:00
1 parent 88311326e6
commit 1cfaeb1526
91 files changed
+7560 -844

No files matched your search

+62 -200
View File
@@ -1,244 +1,106 @@
{
"schedules": [
"schema": 2,
"index": true,
"note": "สารบัญชี้ไป scheduleslist/schedules<route_id>.json (1 ไฟล์ = 1 เส้นทาง) — แก้ไฟล์ย่อยนั้นโดยตรง หรือใช้ resource/data/schedules-editor.html",
"dir": "scheduleslist/",
"routes": [
{
"schedule_id": 1,
"route_id": "101",
"station_id": 3,
"direction_note": null,
"departure_times": ["06:30", "07:20", "08:10", "09:00", "09:50", "10:40", "11:30", "12:20", "13:10", "14:00", "14:50", "15:40", "16:30", "17:30"],
"schedule_note": null
"file": "schedules101.json",
"n_directions": 4,
"n_stops": 8,
"n_trips": 64
},
{
"schedule_id": 2,
"route_id": "101",
"station_id": 1,
"direction_note": null,
"departure_times": ["07:30", "08:20", "09:10", "10:00", "10:50", "11:50", "13:00", "14:00", "15:00"],
"schedule_note": null
},
{
"schedule_id": 3,
"route_id": "101",
"station_id": 2,
"direction_note": "ไปอ่างทอง",
"departure_times": ["07:30", "08:20", "09:10", "10:00", "10:50", "11:40", "12:30", "13:20", "14:10", "15:00", "15:50", "16:40", "17:30", "18:30"],
"schedule_note": null
},
{
"schedule_id": 4,
"route_id": "101",
"station_id": 2,
"direction_note": "ไปอยุธยา",
"departure_times": ["08:00", "08:50", "09:40", "10:30", "11:20", "12:20", "13:30", "14:30", "15:30"],
"schedule_note": "เวลารถเปลี่ยนทุกวัน โดยเฉพาะวันหยุด"
},
{
"schedule_id": 5,
"route_id": "15",
"station_id": 1,
"direction_note": null,
"departure_times": ["05:00", "05:45", "06:30", "07:30"],
"schedule_note": null
"file": "schedules15.json",
"n_directions": 3,
"n_stops": 4,
"n_trips": 22
},
{
"schedule_id": 6,
"route_id": "15",
"station_id": 2,
"direction_note": null,
"departure_times": ["05:30", "06:20", "07:05", "07:55", "08:40", "09:30", "11:20", "12:10", "13:00", "15:00"],
"schedule_note": null
},
{
"schedule_id": 7,
"route_id": "15",
"station_id": 6,
"direction_note": null,
"departure_times": ["06:00", "08:30", "09:15", "10:00", "12:30", "14:00", "15:00", "16:00"],
"schedule_note": "เวลารถเปลี่ยนทุกวัน"
},
{
"schedule_id": 8,
"route_id": "902",
"station_id": 1,
"direction_note": null,
"departure_times": ["04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30"],
"schedule_note": null
"file": "schedules902.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 53
},
{
"schedule_id": 9,
"route_id": "902",
"station_id": 6,
"direction_note": null,
"departure_times": ["06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "11:00", "11:30", "12:00", "12:30", "13:00", "13:30", "14:00", "14:30", "15:00", "15:30", "16:00", "16:30", "17:00", "17:30", "18:00"],
"schedule_note": null
},
{
"schedule_id": 10,
"route_id": "951",
"station_id": 9,
"direction_note": null,
"departure_times": ["04:00", "04:20", "04:40", "05:00", "05:20", "05:40", "06:00", "06:20", "06:40", "07:00", "07:20", "07:40", "08:00", "08:20", "08:40", "09:00", "09:20", "09:40", "10:00", "10:20", "10:40", "11:00", "11:20", "11:40", "12:00", "12:20", "12:40", "13:00", "13:20", "13:40", "14:00", "14:20", "14:40", "15:00", "15:20", "15:40", "16:00", "16:20", "16:40", "17:00", "17:20", "17:40", "18:00"],
"schedule_note": null
"file": "schedules951.json",
"n_directions": 2,
"n_stops": 6,
"n_trips": 47
},
{
"schedule_id": 11,
"route_id": "952",
"station_id": 8,
"direction_note": "จากตลาดวิเศษ",
"departure_times": ["04:30", "10:00", "15:00"],
"schedule_note": null
"file": "schedules952.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 6
},
{
"schedule_id": 12,
"route_id": "952",
"station_id": 12,
"direction_note": null,
"departure_times": ["07:00", "10:30", "15:00"],
"schedule_note": "10:30 และ 7:00 มีเฉพาะวันหยุด"
},
{
"schedule_id": 13,
"route_id": "954",
"station_id": 8,
"direction_note": "จากท่าช้าง",
"departure_times": ["08:00"],
"schedule_note": "เวลาเปลี่ยนทุกวัน"
"file": "schedules954.json",
"n_directions": 1,
"n_stops": 1,
"n_trips": 4
},
{
"schedule_id": 14,
"route_id": "8",
"station_id": 13,
"direction_note": null,
"departure_times": ["03:30", "04:00", "04:30", "05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "11:00", "12:00", "13:00", "14:00", "15:00", "17:00"],
"schedule_note": null
"file": "schedules8.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 4
},
{
"schedule_id": 15,
"route_id": "8",
"station_id": 8,
"direction_note": "จากโพธิ์ทอง",
"departure_times": ["05:00", "05:30", "06:00", "06:30", "07:00", "07:30", "08:00", "08:30", "09:00", "09:30", "10:00", "10:30", "12:30", "13:30", "14:30", "15:30", "16:30", "18:30"],
"schedule_note": "เวลาเปลี่ยนทุกวัน"
},
{
"schedule_id": 16,
"route_id": "464",
"station_id": 9,
"direction_note": null,
"departure_times": ["04:40", "05:10", "05:40", "06:10", "06:40", "07:10", "07:40", "08:15", "08:50", "09:25", "10:00", "10:35", "11:10", "11:45", "12:20", "12:55", "13:30", "14:05", "14:40", "15:15", "15:50", "16:25", "17:00", "17:40"],
"schedule_note": null
"file": "schedules464.json",
"n_directions": 3,
"n_stops": 4,
"n_trips": 88
},
{
"schedule_id": 17,
"route_id": "464",
"station_id": 10,
"direction_note": null,
"departure_times": ["05:00", "05:40", "06:20", "07:10", "08:00", "08:40", "09:20", "10:00", "10:40", "11:20", "12:00", "12:40", "13:20", "14:00", "14:40", "15:20", "16:00", "16:40", "17:20", "18:00"],
"schedule_note": null
},
{
"schedule_id": 18,
"route_id": "464",
"station_id": 1,
"direction_note": "ไปสุพรรณบุรี",
"departure_times": ["06:30", "07:10", "07:50", "08:40", "09:30", "10:10", "10:50", "11:30", "12:10", "12:50", "13:30", "14:10", "14:50", "15:30", "16:10", "16:50", "17:30", "18:10", "18:50", "19:30"],
"schedule_note": null
},
{
"schedule_id": 19,
"route_id": "464",
"station_id": 1,
"direction_note": "ไปสระบุรี",
"departure_times": ["05:40", "06:10", "06:40", "07:10", "07:40", "08:10", "08:40", "09:15", "09:50", "10:25", "11:00", "11:35", "12:10", "12:45", "13:20", "13:55", "14:30", "15:05", "15:40", "16:15", "16:50", "17:25", "18:00", "18:40"],
"schedule_note": "เวลารถเปลี่ยนทุกวัน"
},
{
"schedule_id": 20,
"route_id": "641",
"station_id": 1,
"direction_note": null,
"departure_times": ["07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:30", "14:30", "16:30"],
"schedule_note": null
"file": "schedules641.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 18
},
{
"schedule_id": 21,
"route_id": "641",
"station_id": 7,
"direction_note": null,
"departure_times": ["07:00", "08:00", "09:00", "10:00", "11:00", "12:00", "13:30", "14:30", "16:30"],
"schedule_note": "10:00 และ 13:30 ไม่ได้มีทุกวัน"
},
{
"schedule_id": 22,
"route_id": "2194",
"station_id": 8,
"direction_note": "จากวัดหัวเวียง",
"departure_times": ["05:00", "06:00", "07:00"],
"schedule_note": null
"file": "schedules2194.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 6
},
{
"schedule_id": 23,
"route_id": "2194",
"station_id": 4,
"direction_note": null,
"departure_times": ["16:00", "17:00", "18:00"],
"schedule_note": null
},
{
"schedule_id": 24,
"route_id": "324",
"station_id": 1,
"direction_note": null,
"departure_times": ["10:00"],
"schedule_note": null
"file": "schedules324.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 2
},
{
"schedule_id": 25,
"route_id": "324",
"station_id": 8,
"direction_note": "จากวัดไชโยวรวิหาร",
"departure_times": ["08:00"],
"schedule_note": null
},
{
"schedule_id": 26,
"route_id": "1011",
"station_id": 1,
"direction_note": null,
"departure_times": ["12:00", "16:00", "17:00"],
"schedule_note": null
"file": "schedules1011.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 6
},
{
"schedule_id": 27,
"route_id": "1011",
"station_id": 8,
"direction_note": "จากวัดสีบัวทอง",
"departure_times": ["06:00", "06:30", "14:30"],
"schedule_note": null
},
{
"schedule_id": 28,
"route_id": "2231",
"station_id": 1,
"direction_note": null,
"departure_times": ["16:00"],
"schedule_note": null
"file": "schedules2231.json",
"n_directions": 2,
"n_stops": 2,
"n_trips": 2
},
{
"schedule_id": 29,
"route_id": "2231",
"station_id": 8,
"direction_note": "จากวัดมหานาม",
"departure_times": ["08:00"],
"schedule_note": null
},
{
"schedule_id": 30,
"route_id": "999",
"station_id": 14,
"direction_note": null,
"departure_times": [],
"schedule_note": "ยังไม่มีข้อมูลตารางเวลา"
"file": "schedules999.json",
"n_directions": 1,
"n_stops": 1,
"n_trips": 0
}
]
}
}