# map **Repository Path**: REIGE/map ## Basic Information - **Project Name**: map - **Description**: x先谢谢谢谢谢谢谢谢 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-09-20 - **Last Updated**: 2025-12-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Offline HMM Map-Matching (Cellular-Aided) Overview - Implements offline map-matching using a Hidden Markov Model and Viterbi decoding. - Emission uses spatial distance to roads plus cellular features: TA (timing advance) and RSRP, and serving sector alignment. - Transition uses a kinematic speed prior and penalizes frequent road switching. Data Formats (CSV) 1) Observations (columns; Chinese names auto-mapped): - 时间戳 (timestamp): int seconds - 经度 (lon): float - 纬度 (lat): float - 基站id (station_id): optional string - 主服小区id (primary_cell_id): optional string - TAValue (ta_value): optional float - 邻区数量 (neighbor_count): optional int - gnodebid: optional int - cellid: optional int - rsrp: optional float (dBm) 2) Road vectors: - 道路id (road_id): string - 经度 (lon): float - 纬度 (lat): float - seq: optional int ordering per road_id (auto-generated if missing) 3) Base stations: - gnodebid: int - cellid: int - 经度 (lon): float - 纬度 (lat): float - 方位角 (azimuth_deg): optional float degrees Install Use Poetry (or adapt to pip): ```bash cd /Users/reige/Downloads/map poetry install ``` Sample Data - Provided under `data/`: - `data/roads.csv` 两条相交道路(横向 R1、纵向 R2) - `data/stations.csv` 一个站点三扇区(cellid 1/2/3) - `data/obs.csv` 一小段沿 R1 行进并跨越 R2 的观测序列 Run (sample) ```bash poetry run python -m mapmatch.cli \ --obs data/obs.csv \ --roads data/roads.csv \ --stations data/stations.csv \ --out data/corrected.csv \ --radius 60 --maxc 8 --sigma 30 --ta_unit_m 78 \ --speed 13.9 --speed_sigma 7 --json_out ``` Output - corrected CSV: timestamp, road_id, proj_x, proj_y (proj in EPSG set by --epsg, default 3857) - optional JSON: log_likelihood, num_observations Notes - Candidate search uses a simple brute-force over all road geometries. For large networks, replace with STRtree spatial index. - TA meter per unit depends on RAT/vendor; adjust via --ta_unit_m. - Transition can be improved using actual network path length along roads.