SpaceGroupUCL / qgisSpaceSyntaxToolkit

Space Syntax Toolkit for QGIS
GNU General Public License v3.0
115 stars 40 forks source link

Recovering results after incomplete analysis #167

Open joaoponceleao opened 6 years ago

joaoponceleao commented 6 years ago

After running a graph analysis for a loooooong time on a windows computer, it would be a pity to lose all the results due to a failure at the post-processing stage by SST. Thankfully, I think I've come up with a way to recover the data (at least if you're using spatialite - I imagine postgis as well). I'm leaving this here as an open issue to help other users. I do not think it should be in the faq since it hasn't been sufficiently tested and I may be completely wrong.. others may chime in.

Issue: SST or QGIS crashes in the final phase (post-processing) of the analysis. However, depthmapXnet has written its log files to its folder, specifically, the 'analyse-result.txt' file.

Solution: Obviously this is a last-resort solution. The 'analyse-result.txt' is actually a csv file with all the results computed by depthmap with the exception of 'NACH and NAIN'. All its missing is the geometry column. One can use this file to create a geodatabase that can be used with SST's attribute explorer:

  1. First, you re-run the analysis under the exact same conditions as before, but with only one radius chosen (preferably a small one so it can compute faster - it should, if possible, also be a radius that was used in the original failed analysis, so you can confirm results).
  2. Once the analysis is complete, import this new spatialite file into postgis (or equivalent).
  3. Create a new table using the column names in the csv file (refer to the new database for the column types needed). Import the csv file into this new table.
  4. Update the table with the geometry from step 2, making a join on the 'ref' column (this is an id column that starts at 0). This new table can now be imported into QGIS and used by SST's attribute explorer, etc.

After doing the above I can confirm that, at least in my case, I managed to get identical values from a rescued 'analyse-result.txt' file and a successfully completed SST analysis. I did not do extensive testing and of course, ymv.....

Hope this helps someone. Feel free to refute the above or advise against this.

Joao