Building Better Desire Lines in QGIS (using AequilibraE)
Ever build desire lines that just SUCK?
There’s a solution – AequilibraE’s Delaunay Triangles. Pedro’s method can turn the above into this…
The One-Time Startup Process
- Install QGIS 2.18.12 from www.qgis.org
- Make sure it runs correctly (see the notes below)
- Activate the AequilibraE plugin (Plugins -Â Manage and Install Plugins – Check “AequilibraE”)
The Process
- Import the shapefile geography – the Add Vector Layer on the left side
- Import the data table – same button as above (see notes below)
- Convert the data table to a matrix (probably optional, but a good step to do) – AequilibraE – Data – Import Matrices
- Select ‘Open Layer’, make sure Matrix is the data table, and that the From, To, and Flow match the fields in the data table
- Click on ‘Load’, it’ll load the data
- Click on ‘Save’ and save the data to an aem file
- 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.
- Open AequilibraE – GIS Tools – Desire Lines
- Zone or Node Layer should be your zone geography
- ID Field should be whatever field your TAZ numbers are in
- Click on ‘Load Matrices’ and select your aem file
- Make sure ‘Delaunay Triangles’ is selected. Unless you want a mess.
- Click on ‘Build Desire Lines’
- Be patient – it can take a few
- Visualize the resulting desire lines (e.g. put a width on them or a color)
Notes
- 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.
- 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.
[…] first one, is that for the first time, there are people in the transportation community blogging about AequilibraE. The second…