Converting GIS shapefile to
a road network
If you are creating a road traffic model of some existing road network,
you can go without drawing all the roads and intersections
manually using road space markup shapes.
Instead of this, you can simply find the GIS shapefile with the data on
the existing roads, and convert this shapefile data to AnyLogic
road space markup shapes. The road network
will be drawn automatically, and you will have just to make few
adjustments (change the road
width, number of forward and backward lanes of
individual roads, etc.).
To convert GIS
shapefile data to AnyLogic road network shapes
- Drag the GIS
section of the
the graphical editor. Note that you can add GIS map only on the diagram
that does not contain any road space makup shapes yet.
- You can use your own files, or
find them on the web. We will demonstrate the feature by downloading
and converting Toulouse shapefile from http://www.geofabrik.de/data/shapefiles.html. Download
the data files as a .zip
archive and extract them to some folder.
- Expand the Shapefiles
of the GIS map's properties. Set this GIS map to use
downloaded shapefile. Add a shapefile (with file extension
clicking the button.
- This opens the Open
dialog box. Browse to the file
you have downloaded, select it and click Open. The GIS map
will show the file data, and the shapefiles will be
copied to the model folder.
- To get the space markup elements with meaningful names (and
not just randomly named like road145, road146), you
should specify what column of the shapefile contains the names of the
items. In the Shapefile
section of GIS map properties, specify the index of the shapefile's
name column in the Name
column index field. To know the index of the name
column, use third-party shapefile editors.
- Zoom in to the required part of the road
network. It is very important to avoid converting
numerous roads that you really do not need in your model. Zoom in
the GIS map until you see all the roads you need to consider
in your model.
- Right-click the GIS map and choose Convert Shapefile to Space Markup
from the context menu.
- In the Convert
Shapefile to Space Markup dialog box, select Roads in the Convert to list.
Configure other options, and finally click OK.
- Confirm the action in next dialog boxes.
The conversion may take a relatively long time. Finally the
will be substituted with the image. On top of this image you will see
the road network composed
of AnyLogic's roads and intersections (see the
Note: All drawn roads are
Each road has two forward lanes and two backward lanes. You
to modify the road attributes by yourself. Data on road speed limits
etc. is neither read nor used by AnyLogic's road network.