SpaceGroupUCL / qgisSpaceSyntaxToolkit

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

Discrepancy between plugin and Depthmap results #141

Closed rtsaboya closed 7 years ago

rtsaboya commented 7 years ago

Hello, I may have found a small bug in the plugin. I noticed that, when calculating Choice Rn (axial) for a big system (25k lines), the higher choice lines appear as having value equal to 1. In Depthmap XNet, they have values such as 1.94357e+08. Every other measure was correct, including connectivity.

I suspect it has something to do with the field size in QGIS. It appears that these big values cannot be stored in them and, as a result, are chopped down to 1.

The system in question, besides being relatively large, is highly disconnected, which causes minimum paths to be concentrated on a small number of lines. As a consequence, these lines have unusually large values of Choice.

If you want to test with the real file, here is the link to the dxf. Check the bridge between the two portions of the city.

https://github.com/rtsaboya/Mapa-Axial-Fpolis

jorgegil commented 7 years ago

Thanks for submitting this issue and providing a file for testing.

Indeed that sounds like you're hitting the limits of the integer type in shape files (these are -2147483647 and 2147483647). I'll look into this to see if another data type can support these Choice values.

rtsaboya commented 7 years ago

Hello! Thanks for the feedback.

Actually, redoing the calculations in Spatialite format, I found that the higher value is equal to 476611300, therefore lower than the upper limit of shapefiles mentioned by you.

Could it be a problem caused by the plugin setting the field length at 8 digits? (476611300 has 9 digits)

Cheers, Renato. screenshot - 24_10_2016 14_15_31

jorgegil commented 7 years ago

Thanks for the added input! And glad to see that this works with Spatialite.

This confirms that it's a limitation of the shape file format and the integer size in dbf files. Which is indeed lower than the value of the integer type in QGIS.

The solution is to add the choice values to a decimal field instead, which in shape files supports more digits. I tried with 13 digits, for example, and it worked.

Will update the plugin as soon as possible and submit to the repository.