POLYCONVERT
原文链接:http://sumo.dlr.de/wiki/POLYCONVERT
这个工具是独立于交通意外,道路周边环境的。由polygons和convert知道进行多边形周边场景变换的。
目的:多边形和POI(感兴趣点)的导入、转换和投影
系统:win、linux
输入:多边形或者点
输出:sumo-shape文件
编程语言:C++
1、特点
l 导入OSM、VISUM、ELarge、xml、ArcView形状文件
l 每种类型的导入设置
l 使用proj.4默认的投影或者通过匹配网络进行投影
l 可以编辑的仿真形状文件(simulation shape files)可以应用于SUMO-GUI、SUMO;
2、用法描述
POLYCONVERT可以从不同类型文件中读取多边形,为了说明是何种数据格式,在命令中表明。因此
polyconvert --visum mynet.net -oconverted.poi.xml
导入的就是visum的文件。
3、命令参数
3.1配置Configuration
(这部分不再赘述)
3.2输入Input
POLYCONVERT对于多种不同的文件格式是有效的。并非所有导入格式都具有类型信息.。When using shape files, for example, all instances of an artifacttype are normally stored in a distinct shape file.【黑人脸,要说啥???】
Option | Description |
Loads SUMO-network FILE as reference to offset and projection | |
--dlr-navteq-poly-files <FILE> | Reads polygons from FILE assuming they're coded in DLR-Navteq (Elmar)-format |
--dlr-navteq-poi-files <FILE> | Reads pois from FILE+ assuming they're coded in DLR-Navteq (Elmar)-format |
--visum-files <FILE> | Reads polygons from FILE assuming it's a Visum-net |
--xml-files <FILE> | Reads pois and shapes from FILE assuming they're coded in XML |
--osm-files <FILE> | Reads pois from FILE+ assuming they're coded in OSM |
--osm.keep-full-type <BOOL> | The type will be made of the key-value - pair; default: false【键值对??】 |
--osm.use-name <BOOL> | The id will be set from the given 'name' attribute; default: false |
--shapefile-prefixes <FILE> | Reads shapes from shapefiles FILE+ |
--shapefile.guess-projection <BOOL> | Guesses the shapefile's projection;default: false |
--shapefile.id-column <STRING> | Defines in which column the id can be found |
--shapefile.use-running-id <BOOL> | A running number will be used as id;default: false |
--shapefile.add-param <BOOL> | Extract all additonal columns as params; default: false |
--shapefile.fill <STRING> | [auto|true|false]. Forces the 'fill' status to the given value. Default 'auto' tries to determine it from the data type |
--type-file <FILE> | Reads types from FILE |
3.3输出Output
所有导入的多边形文件都会被转换成输出文件,除非被丢弃。
Option | Description |
--output-prefix <STRING> | Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time. |
Write generated polygons/pois to FILE;default: polygons.xml【尽量和自己net名字相同】 |
3.4投影Projection
POLYCONVERT另一个有用的地方就是读取形状后的投影。一般,我们希望自己的多边形能和路网文件对其(比如一个水湖,你希望湖的边界紧挨着道路,和显示中的一样)。在这种情况下,应该机上命令—net-file。但是使用不同的投影也是有可能的。在任何情况下,如果坐标读取变化了,那么—use-projection必须用到。【这部分涉及到了地球的时区划分,通用的是WGS84,自行百度,netconvert也是这种投影】
Option | Description |
--simple-projection <BOOL> | Uses a simple method for projection;default: false |
--proj.scale <INT> | Number of places to shift decimal point to right in geo-coordinates;default: 0 |
--proj.utm <BOOL> | Determine the UTM zone (for a universal transversal mercator projection based on the WGS84 ellipsoid); default: false |
--proj.dhdn <BOOL> | Determine the DHDN zone (for a transversal mercator projection based on the bessel ellipsoid, "Gauss-Krueger"); default: false |
--proj <STRING> | Uses STR as proj.4 definition for projection; default: ! |
--proj.inverse <BOOL> | Inverses projection; default: false |
--proj.dhdnutm <BOOL> | Convert from Gauss-Krueger to UTM;default: false |
--proj.plain-geo <BOOL> | Write geo coordinates in output;default: false |
3.5修剪Pruning
有时候,多边形覆盖了整个路网。为了减少数据量,我们能够使用POLYCONVERT去修剪重要的数据或者在给定的边界内修剪。读取的多边形数据在边界外的都被丢弃。
Option | Description |
--prune.in-net <BOOL> | Enables pruning on net boundaries;default: false |
--prune.in-net.offsets <STRING> | Uses STR as offset definition added to the net boundaries; default: 0,0,0,0 |
--prune.boundary <STRING> | Uses STR as pruning boundary |
--prune.keep-list <STRING> | Items in STR will be kept though out of boundary |
--prune.explicit <STRING> | Items with names in STR will be removed |
3.6处理Processing
Option | Description |
--offset.x <FLOAT> | Adds FLOAT to net x-positions;default: 0 |
--offset.y <FLOAT> | Adds FLOAT to net y-positions;default: 0 |
--all-attributes <BOOL> | Imports all attributes as key/value pairs; default: false |
--ignore-errors <BOOL> | Continue on broken input; default:false |
--poi-layer-offset <FLOAT> | Adds FLOAT to the layer value for each poi (i.e. to raise it above polygons);default: 0 |
3.7默认创建项BuildingDefaults
当导入的多边形有些属性没有给出,可以通过下面的命令进行修改。
Option | Description |
--color <STRING> | Sets STR as default color; default:0.2,0.5,1.【我也不知道为啥是这个颜色??】 |
--prefix <STRING> | Sets STR as default prefix |
--type <STRING> | Sets STR as default type; default:unknown |
--fill <BOOL> | Fills polygons by default; default:true |
--layer <FLOAT> | Sets FLOAT as default layer; default:-1 |
--discard <BOOL> | Sets default action to discard;default: false |
3.8报告Report
(这里不再赘述)
4、更多
l 在仿真中使用多边形和POIs
l 使用配置文件