bluemodel / BlueM.QGISInterface

QGIS plugin for creating input files for a BlueM.Sim model from GIS data
GNU General Public License v3.0
3 stars 3 forks source link

Possible rounding errors in EFL file #9

Open jamaa opened 2 years ago

jamaa commented 2 years ago

as discussed in #8 it is theoretically possible that the values for the column "Flaeche" written to the EFL file for one EZG do not add up to 100% anymore after rounding (tolerance in BlueM.Sim is currently 0.001%).

If this turns out to be a real problem and we wanted to avoid it, the plugin would either have to adjust values accordingly after rounding or the tolerance in BlueM.Sim needs to be changed (unsure what consequences this would have, though).

MartinGrosshaus commented 2 years ago

I was working under the assumption that the tolerance was 0.001 (= 0.1%). %.... classic source for math confusion :D With the tolerance being 0.001% this could really be a problem.

Due to the way the plugin handles every value separatly, it would be difficult to handle the correction for a possible sum deviation while checking the values. I think the easiest way to solve that potential problem (without caches etc.) would be to read in the (rounded) data after all values were handled and check it then for every mentioned EZG.

Do you know about similar tolerance-issues with other file types? Then we can solve them all with one general function.