从osm导入水路路网(适用于内河交通流仿真)
从OpenStreetMap中导出导出地图文件:
将osm文件中的水路提取出来形成net文件:
netconvert --osm-files water.osm --type-files water.typ.xml -o water.net.xml
其中,typ文件内容如下(可根据要求修改航道宽度):
<types xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://sumo.dlr.de/xsd/types_file.xsd">
<type id="waterway.river" width="7" numLanes="1" speed="10" priority="1" oneway="false" allow="ship"/>
<type id="waterway.canal" width="5" numLanes="1" speed="10" priority="1" oneway="false" allow="ship"/>
<type id="route.ferry" width="5" numLanes="1" speed="10" priority="2" oneway="false" allow="ship"/>
</types>
提取后netedit中效果如图(netedit中可导出rou文件):
再生成地形文件:
polyconvert --net-file water.net.xml --osm-files water.osm -o water.poly.xml
在sumo-gui中打开simulation→water.sumo.cfg效果如图(sumocfg文件直接按模板编写):