λμ©λ λͺ¨λΉλ¦¬ν° λ°μ΄ν°μ© λ§΅λ§€μΉ μμ§: μ°μ μ΄μ μκ° κΈ°λ° μ‘ΈμμΌν° ν¨κ³Όμ± λΆμ
μ΄ μ μ₯μλ νκ΅******κ³΅λ¨ μλ’° νμ νλ¬Όμ°¨ μ°μ μ΄μ λ°μ΄ν°λ₯Ό μ΄μ©ν΄ μ‘ΈμμΌν° λ°°μΉμ ν¨κ³Όλ₯Ό μ λμ μΌλ‘ λΆμν μ°κ΅¬ κ΄λ ¨ λ§΅λ§€μΉ μ½λμ λλ€. λ³Έ λ ν¬μ§ν 리λ λκ·λͺ¨ GPS κΆ€μ λ°μ΄ν°λ₯Ό νμ€ λ Έλ-λ§ν¬ 체κ³μ μ ν©νλ μ€λ¬΄ μ§ν₯μ λ§΅λ§€μΉ(Map-Matching) νμ΄νλΌμΈμ ꡬνν νλ‘μ νΈμ λλ€. 곡곡 MaaS, DRT(μμμλ΅ν κ΅ν΅), κ΅ν΅ λΆμ νλ«νΌμ μ μ© κ°λ₯ν νμ₯ν κ³΅κ° λ°μ΄ν° μ²λ¦¬ ꡬ쑰λ₯Ό λͺ©νλ‘ μ€κ³λμμ΅λλ€. This repository contains a data-processing and map-matching pipeline for evaluating rest-area effectiveness using truck continuous-driving records.
- λκ·λͺ¨ κΆ€μ λ°μ΄ν° μ²λ¦¬ νμ΄νλΌμΈ μ€κ³
- κ³΅κ° μΈλ±μ± κΈ°λ° μ±λ₯ μ΅μ ν ꡬ쑰
- κ΅ν΅κ³΅ν μ μ½ μ‘°κ±΄μ λ°μν λ§€μΉ μκ³ λ¦¬μ¦
- PostGIS μ μ© κ°λ₯ μν€ν μ²
- λͺ¨λΉλ¦¬ν° μλΉμ€ μ΄μ μ΅μ ν μ§μ
- DRT λ°°μ°¨ λ° λ Έμ λΆμ κΈ°λ° κ΅¬μΆ
- ν΅ν ν¨ν΄(O/D) λΆμμ ν΅ν μμ λ°μ§ μ§μ λμΆ
- κ΅ν΅ μμ λ° μν κ΅¬κ° λΆμ κΈ°λ° λ°μ΄ν° μ ν©
- μ΄μμΉ μ κ±°
- μλ/λ°©ν₯ κΈ°λ° νν°λ§
- κΆ€μ μ μ
- R-tree λλ μ μ¬ κ΅¬μ‘° νμ©
- ν보 λ§ν¬ νμ μ΅μ ν
- 거리 κΈ°λ° ν보 μ μ
- λ°©ν₯μ± κ²μ¦
- μ°μμ± κΈ°λ° λ³΄μ
- O/D ν¨ν΄ μΆμΆ
- QGIS μ°κ³ μΆλ ₯
- λ§ν¬λ³ ν΅νλ μ§κ³
- μμ GPS λ°μ΄ν° μ λ ₯
- λ°μ΄ν° μ μ λ° μ μ²λ¦¬
- κ³΅κ° μΈλ±μ€ ꡬμΆ
- λ§ν¬ λ§€μΉ μν
- κ²μ¦ λ° κ²°κ³Ό μΆλ ₯
λ³Έ νλ‘μ νΈλ λ€μ μλμ μ¦λͺ ν©λλ€:
- λκ·λͺ¨ λͺ¨λΉλ¦¬ν° λ°μ΄ν° μ²λ¦¬ λ₯λ ₯
- μ¬ν κ°λ₯ν κ³΅κ° λ°μ΄ν° νμ΄νλΌμΈ μ€κ³
- κ΅ν΅κ³΅ν κΈ°λ° μκ³ λ¦¬μ¦ μ€κ³ λ₯λ ₯
- MaaS λ° DRT μ΄μ μμ¬κ²°μ μ§μ κ°λ₯μ±
μ‘ΈμμΌν°μ λ°°μΉμ μ΄μ©μ±μ΄ μ°μ μ΄μ μκ° μ΄κ³Όλ₯Ό μ€μ΄λ λ° λ―ΈμΉλ ν¨κ³Όλ₯Ό DTG(κΈ°λ‘κ³) λ°μ΄ν°λ₯Ό κΈ°λ°μΌλ‘ νκ°ν©λλ€. This project evaluates whether rest-area infrastructure and placement can reduce long continuous driving time using truck DTG (digital tachograph) data.
- λμ λλ‘λ§: μ λΌλΆλ μΌλ°κ΅λ νμ€λ§ν¬
- Analysis area: Road links of national highways in Jeollabuk-do.
- κΈ°κ°: 2025-03-01 ~ 2025-08-31 (6κ°μ)
- Period: 2025-03 to 2025-08 (6 months).
- λ°μ΄ν°: μ°¨λID, GPS(X/Y), λ μ§Β·μκ°, μ°¨λμμ±(V_TYPE) λ± DTG νλ
- Data source: Truck DTG records containing vehicle id, GPS coordinates, date/time, and vehicle metadata.
date,time,carid,V_TYPE,lon,lat(λλGPSX,GPSY)λ₯Ό μ κ·νν©λλ€.- Standardize raw fields into normalized columns:
date,time,carid,V_TYPE,lon,lat(orGPSX,GPSY).
- μ°¨λλ³λ‘ μ°μ μ΄μ μκ° κ΅¬κ°μ μΆμΆνκ³ , μ¬ν(trip) λ¨μλ‘ λΆν ν©λλ€.
- Extract continuous-driving segments per vehicle and segment them into trips.
- λμΌ μ°¨λ(carid) κΈ°μ€μΌλ‘ μκ°Β·κ±°λ¦¬ κΈ°μ€ EDA λ° trip μ ν©μ±μ μ κ²ν©λλ€.
- Validate trip consistency by temporal sequence and distance consistency per vehicle.
- κ° tripμ μνμ λ€μμ λλ‘ λ§ν¬ λ§€μΉμ μννκ³ , 2.5μκ° μκ³κ° κΈ°μ€ κ΅¬κ°μ λΆλ₯ν©λλ€.
- Match trip points to road network links and classify segments by continuous-driving duration thresholds.
- μλ 쑰건(μ°¨λ κΈ°μ€ 20~250 km/h νν°λ§ λ±)μΌλ‘ μ€μ°¨λ₯Ό μ μ ν©λλ€.
- Filter outliers with speed rules (e.g., valid speed range for trucks).
- !!To make it fast!!Refactored to a Class-based structure to encapsulate the Spatial Index (STRtree), reducing redundant index-building time and improving memory scope management.
- κΈ΄ μ°μ μ΄μ (2h+, 2.5h+) λΉλ, λ§ν¬ λ¨μ κ΅ν΅λ, VLM, λΉμ¨ λ±μ μ°μΆν©λλ€.
- Compute long-duration metrics (>, 2h and >2.5h), link-level traffic, VLM, and ratio metrics.
- μ μ²λ¦¬ κ²°κ³Όμ μκ³μΉ κ²°κ³Όλ₯Ό μ§λ κΈ°λ° plotμΌλ‘ μ μ₯ν©λλ€.
- Save map/line visualizations as image outputs for inspection.
- μ 체 μ΅λ μ°¨λν΅νλ: 413,661λ/λ§ν¬ (νκ· 24,513λ)
- Max vehicle count per link: 413,661 (average 24,513).
- 2μκ° μ΄κ³Ό ꡬκ°: μ΅λ 29,586λ(λ§ν¬ ν΅νλμ 59.7%), νκ· 2,233λ(11.5%)
- Continuous driving >2h: max 29,586 trucks (59.7% of link traffic), avg 2,233 trucks (11.5%).
- 2.5μκ° μ΄κ³Ό ꡬκ°: μ΅λ 11,691λ(λ§ν¬ ν΅νλμ 53.5%), νκ· 1,100λ(7.16%)
- Continuous driving >2.5h: max 11,691 trucks (53.5%), avg 1,100 trucks (7.16%).
μλ μ΄λ―Έμ§λ λ°μ΄ν° ꡬμ±, μνλ§ κ΅¬κ°, λ§€μΉΒ·μκ°ν κ²°κ³Όμ μ€κ° μ κ² μ°μΆλ¬Όμ λλ€. The figures below show intermediate data validation, sampled trajectory windows, and map matching outputs.
MapmatchingTrajectorytoLinks/
βββ processingDTGJB.py
βββ processingDTGJB2.py
βββ untitled1.py
βββ untitled2.py
βββ q3.py
βββ q4.py
βββ plot5.py
βββ plot6.py
βββ scripts/
β βββ cli.py
β βββ run_dtg_pipeline.py
β βββ run_dtg_pipeline_alt.py
β βββ run_q3.py
β βββ run_q4.py
β βββ plot_dtg_links.py
β βββ plot_dtg_links_alt.py
βββ JBROI.*
βββ JBROI2.*
βββ roi_box.gpkg
βββ bfg-1.15.0.jar
βββ data/
βββ tools/
processingDTGJB.pyβ ν΅μ¬ μ μ²λ¦¬ μ νΈλ¦¬ν° / Core processing utilities.processingDTGJB2.pyβprocessingDTGJB.pyμ 보μ/λ체 λͺ¨λ / Companion/alternative variant.untitled2.pyβ DTG νμ΄νλΌμΈ κΈ°λ³Έ μ€νκΈ° / Primary DTG pipeline entry.untitled1.pyβ DTG νμ΄νλΌμΈ 보쑰/λ³ν μ€νκΈ° / Secondary/alternate DTG pipeline entry.q3.pyβ μ§κ³/μ μ± μ§ν μ°μΆκΈ° / Aggregation and post-processing script.q4.pyβ μ§κ³ νμ₯ μ€ν μ€ν¬λ¦½νΈ / Extended aggregation/analysis script.plot5.pyβ μ§λ κΈ°λ° μκ°ν(1) / Map visualization routine #1.plot6.pyβ μ§λ κΈ°λ° μκ°ν(2) / Map visualization routine #2.JBROI*,JBROI2*,roi_box.gpkgβ λΆμ μμ(ROI) μ μ νμΌ / ROI geometry inputs.bfg-1.15.0.jarβ Git νμ€ν 리 μ 리/μ΄λ ₯ μ 리 보쑰 λꡬ / Git history maintenance helper.
scripts/cli.pyβ ν΅ν© μ€ν μΈν°νμ΄μ€ / Unified CLI dispatcher.run_dtg_pipeline.pyβuntitled2.pyλνΌ / Wrapper tountitled2.py.run_dtg_pipeline_alt.pyβuntitled1.pyλνΌ / Wrapper tountitled1.py.run_q3.pyβq3.pyλνΌ / Wrapper toq3.py.run_q4.pyβq4.pyλνΌ / Wrapper toq4.py.plot_dtg_links.pyβplot5.pyλνΌ / Wrapper toplot5.py.plot_dtg_links_alt.pyβplot6.pyλνΌ / Wrapper toplot6.py.
python scripts/cli.py pipelinepython scripts/cli.py pipeline-altpython scripts/cli.py q3python scripts/cli.py q4python scripts/cli.py plotpython scripts/cli.py plot-alt
python untitled2.pypython untitled1.pypython q3.pypython q4.pypython plot5.pypython plot6.py
pip install -r requirements.txt- νκ²½λ³ λ°μ΄ν° κ²½λ‘(
/data1/...λ±)μ DB μ°κ²° μ€μ μ μ€μ κ²½λ‘λ‘ μμ - λμ©λ λ°μ΄ν° νμΌμ Git μΆμ μμ μ μΈνκ³ μ€ν μ κ²½λ‘λ§ λ§μΆ€
μ΄λ―Έμ§ μ°Έμ‘°λ λͺ¨λ μλ κ²½λ‘μ΄λ©°, κ°μ ν΄λ λ΄ νμΌμ΄ μ‘΄μ¬νλ©΄ GitHub λ λλ§ μ λ¬Έμ μμ΅λλ€. All image references are relative; if the files exist in the repository root, they render correctly on GitHub.
final_merged_gdf2μκ°μ΄μ_λ°©ν₯μΆκ°251212.xlsxμ sheet1 μμ κ²°κ³Όλ₯Ό geometryλ μμ/μ’
λ£ μ’νλ§ μΆμ½ν΄ νμν©λλ€.
Shown below is a summary from final_merged_gdf2μκ°μ΄μ_λ°©ν₯μΆκ°251212.xlsx sheet1; geometry is shortened to start/end only.
| index | LINK_ID | geometry | vehicle_count 2μκ° μ΄μ μ°μμ£Όνμ°¨λ(λμ) | vehicle_count κΈ°μ€ μμ | VLM κ΅ν΅λ | ratio 2μκ° μ΄μ μ°μμ£Όνμ°¨λ λΉμ¨ | direction μ£Όνλ°©ν₯ |
|---|---|---|---|---|---|---|---|
| 1484 | 3070020302 | LINESTRING (297841.96527919295 3980043.9288296015, 298782.834076233 3979939.0186604057) | 29551 | 1 | 242292 | 12.20% | λ |
| 480 | 3070019300 | LINESTRING (294118.9405783998 3980121.988229847, 296611.921601332 3980047.724757389) | 29185 | 2 | 238253 | 12.25% | λ |
| 1365 | 3110050400 | LINESTRING (310858.1111337207 3972940.4928400507, 311296.56675443635 3973201.4749663696) | 29110 | 3 | 268341 | 10.85% | λ |
| 1939 | 3070020402 | LINESTRING (298787.34749683784 3979950.1366384136, 297842.3620516729 3980055.924890448) | 29096 | 4 | 274155 | 10.61% | μ |
| 1028 | 3070008801 | LINESTRING (306191.9178838817 3977570.2769408426, 303503.7619772779 3979011.2397499904) | 28358 | 5 | 316221 | 8.97% | μ |
| 2969 | 3070022800 | LINESTRING (297586.40745840943 3980116.226023371, 297225.1758749983 3980172.602097907) | 28303 | 6 | 265631 | 10.66% | μ |
| 475 | 3070243400 | LINESTRING (296611.921601332 3980047.724757389, 296918.199608747 3980103.997398246) | 28266 | 7 | 226935 | 12.46% | λ |
| 1562 | 3070022700 | LINESTRING (297226.72092121094 3980160.699836365, 297582.9809467876 3980104.722794104) | 28257 | 8 | 229146 | 12.33% | λ |
| 364 | 3070020301 | LINESTRING (297582.9809467876 3980104.722794104, 297841.96527919295 3980043.9288296015) | 28254 | 9 | 228483 | 12.37% | λ |
| 3173 | 3070014700 | LINESTRING (299237.5559036793 3979776.7882304047, 299438.2845675852 3979723.68819917) | 27702 | 10 | 223410 | 12.40% | λ |
project_paths.pyλ₯Ό ν΅ν΄data/μ°μ νμμ μ μ©νμ΅λλ€.scripts/μ λ£¨νΈ μ€ν μ€ν¬λ¦½νΈμ μν μ λΆλ¦¬ν΄ μ μ§λ³΄μμ±μ λμμ΅λλ€.argparseκΈ°λ° μ΅μ μ 리λ₯Ό ν΅ν΄ μ€ν λͺ λ Ήμ μΌκ΄μ±μ ν보νμ΅λλ€.- Large-data assets should remain under
data/ortools/and be excluded from Git history when possible.
This work was supported by the Korea Transportation Safety government agency under the Ministry of Land, Infrastructure and Transport of the Republic of Korea.



