Show/Hide Toolbars

MPMileage for Maptitude

Navigation: Examples

Example: Using MPMileage with coordinates in a Maptitude Data View

Scroll Prev Top Next More

This example shows you how to use MPMileage to compute the mileages between a series of coordinates stored in a Maptitude Data View. A "data view" is Maptitude's name for a database table. You may derive your MPMileage data view from data you already have in Maptitude, or possibly from a subset (selection set) of the demographic data supplied by Caliper.


This particular example uses data imported from Microsoft Access. This is because it is a convenient way to transfer example data.


This example also uses coordinates. Coordinates can also be used with the other data sources supported by MPMileage.


In order to follow this example you will need Caliper Maptitude (2014 Build 2835 or later) and Maptitude's US Country Pack. You could use other country packs, but you would need to change the coordinates to be within the country pack's road network.


The example uses a data view created from the coord_dataview.accdb database found in the MPMileage for Maptitude samples file:


The database file coord_dataview contains one table called routes. Start Maptitude with a US Map. Then import coord_dataview into a data view by selecting File->Open on the Maptitude menu. Select coord_dataview, and Maptitude will present you with the Open MS Access Table dialog box:




There is only one table (routes) to select. Select ID as the unique field. Maptitude requires a unique identifier, and the Access Primary Key is perfect for this. Then press OK and Maptitude will load the database into a new data view. This will look like this:




Notice that the start and end locations are specified by coordinates (src_longitude, src_latitude and dest_longitude, dest_latitude). These are decimal degrees. The Maptitude input option will also accept Maptitude-style integer millions of a degree. MPMileage will automatically interpret the data view coordinates as decimal degrees or millionths of a degree according to whether they are floating point, or integer respectively. Note that all other data sources must use decimal degrees.


Start MPMileage and press the Change button in the Database box to set the database (data view) parameters. These are on the Database Parameters dialog box:




Select the Data Source Type to be Maptitude Data View. This will disable the Data Source setting because Maptitude is already open. The Table drop-down box will list the available data views. Select the routes data view that we just imported. Our locations are Coordinates so select this, and press the Set Columns button to set the location data fields with the Input Locations dialog box:




Here we set the coordinate data fields from the data view. If we had selected street addresses or named locations, then these would appear instead. Note that the Maptitude data view option does not require a primary key. This is because all Maptitude data views have an ID field defined as a primary key.


Press OK to return to the Database Parameters dialog box, and set the Output Columns. These store the calculated mileage, travel time, and estimated cost results. We also recommend that you set the Errors column. Finally set the Row Selection to all rows and press OK to save the database settings.


Set the Routing Parameters as required. Here we have chosen shortest routes and travel times are in minutes:




Press Start when all the parameters have been set. After the results have been recomputed, you may need to refresh the data view window to see the results/ Do this by selecting Window->Refresh in Maptitude. Here are the results: