SUMO
Simulation of Urban MObility

- Home
- Download
- Documentation
- Wiki
- Trac
- Blog
- Contact
- SF-Project

# Simulation/Shapes

# Using additional Polygons and POIs within the Simulation

Example of using polygons and POIs; from Traffic Online, area#1

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="<COLOR>" fill="<FILL_OPTION>" layer="<LAYER_NO>" shape="<2D-POSITION>[ <2D-POSITION>]*"/>

These attributes have the following meanings:

Attribute Name | Value Type | Description
--- | --- | ---
id | id (string) | The id (a unique name) of the polygon
color | color | The RGBA color with which the polygon shall be displayed; see <COLOR> for details
shape | 2D position list | The shape of the polygon
fill | bool | An information whether the polygon shall be filled; optional bool, default: false
layer | float | The layer in which the polygon lies; optional
type | string | A typename for the polygon.
imgFile | string | A bitmap to use for rendering this polygon

## 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 | Value Type | Description
--- | --- | ---
id | id (string) | The id (a unique name) of the polygon
color | 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"
x(*) | float | The position of the poi along the x-axis in meters
y(*) | float | The position of the poi along the y-axis in meters
lane(*) | id (string) | The name of the lane the poi is located at; 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
lon(*) | float | The geo-position of the poi along the east-west axis in degrees
lat(*) | float | The geo-position of the poi along the north-south axis in degrees
fill | bool | An information whether the polygon shall be filled; default: false
type | string | A typename for the poi.
layer | float | the layer of the poi for drawing and selecting.
imgFile | string | A bitmap to use for rendering this poi
width | float | width of rendered image in meters
height | float | height of rendered image in meters
angle | float | angle of rendered image in degree

(*) Either x/y or lane/pos or lon/lat must be given

# 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

This page was last modified on 30 April 2013, at 09:00.