Building Better Desire Lines in QGIS (using AequilibraE)

Ever build desire lines that just SUCK?

This is just nasty

There’s a solution – AequilibraE’s Delaunay Triangles. Pedro’s method can turn the above into this…

Same data as above – but much more intelligible

The One-Time Startup Process

  1. Install QGIS 2.18.12 from www.qgis.org
  2. Make sure it runs correctly (see the notes below)
  3. Activate the AequilibraE plugin (Plugins - Manage and Install Plugins – Check “AequilibraE”)

The Process

  1. Import the shapefile geography – the Add Vector Layer on the left side
  2. Import the data table – same button as above (see notes below)
  3. Convert the data table to a matrix (probably optional, but a good step to do) – AequilibraE – Data – Import Matrices
    1. Select ‘Open Layer’, make sure Matrix is the data table, and that the From, To, and Flow match the fields in the data table
    2. Click on ‘Load’, it’ll load the data
    3. Click on ‘Save’ and save the data to an aem file
    4. BE PATIENT! Mine will hang on ‘Reblocking matrices’ for quite a while, and will not write to the file for several minutes, but the CPU would still be getting drilled by QGIS. The window will close itself when complete.
  4. Open AequilibraE – GIS Tools – Desire Lines
    1. Zone or Node Layer should be your zone geography
    2. ID Field should be whatever field your TAZ numbers are in
    3. Click on ‘Load Matrices’ and select your aem file
    4. Make sure ‘Delaunay Triangles’ is selected. Unless you want a mess.
    5. Click on ‘Build Desire Lines’
    6. Be patient – it can take a few
    7. Visualize the resulting desire lines (e.g. put a width on them or a color)

 

Notes

  1. I had a lot of problems with DLLs not loading and various things not being available. To remedy this, I had to fix my PATH, PYTHONHOME, and PYTHONPATH environment variables. In my case, I put @cpython@ at the end of my PATH statement (’…C:\RBuildTools\3.5\bin;%cpython%’) and I rename the cpython variable as necessary (I have a cpython, which is the current-in-use, and cpython.arcgis). I use a similar tactic with PYTHONPATH and PYTHONHOME.
  2. I had a few issues with data I was exporting from R. Make sure you have no N/A values in your data. It’s not a bad idea to check it in another program before using it in AequilibraE.

Comments from Other Sites

  1. From A little more Delaunay Lines – Xl-Optim:

    […] first one, is that for the first time, there are people in the transportation community blogging about AequilibraE.  The second…

Visitor Comments