You are on page 1of 84

Geocoding & Matrices in TransCAD

Murtaza Haider
murtaza.haider@ryerson.ca Tel: 416.979.5000, ext. 2480

Geocoding and Spatial Analysis Goal: Understand how to:


Locate your data on a map Merge areas to form districts such as sales territories or administrative regions Create bands to see areas of influence Overlay areas to extract data from other areas Measure distance and area

Basics: Pin Mapping Definition: A process of creating a new geographic file containing a single geographic point for each record in a database or spreadsheet. Used to locate customers, prospects, facility locations, and other features. Geocoding and address matching are other terms that are used.

Example: Pin Mapping

Pin Mapping: Locating by Address #1 Choose File-Open or click on the toolbar.

Open the dBASE file CUSTOMER.DBF in TCW\TUTORIAL. TransCAD displays a dataview of 45 customers in Connecticut. Click on the toolbar, or choose Tools-Locate by Address, and click OK. TransCAD displays the Save As dialog box.

Locating by Address #2 Enter MYCUSTOM as the geographic file name and click OK. TransCAD locates most of the addresses and shows the pins in a new map. Click OK after reading the dialog box with the results of the process.

Locating the Unmatched Records Make sure the dataview is the current window, and choose Unmatched Records from the drop-down list in the toolbar. Click on the toolbar, or choose Tools-Locate by Address, and click Options. Check Try only nearby ZIP Codes, then click OK twice. TransCAD finds most of the unmatched records.

Locating by ZIP Code Make sure the dataview is the current window, and choose Unmatched Records from the drop-down list in the toolbar. Choose Tools-Locate by ZIP Code and click OK. TransCAD locates the last records by ZIP Code. Choose File-Save Workspace, enter MYPROJ1.WRK and click OK.

In Depth: Pin Mapping You can locate records four ways:


By address, in the U.S. By ZIP Code, in the U.S. By value, using any matching field in a layer such as state abbreviation By coordinate, if the table already has longitude/latitude or XY coordinates

Ways That Points Are Chosen By Coordinate: at that point By Address: offset from the matching side of the street segment, at a proportional distance down the segment By ZIP Code or Value:
At the center of matching point, line or area Scattered within area Scattered around center of point, line or area

Locating Records by Value


Choose Tools-Locate by Value for the Locate by Value dialog box:

Locating Records by Value: Options Click Options for the Location Options dialog box:

Basics: District Definition: In TransCAD, an area that is made up of several smaller areas all joined together.

Example: District

Census Tracts Shaded by District

Districts Created from Census Tracts

Quick Start: Getting Ready to Merge by Value Choose File-Close All, then choose File-Open or click on the toolbar. Open the geographic file DETROIT.CDF in TCW\TUTORIAL. TransCAD displays a map of TAZs in the Detroit region. Choose Tools-Merge by Value or click toolbar. on the

Merging by Value Choose [CO#] from the Based on drop-down list. Enter County in the Create Layer edit box. Check Compute Attributes and click OK. Enter MYDIST as the file name and click OK. TransCAD creates the districts.

Using the New District Layer Label the counties with their number. Create a color theme on based on SumPopulation.

Merge by Value: Compute Attributes Settings


Check Compute Attributes for the Attribute Settings dialog box:

Basics: Band Definition: An area of a specified width that surrounds one or more map features. You create bands when you want to examine the areas that are affected by activities that take place at or near the map features.

Example: Band

Quick Start: Creating Bands #1 Choose File-Close All, then choose File-Open or click on the toolbar. Open the geographic file FACILITY.CDF in TCW\TUTORIAL. TransCAD displays a map of transport facilities in the Northeast. Choose Tools-Bands or click on the toolbar.

Quick Start: Creating Bands #2 Enter 30 as the fixed size and click OK. Enter MYBAND.DBD as the file name and click OK. TransCAD creates bands, filled with a color theme, showing the areas within 30 miles of the transport facilities. Add some other layers, including CCCNTYL.CDF, and experiment with placing the bands among the layers.

Creating Bands
Choose Tools-Bands for the Bands dialog box:

Exercise Find the parcels that are within a quarter mile notification area of a land use change for parcel 54022 0007 in Newton MA:
Open the geographic file NEWTBDRY.CDF and add layer NPARCELS.CDF, both in TCW\EXERCISE. Select for [SBL-ID]=54022 0007 and create the band. Use Dataview-Select by Location to select the parcels within .25 mi. Save the map.

Basics: Overlay Definition: A procedure that estimates the attributes of an area by superimposing its boundary over the boundaries of other, smaller areas and calculating the extent to which they overlap.

Example: Overlay

Quick Start: Overlay Choose File-Close All, then choose File-Open or click on the toolbar. Open the map OVERLAY.MAP in TCW\TUTORIAL. TransCAD displays midtown Manhattan. Choose Tools-Overlay or click on the toolbar. The settings are correct. Click OK. Enter MYOVRLAY as the file name and click OK. TransCAD displays the attributes calculated from the ZIP Codes.

Overlays Overlay splits data from a reference layer and reassembles it for the working layer You should always use a reference layer with areas that are smaller than the areas in the working layer You have several choices for dealing with how each field is calculated, just like you did for Merge by Value

Creating an Overlay
Choose Tools-Overlay for the Geographic Overlay dialog box:

Exercise What is the total land value of the parcels within the .25 mile band you made in the band exercise?
Use the map that you just saved [Land Value] is a field in the Parcels dataview

Basics: Distance and Size Use the Info tool or a dataview for a layer to see the automatically calculated length of line features or the size of area features Use the Distance tool to draw a line on the screen and report the total length of the line Use the Size tool to draw an area on the screen and report the size of the area and the length of its perimeter.

Example: Distance and Size

Quick Start: Measuring Distance Open a map or geographic file, if one is not open. Click to activate the Distance tool. The status bar shows the elasped length. Click at the starting point on the map. You can click at one or more shape points. Double click to end the line. TransCAD displays the total length.

Measuring the Size on an Area Click to activate the Size tool.

Click at the first corner of the area, then click at the other corners. Double click to end the area. TransCAD displays the size and perimeter of the area.

Lesson 4: Matrices Goal: understand what a matrix is and how to:


Create a matrix Display and edit matrices Import data to and export data from matrices Display portions of a matrix Perform matrix operations

Basics: Matrix A data structure in TransCAD that contains rows and columns:
Each row is identified by a row ID Each column is identified by a column ID

Each entry in a matrix is a cell and has a value for that pair of row and column In most matrices, each row and column refers to a feature in a map layer

Example: Matrix

Example: Relation to Map Features

Basics: How TransCAD Stores Matrices TransCAD stores matrices in a matrix file with an .MTX extension A matrix file contains one or more matrices Each matrix in a matrix file contains the exact same set of rows and columns There are several options available for storing matrix information

Example: Matrix File With Multiple Matrices

Getting Ready to Create a Matrix File Choose File-Close All, then choose File-Open or click on the toolbar. Open the geographic file FL_ZONE.CDF in TCW\TUTORIAL. TransCAD displays an area zone database. Choose File-New, click Matrix File and click OK to display the Create Matrix File dialog box.

Creating a Matrix File Choose ZONE from the IDs are in drop-down list and click OK. Enter MYMATRIX as the matrix filename and click OK. TransCAD creates an empty matrix file and displays it in a matrix view.

In Depth: Creating a Matrix File You have several options when creating an empty matrix file:
Matrix files can be created from maps or dataviews. Rows and columns can come from any field Rows and columns can come from selection sets Any number of matrices can be created in a matrix file

Creating a Matrix File


Choose File-New and click Matrix File for the Create Matrix file dialog box:

Basics: Displaying Matrices Like dataviews, there are many ways of displaying matrices. You can:
choose the matrix you want to see change the labels that identify rows and columns show row and column sums and averages choose matrix font and grid settings change the row and column sort order

Exercise Open up any point or line geographic file and create a matrix from a selection of geographic features. Experiment with changing selections, changing ID fields and changing the number of matrices you want to create.

Basics: Matrix View Definition: A special type of dataview for matrices. Matrix views show the current display settings for a matrix. Matrix views, like dataviews, can be saved to a file.

Example: Displaying Matrices

Quick Start: Getting Ready to Display a Matrix Choose File-Close All, then choose File-Open or click on the toolbar. Open the dBASE file LABEL.DBF in TCW\EXERCISE. Open the matrix file TRANSIT.MTX in TCW\EXERCISE. TransCAD displays a transit OD matrix.

Changing Matrix Settings Choose another matrix to display by clicking on the Matrix to Display drop-down list in the toolbar. Choose Matrix-Settings or click in the toolbar. Change the font to Arial and the size to 12. Check the Grid option and choose Sum from the Marginals option.

Labeling a Matrix Click OK. TransCAD changes the font and size, adds a grid and displays row and column marginals. Choose Matrix-Labels or click on the toolbar. Choose LABEL for the Dataview, ZONE for the ID and ZONENAME for the Label with drop-down lists.

Saving and Retrieving a Matrix View Click OK. TransCAD labels each ID in the matrix with the zone name. Choose File-Save or click in the toolbar. Enter MYVIEW as the matrix view filename and click OK. TransCAD saves the matrix view. Choose File-Close All, then click . Open the matrix view MYVIEW.MVW.

Basics: Editing Matrices There are many ways to edit matrices. You can:
Edit a cell value directly Multiply or divide cells by a value Add or subtract values from cells Use a formula to compute cell values Clear the values from cells

Basics: Selecting Matrix Cells There are several ways you can select matrix cells. You can:
Select a single cell Select a range of cells Select an entire row or column Select several rows or columns at once

Getting Ready to Edit a Matrix Choose File-Close All, then choose File-Open or click on the toolbar. Open the matrix file TRANSIT.MTX in TCW\EXERCISE. TransCAD displays a transit OD matrix. Click on any cell in the matrix and change its value.

Editing a Matrix
Highlight a range of cells by dragging the mouse and click on in the toolbar or choose Matrix-Fill. Choose Add as the operation and enter 10 in the edit box. Click OK. TransCAD adds 10 to each cell that was highlighted. Click on again. This time, choose Scale by and enter 10 as the scale value.

Filling a Matrix With a Formula


Click OK. TransCAD multiplies each cell value by 10. Click on again. This time, choose Fill with Formula. Enter 2 * [Matrix 2] + 3 * [Matrix 3] as the formula and click OK. Click OK again. TransCAD fills the range with the formula using the cell values from the other matrices.

In Depth: Editing Matrices


Choose Matrix-Fill to display the Fill Matrix dialog box:

Exercise #1 Using the matrix you created in the previous exercise, change the matrix views font to Arial and its size to 16. Display a grid on the matrix and display marginals that calculate the averages of the rows and columns.

Exercise #2 Using the same matrix, experiment with filling cells in the matrix. Try filling with fixed values, adding values, or multiplying values. Also, try filling just the diagonal of the matrix. If you have more than one matrix in the matrix file, try filling with a matrix formula, or add or multiply matrices together.

Basics: Importing and Exporting Matrices TransCAD provides several matrix import/export functions. You can:
Create a new matrix from a dataview Create a new dataview from a matrix Import a field in a dataview to a row or column of a matrix Export a row or column of a matrix into a dataview

Getting Ready to Import Matrix Data Choose File-Close All, then choose File-Open or click on the toolbar. Open the dBASE file OD.DBF in TCW\EXERCISE. TransCAD displays a dataview of origin to destination flow. Choose Matrix-Import from Dataview to display the Create Matrix from Dataview dialog box.

Importing Matrix Data Choose ODFLOW from Data Fields and click OK. Enter MYOD as the matrix filename and click OK. TransCAD creates a matrix file, taking the row IDs from FROMZONE, the column IDs from TOZONE, and the cell values from ODFLOW.

Getting Ready to Import and Export Rows Choose File-Close All, then choose File-Open or click on the toolbar. Open the matrix file TRANSIT.MTX in TCW\EXERCISE. Choose Matrix-Export to Dataview. Enter MYMTX.DBF as the output filename and click OK. TransCAD exports the matrix into a dataview.

Exporting Rows Click on your matrix to make it the active window. Highlight rows 3, 4, 5 and 6 by shift-clicking on them. Choose Matrix-Export Rows or Columns. All the settings are correct. Click OK. Enter in MYMTX2.DBF as the filename and click OK. TransCAD exports the rows into a dataview.

Importing Rows Change some of the values in fields F3, F4, F5 or F6. Click on your matrix to make it the active window. Choose Matrix-Import Rows or Columns Choose F3 from the From drop-down list and click OK. TransCAD imports the dataview data into the matrix.

In Depth: Importing Matrix Data You have several options when importing data from a dataview. You can:
Choose Row and column IDs from any field in the dataview Import data only from a selection set Import more than one column of data. Each column is imported into a new matrix in the matrix file

Importing Matrix Data


Choose Matrix-Import from Dataview to import data into a matrix:

Importing Rows and Columns From Dataview


Highlight a row or column in the matrix and choose MatrixImport. Click on the row or column radio button:

In Depth: Export To Dataview


Choose MatrixExport Rows or Columns to display the Export Rows or Columns dialog box:

Basics: Displaying Portions of a Matrix In the same way that you can display selections in a dataview, you can also display portions of a matrix in a matrix view To display a portion of a matrix, you need to create a matrix index

Basics: Matrix Indexes Definition: A list of matrix row IDs or column IDs stored in a matrix file Indexes may contain subsets of the rows and columns of a matrix You can have any number of indexes in a matrix file and can change how a matrix is displayed by changing the current index Indexes are identified by name

Example: Matrix Index

1 3 5

Getting Ready to Add a Matrix Index Choose File-Close All, then choose File-Open or click on the toolbar. Open the matrix file TRANSIT.MTX in TCW\EXERCISE. Open the DBASE file MYMTX2.DBF created in the previous example. Click on the toolbar and enter ZONE = 1 or ZONE = 3 or ZONE = 5.

Adding a Matrix Index Click OK. TransCAD selects zones 1, 3 and 5 and puts them in the Selection selection set. Click on the matrix view to make it the active window. Choose Matrix-Indexes or click on the toolbar. Click Add Index. TransCAD displays the Add Index dialog box.

Changing Indexes Choose SELECTION from the Selection drop-down list. All the other settings are correct. Click OK. TransCAD creates a new index called NEW and returns to the Matrix Indexes dialog box. Choose NEW from the Rows drop-down list and NEW from the Columns drop-down list and click Close. TransCAD changes the current index to NEW and displays only zones 1, 3 and 5.

In Depth: Changing Indexes


Choose Matrix-Indexes for the Matrix Indexes dialog box:

In Depth: Adding a Matrix Index


Choose MatrixIndexes and click Add Index for the Add Matrix Index dialog box:

Exercise #1 Using the geographic file FL_ZONE.CDF and the matrix file TRANSIT.MTX in TCW\EXERCISE, create two matrix indexes. The first index will only show zones in the north and the second index will only show zones in the south.
Hint: Look at the diagram on pages 3-4.

Exercise #2 Using the matrix you created in the previous exercise, create another index that displays only the portion of the matrix you want to see. Then change matrix settings and display row and column sums for the index.
Hint: You can use FL_ZONE.CDF to help create your index.

Associating Matrices with Different Layers Sometimes it is useful to have one matrix represent different features in different layers. For example:
A zone matrix file contains origin-destination flow from zone to zone and you want to assign the matrix values to a transportation network where each row-column must be matched to the equivalent network node

This is accomplished by creating an index in the matrix from a correspondence table.

Example: Matrix Associated with Zones

Example: Equivalent Nodes for Zones

Example: Correspondence Table

You might also like