-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmicro.qmd
More file actions
127 lines (75 loc) · 3.82 KB
/
Copy pathmicro.qmd
File metadata and controls
127 lines (75 loc) · 3.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
---
title: "Micro Case Study"
author: "R Félix"
---
You may use an intersection file already prepared to be used with VISSIM, like this one:

This file is available at [Fenix](https://fenix.tecnico.ulisboa.pt/downloadFile/845043405615934/GagoCoutinho_moved.zip), for registered students.
::: {.callout-important appearance="simple"}
Watch out that the CRS of this file may not be adjusted to the basemap!
Also, some adjustments to the network (such as the **connectors**) may be needed.
:::
How did this file was converted from OpenStreetMap?
🧐
## From OpenStreetMap to VISSIM
### Requirements
This will require:
- VISSIM [installed](vissim.qmd#vissim-install) with an active license
- [Python](https://www.python.org/downloads/) 3.x, and the following packages
- [win32com](https://pypi.org/project/pywin32/)
- [gdal](https://gdal.org/en/latest/api/python_bindings.html)
- [Microsoft Visual C++ build tools](https://stackoverflow.com/a/54136652)
- Optional: [OSGeo4W](https://trac.osgeo.org/osgeo4w/)[^1]
[^1]: This installation already comes with all the required packages.
### OpenStreetMap
Go to OpenStreetMap and zoom into your area.\
Select Export and save the `map.osm` file.

You don't need to open that file now.
### OSM2VISSIM tool
1. Go to the [OSM2VISSIM tool](https://github.com/bmetrafficlab/OSM2VISSIM/) Github page, and download this `OSM2VISSIM_v0.1.py` [file](https://github.com/bmetrafficlab/OSM2VISSIM/blob/main/OSM2VISSIM%20tool/OSM2VISSIM_v0.1.py).
{width="193"}
2. Create a folder (wherever you want) and put there this `.py` file and the `.osm` file exported before. Now **copy your folder path**!

3. If you have OSGeo4W installed[^2], open the shell. It will look like this:
[^2]: You may do everything on the cmd (command line prompt terminal), but some errors may be output.

4. Navigate to your created folder, using `cd yourfolderpath`
5. Now, run `python OSM2VISSIM_v0.1.py`

6. This will open a dialogue window where you are supposed to type your `.osm` file name.\
Mine is `gago`

7. Press Set.
::: {.callout-note appearance="simple"}
Don't worry!
Things are happening even if you don't notice.
Just be patient and wait.
:::
This will create a new file, and open VISSIM automatically.
Note: If you go to the Network tab and don't see anything, even after clicking on zoom to network button, close VISSIM, and close the Shell.
This happened to me every first time.
8. Repeat again the steps from 1 to 7.
This will open VISSIM automatically and now the shell will show things happening:
\
Wait until VISSIM it closes automatically - don't click anything.
9. You may now close the OSGeo4W shell.
A few more files were created now:

### At VISSIM
Open the file `name.inpx` and close the Start Page.
At Network Editor panel, click Show entire network:

As you may note, your network is not exactly in place, when comparing to a basemap.
🥴

To adjust this, you may either move the basemap or the network.
First, with the distance tool, measure the distance of one reference point of the network to where it should be placed, in both X and Y directions.

Then Edit ⟶ Move Network

Repeat the process until the network intersection is centred with the intersection in the basemap.
Save your network file!
🎉
This process resulted in the abovementioned file.
No go on and **adjust** the details that require some attention.