Extract INET obstacles from an OSM map
Description
The purpose of obstacles in INET framework is to simulate real world objects such as walls, trees, buildings and hills. More specifically, they are used to absorb and reflect radio waves, reducing signal quality and decreasing the chance of a successful reception. Using this script, you are able to extract the obstacles (buildings, pavements…) of any OSM map and then use them on the INET framework.
In case you make use of the veins_inet project, you can set the margin variable too. Differently, please ignore this parameter and set it to 0.
Usage
Extract INET obstacles from an OSM using the default margin of the veins_inet project.
./ConvertOsmToInetObstacles.sh <osm-net-filename> <osm-poly-filename> <destination-filename>
Extract the INET obstacles from an OSM map using a custom margin.
./ConvertOsmToInetObstacles.sh <osm-net-filename> <osm-poly-filename> <destination-filename> <margin>
Example
In this example, we will download an OSM map using the osmWebWizard.py tool which comes along with the SUMO road traffic simulator and then we will extract the INET obstacles.
Download the map
Run the osmWebWizard.py.
Select the area that you want to download.
Press the Generate Scenario button.
Find the downloaded OSM map to the same folder from which you have run the osmWebWizard.py.
Extract the INET obstacles from the map
Open the terminal.
Navigate to the folder which contains the ConvertOsmToInetObstacles.sh script.
Run the following command.
./ConvertOsmToInetObstacles.sh path/to/the/downloaded/map/osm.net.xml path/to/the/downloaded/map/osm.poly.xml obstacles.xml
In the current folder you will find the obstacles.xml file, which you can use to the INET project.