feat: sync source-backed OSM facility entrances

This commit is contained in:
Hamza-Ayed
2026-09-29 15:25:38 +03:00
parent 58310330b0
commit f4e24b0725
17 changed files with 772 additions and 391 deletions
@@ -0,0 +1,28 @@
-- وظيفة الملف: استعلام أو تغيير قاعدة بيانات يخص 05 poi gates clustering؛ راجع ترتيب التنفيذ قبل تطبيقه.
-- 1. Create the place_gates table
CREATE TABLE IF NOT EXISTS place_gates (
id SERIAL PRIMARY KEY,
place_id VARCHAR(255) NOT NULL, -- references unified_search_index.id
gate_name_ar VARCHAR(255) NOT NULL,
gate_name_en VARCHAR(255),
latitude NUMERIC(10, 7) NOT NULL,
longitude NUMERIC(10, 7) NOT NULL,
is_main_gate BOOLEAN DEFAULT false,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_place_gates_place_id ON place_gates(place_id);
-- No gate seed rows belong here: service doors must come from an explicit,
-- source-backed entrance node. See scripts/sync_osm_place_gates.py.
-- Prepare schema for future K-Means Clustering (Sero Trip Drop-offs)
CREATE TABLE IF NOT EXISTS sero_dropoffs (
id SERIAL PRIMARY KEY,
place_id VARCHAR(255) NOT NULL,
latitude NUMERIC(10, 7) NOT NULL,
longitude NUMERIC(10, 7) NOT NULL,
timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE INDEX idx_sero_dropoffs_place_id ON sero_dropoffs(place_id);