Usage of convert_mtx.exe

Marxan 2.0.2 and above (Marxan Optimised) is sensitive to the order of planning unit identifiers in the Marxan planning unit by species sparse (or relational) matrix.  Additionally, it can only use a sparse matrix, and is not compatible with a tabular matrix.  The command line program convert_mtx.exe converts existing Marxan matrix files into a format compatible with Marxan Optimised.

The command line program performs 2 different types of conversion on Marxan matrix files.  To bring up the command line, click the Start button in windows then click Run.  Type CMD. Type your directory “d:”.  Type cd directory\directory, etc….   Now navigate to the directory containing your input files, and copy the convert_mtx.exe file to this directory. 

To convert a Marxan sparse (or relational) matrix file from one sorted by speciesid to  one sorted by puid, use the following command; 

convert_mtx.exe 2 puvspr2.dat matrix.dat 

This will convert a sparse matrix sorted by speciesid (puvspr2.dat) to one sorted by puid  (matrix.dat). 

To convert a Marxan tabular matrix file to a sparse matrix file sorted by puid, use the  following command; 

convert_mtx.exe 1 puvspr2.dat relational.dat 

This will convert a tabular matrix file (puvspr2.dat) to a sparse matrix file sorted by puid  (relational.dat).