SimulationShapeFiles
Contents |
Using additional Polygons and POIs within the Simulation
Since version 0.9.4, it is possible to include geometry files into the additional files section of a simulation configuration which contain definition of polygons or points of interest. These shapes are currently meant to improve a simulation's appearence and to allow an easier debugging. No special interaction with them is implemented, yet.
Both polygons and points of interest may be located within a "layer". Shapes with lowest layer values are below those with a higher layer number. The network itself is drawn as layer 0. An additional file may contain definitions for both points of interest and polygons.
Geometrical objects may either be defined "by hand" or imported using POLYCONVERT. A valid geometry-file can be given to SUMO as one of the additional files (option: --additional-files <FILE>). For usage within SUMO-GUI, you have to add it to the list of additional files to load within the used SUMO configuration file.
Definitions
The geometrical objects (POIs, polygons) are stored one by one into an "additional file". Currently, the root element may arbitary.
Polygon Definitions
A polygon is defined as following: <poly id="<POLYGON_ID>" type="<TYPENAME>" color="<RED>,<GREEN>,<BLUE>" fill="<FILL_OPTION>" layer="<LAYER_NO>" shape="<POINT> [<POINT>]+"/>
These attributes have the following meanings:
| Attribute Name | Mandatory | Value Type | Description |
|---|---|---|---|
| id | y | id (string) | The id (a unique name) of the polygon |
| type | string | A typename for the polygon. This value has no meaning | |
| color | y | color | The color with which the polygon shall be displayed; <RED>, <GREEN>, and <BLUE> must be floating point numbers between 0 and 1. They are devided using a ',' (no space); mandatory |
| fill | bool | An information whether the polygon shall be filled; optional bool, default: false | |
| layer | int | The number of the layer in which the polygon lies; optional int, default: -1 | |
| shape | 2D position list | The shape of the polygon; mandatory |
POI (Point of interest) Definitions
A point-of-interest is defined as following: <poi id="<POLYGON_ID>" type="<TYPENAME>" color="<RED>,<GREEN>,<BLUE>" layer="<LAYER_NO>" [(x="<X_POS>" y="<Y_POS>") | (lane="<LANE_ID>" pos="<LANE_POS>")]/>
It means that the position a point-of-interest is located at may be given either using explicite x/y-coordinates or a lane name and a position on this lane. So, the attributes have the following meanings:
| Attribute Name | Mandatory | Value Type | Description |
|---|---|---|---|
| id | y | id (string) | The id (a unique name) of the polygon |
| type | string | A typename for the polygon. This value has no meaning | |
| color | y | color | The color with which the poi shall be displayed; <RED>, <GREEN>, and <BLUE> must be floating point numbers between 0 and 1. They are devided using a ',' (no space); optional, default "1,0,0" |
| fill | bool | An information whether the polygon shall be filled; optional bool, default: false | |
| x | float | The position of the poi along the x-axis in meters; float | |
| y | float | The position of the poi along the y-axis in meters; float | |
| lane | id (string) | The name of the lane the poi is located at; string, the lane must be a part of the loaded network | |
| pos | float | The position on the named lane at which the poi is located at |
See Also
- See the description of POLYCONVERT in order to know how polygons/POIs can be imported from other sources
- Developer/Implementation Notes/Drawing in sumo-gui describes how SUMO-GUI renders loaded structures (for developers)
- You can read variables of loaded PoIs and read variables of loaded polygons via TraCI
