OSM 路网解析 Python 库
1 2 个路网优化库
1.1 Python 库:OSMnx
-
简介
-
将 OSM 路网优化为
NetworkX中的Graph
-
-
建议
-
先使用
osmosis工具从原始 OSM 文件中提取路网标签,即:highway=* -
注意:
OSMnx库遇到缺失点会报错
-
预设路网过滤条件
提取路网的 6 种设置(site)
'drive'
["highway"]
["area"!~"yes"]
["access"!~"private"]
["highway"!~"abandoned|bridleway|bus_guideway|construction|corridor|cycleway|elevator|escalator|footway|path|pedestrian|planned|platform|proposed|raceway|service|steps|track"]
["motor_vehicle"!~"no"]
["motorcar"!~"no"]
["service"!~"alley|driveway|emergency_access|parking|parking_aisle|private"]
% by Osmosis command
--tf accept-ways highway=* ^
--tf reject-ways area=yes ^
--tf reject-ways access=private ^
--tf reject-ways highway=bandoned,bridleway,bus_guideway,construction,corridor,cycleway,elevator,escalator,footway,path,pedestrian,planned,platform,proposed,raceway,service,steps,track ^
--tf reject-ways motor_vehicle=no ^
--tf reject-ways motorcar=no ^
--tf reject-ways service=alley,driveway,emergency_access,parking,parking_aisle,private ^
'drive_service'
["highway"]
["area"!~"yes"]
["access"!~"private"]
["highway"!~"abandoned|bridleway|bus_guideway|construction|corridor|cycleway|elevator|escalator|footway|path|pedestrian|planned|platform|proposed|raceway|steps|track"]
["motor_vehicle"!~"no"]
["motorcar"!~"no"]
["service"!~"emergency_access|parking|parking_aisle|private"]'
'walk'
["highway"]
["area"!~"yes"]
["access"!~"private"]["highway"!~"abandoned|bus_guideway|construction|cycleway|motor|planned|platform|proposed|raceway"]["foot"!~"no"]
["service"!~"private"]',
'bike'
["highway"]
["area"!~"yes"]
["access"!~"private"]
["highway"!~"abandoned|bus_guideway|construction|corridor|elevator|escalator|footway|motor|planned|platform|proposed|raceway|steps"]
["bicycle"!~"no"]
["service"!~"private"]
'all'
["highway"]
["area"!~"yes"]
["access"!~"private"]
["highway"!~"abandoned|construction|planned|platform|proposed|raceway"]
["service"!~"private"]
'all_private'
["highway"]
["area"!~"yes"]
["highway"!~"abandoned|construction|planned|platform|proposed|raceway"]
2 Python 库:OSM2GMNS
OSM2GMNS: github

浙公网安备 33010602011771号