Module 5: Working with networks

From ObjectVision

(Difference between revisions)
Jump to: navigation, search
Line 42: Line 42:
// end case parameters
// end case parameters
</pre>  
</pre>  
 +
 +
So this template interprets the first 7 arguments as these units/attributes/parameters. Within this template you can refer to these case parameters as you would refer to any other item. The next container in the template is called ''MakeConnectedRoads'', this piece of script makes sure that only roads that are actually connected to the main netwerk are considered. Since we cannot travel to and from a road that has no connection to the main network. First, the unit ''LinkSet'' breaks up the road arcs into segments by using the operator [[arc2segm]].
Line 49: Line 51:
-
===''[[Module 6: Doing land-use allocation| Go to previous module: Module 6: Doing land-use allocation]]''===
+
===''[[Module 4: Doing basic analyses with grid data| Go to previous module: Module 4: Doing basic analyses with grid data]]''===
===''[[Module 6: Doing land-use allocation| Go to next module: Module 6: Doing land-use allocation]]''===
===''[[Module 6: Doing land-use allocation| Go to next module: Module 6: Doing land-use allocation]]''===

Revision as of 11:17, 31 July 2020

THIS IS WORK IN PROGRESS

Preparing a network

In this module we will use the OpenStreetMap network to calculate travel times between origin and destination point sets. However, first, we must prepare the network since the downloaded OSM is just a set of lines with a typology. We must make sure that the network is connected and, therefore, we connect the origin and destination point sets to the network. For this purpose we use a script that is quite extensive but necessary. In this section you will be guided through this script, in that way you will be able to understand the different steps, and begin to understand the GeoDMS logic behind it.

Before we begin, let's download the network configuration here: POST LINK HERE

For this example we will calculate the traveltime to the nearest intercity train station from each municipality. In the container SourceData we have the trainstation points and the address-weighted-municipality centroid points. These point sets are configured like you have seen in Module 2: Working with different data sources. Next, in the container Analysis/NetworkDist we see org and dest. Those are simply redirections to the origin and destination domain:

unit<uint32> org    := SourceData/Municipality;
unit<uint32> dest   := SourceData/Train_stations;

In this way you can access sub items from SourceData/Municipality by simply referring to, for example, org/geometry. This is not necessary, but makes the code shorter and more importantly it makes the code more versatile and easier to change. When, for example, you change the origin point set to something else. Only the unit org has to change instead of all the references to items in org.

Then there is the container NetwerkSpec, in here the actual network is created, amended and thus prepared for the analysis.

container NetworkSpec :=
	Templates/MakeNetwork(
		  org
		, dest
		, SourceData/Car_network
		, org/WeightedAddressCentroid
		, dest/geometry
		, SourceData/Car_network/line
		, 'car'
	);

This is called a template instantiation. A container is configured which calls the template MakeNetwork, and passes along a set of case parameters. This particular template needs 7 case parameters, what case parameters are needed is configured in the template itself:

Template MakeNetwork
{
	// begin case parameters
	unit<uint32>      orgDomain;
	unit<uint32>      destDomain;
	unit<uint32>      roadDomain;

	attribute<rdc>    orgLocations  (orgDomain);
	attribute<rdc>    destLocations (destDomain);
	attribute<rdc>    roads         (arc, roadDomain);
	parameter<string> network_type;
	// end case parameters

So this template interprets the first 7 arguments as these units/attributes/parameters. Within this template you can refer to these case parameters as you would refer to any other item. The next container in the template is called MakeConnectedRoads, this piece of script makes sure that only roads that are actually connected to the main netwerk are considered. Since we cannot travel to and from a road that has no connection to the main network. First, the unit LinkSet breaks up the road arcs into segments by using the operator arc2segm.


The actual analysis is done in the attribute OD, here the Dijkstra algorithm is specified with a couple of arguments. In this case a string with some settings, followed by 4 arguments separated by a comma. The first three are always required, no matter which settings you use: impedance, F1 and F2. That is the impedance (travel time in seconds) over a link (a connection between two points), and the F1 and F2 are the beginning and endpoint of said link. And in this case there is 'nr'.



Go to previous module: Module 4: Doing basic analyses with grid data

Go to next module: Module 6: Doing land-use allocation

Personal tools