Is there a way to read a TransCad Matrix file (mtx) without access to Transcad.

I am trying to convert a matrix file to a csv file.


1 Answer 1


If you have TransCAD, you can use the Caliper Python module that lets you access TransCAD and it's programming language GISDK via a program written in Python. With it, you can write a Python program like the one below:

import sys, traceback, caliper    

dk = caliper.Gisdk("TransCAD")    
rh = dk.GetFirstRecord(view_set)    
for row in dk.GetRecordsValues(view_set,rh,field_names,sort_order,num_found,order,None):
    print str(row)

In terms of matrix handling, there are functions that allow you to export TransCAD matrices into CSV:

folder = dk.apply("G30 Tutorial Folder","gis_ui")    
m = dk.OpenMatrix(folder + "OD.mtx",None)    
CreateTableFromMatrix(m, folder + "myimp.csv", "CSV", {{"Complete", "Yes"}})

You can go into Help-TransCAD in the TransCAD menu, click on the Index tab and type in Python for more info on setting up Python for TransCAD. You can also type in any function name (e.g. CreateTableFromMatrix()) for more specific information on any GISDK function.

Regards, Jim

Jim Lam

Caliper Corporation


  • I would normally edit out a signature, but in this case it discloses your association with the company you are discussing (which is good)...in the future, just say it in your post instead. Jan 19, 2016 at 14:57
  • Thank you but I didn't mention that I do not have access to Transcad.
    – aconti74
    Jan 20, 2016 at 22:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.