3. Extracting the routes - ScandinavianSection-UCLA/hGIS_ETK GitHub Wiki
Once the stops for each fieldtrip has been converted into a stops shapefiles, a road network can be used in the “Network Analyst” extension of ArcMap to visualize the route Evald Tang Kristensen is likely to have taken. The road network used was downloaded from OpenStreetMap and consist of one point-shapefile with all the junctions and one line-shapefile with all the road segments.
3.1 Creating the network dataset
There are a few steps to be taken to generate a road network from the two shapefiles:
-
Create a “File Geodatabase” by right-clicking on a data folder > “New”> “File Geodatabase”.
-
Create a “Feature Dataset” by right-clicking on the file geodatabase > “New” > “Feature Dataset”. When creating the feature dataset, it is important to choose the projection (projected coordinate system) that you intend to work in. For this project, ETRS 1989 – TM32 is used. This is in accordance with the standard horizontal coordinates projection in Denmark which is discussed in the article “implementation of new reference systems in Denmark” (https://www.fig.net/resources/proceedings/fig_proceedings/fig2006/papers/ts26/ts26_02_bahl_0250.pdf )
A feature dataset is described as “a collection of related feature classes that share a common coordinate system. Feature datasets are used to spatially or thematically integrate related feature classes. Their primary purpose is for organizing related feature classes into a common dataset for building a topology, a network dataset, a terrain dataset, or a geometric network.” (http://webhelp.esri.com/arcgisdesktop/9.2/index.cfm?TopicName=An_overview_of_working_with_feature_datasets )
-
Import the two shapefiles containing the network data by right-clicking on the feature dataset > “Import” > “Feature Class (multiple)”.
-
Once the two shapefiles are in the feature dataset, there are new options when right-clicking on the feature dataset > “New” > “Network Dataset”. There are many options when building the network dataset. Many times the default options are good, and for the road network built for this project these were the only changes made:
The default setting of “establish connectivity only at coincident endpoints of the line feature during the build process” is not going to generate a working network dataset in our case. Changing the connectivity to allowing turns at any vertex is necessary:
Another change, not of the same importance, was choosing the “Display Length Units” to be kilometers, rather than miles:
3.2 Network Analyst
With the Network Dataset generated from the road network, it is possible to generate routes based on the different stops he made:
- Turn on the network analyst extension by clicking on “Customize” in the standard toolbar > “Extensions” > “Network Analyst”.
- Check the “Network Analyst window” in order to have an additional window by the table of contents that will show the network analyst objects in the display window:
- When adding the road network (for us called osm_dk_roads_complete_ND) to the map, the road network is automatically added as the file the network analyst will use to extract the routes:
- By clicking on “Network Analyst” in the toolbar above there is an option to add a “new route”. If we do so, an empty network analyst object is added to the network analyst window, with corresponding description in the table of content window:
- If the stops-shapefile we are interested in to generate a route from is added to the map, it is easy to load those locations to the stops in the network analyst. This is an option when right-clicking on “Stops(0)” (see highlighted in blue above) > “Load Locations”
-
In the above example, the stops for fieldtrip 036 are loaded to the network analyst. To keep the order of the stops, the stops are sorted (“Sort Filed”) based on the field “Sequence” from the “FT_036_stops” attribute table. The name (“Name” under “Property”) of the individual stops is based on the “Place” field, meaning that the stops will be named based on the location he stops at.
-
Once the stops are loaded, they will appear on the map in this way:
- In order to get the route he took, based on the road network, the route needs to be “solved” ( in the Network Analyst toolbar).
For our project, the result from each of these field tips is two shapefiles, one for the route which is exported after step eight in the network analyst, and one is the stops shapefile that is the result after geocoding the excel files. There is also one layer-file for each field trips, and it is important to notice that in order to display the layer file, the network dataset used to generate the layer must be activated.
-
Right-click on the layer that needs to have the network dataset activated > “Properties” > “Source” > “Set Network Dataset” > “osm_dk_roads_complete” (in the case of this project)
-
To display the names of the stops (“place” attribute field in our stops shapefiles), right-click on “Stops(X)” in the Network Analyst Window > “Properties” > “Display” > set “Field” to be “Place”.
3.3 Additions to the road network The road network generated at first was based only on the two shapefiles with junctions and lines representing the roads downloaded from OpenStreetMaps. When calculating the route taken, this was sufficient for most of the fieldtrips. However, when going over the routes a second time we wanted to include shortcuts he took: he sometimes indicates in his journals that he walked across fields, or chose to walk across swamps etc. Also, on quite a few occasions he was taking the ferry. Ferry routes are not included as possible travel routes in the network dataset, since we have based it only on the road network. The solution was to edit the road network to include the shortcuts and the ferry routes:
-
Make a copy of the road shapefile and the junction shapefile to keep the original: right-clicking on the shapefile > “Export” > “Data” and give the new shapefile an appropriate name.
-
Add the “Editor” toolbar to ArcMap. “Customize” (in the standard toolbar) > “Toolbars” > check “Editor”.
-
“Editor” toolbar > “Start Editing” > Choose the road network (“dk_osm_roads_1.shp” for this project)
-
“Editor” toolbar > “Snapping” > check “Snapping Toolbar” > turn snapping on. This will make sure that the new features we create “snaps”, or connects, to the original shapefile.
-
“Editor” toolbar > “Edition Windows” > “Create Features”
- The window will appear with the options to choose what shapefile we want to create a feature for. Choose the road network by simply clicking on it. The second option in the “Create Features” window is the “Constriction Tools”. Choose “Line” by simply clicking on it.
-
Add the line by clicking at the start point on the map. To make the line more detailed, it can be split up into segments by clicking once for each part of the segment. When the final point of the line is reached, click twice. The line will automatically “snap” to the closest junction in the original road network.
-
The newly created line will be selected, which is convenient since we can easily find the new feature’s corresponding attribute data in the attribute table. It is a good idea to add a field that specifies what this new feature is. In the case of “dk_osm_roads_1.shp” there is already a field called “type”. “Ferry_added” or “Shortcut_added” were simply typed in the road for the specific feature.
-
In terms of the junction shapefile, junctions only needed to be added for a couple of the new lines that were added: when the added line went between two junctions (that they were snapped to) there are already “turning points”. However, when a line was added and there was no junction at the end of it, there needed to be a junction added. This was for instance the case for the ferry line to Malmo – there are no road network for Sweden included, hence the line did not end up at an already established junction.
-
Once all the edits are completed, it can be used to create an updated network dataset (see “3.1 creating the network dataset”). Only the fieldtrips that needed the edited features to make the route shapefile more accurate (had a shortcut or a ferry route) had to be recreated with the updated network dataset.