gem / oq-irmt-qgis

QGIS plugin to drive the OpenQuake Engine, to develop Social Vulnerability and Integrated Risk composite indices, and to predict building recovery times following an earthquake
https://plugins.qgis.org/plugins/svir/
8 stars 3 forks source link

Use the correct data type when creating attributes while reading oq-engine outputs #712

Open ptormene opened 4 years ago

ptormene commented 4 years ago

By mistake, all attributes were created as numeric. QGIS allows to insert strings into numeric attributes, which remain valid and usable until you save them, then they are silently converted into numbers. As a consequence, when you consolidate the project, you lose the original strings. We need to create attributes with proper types. Types might be read from the extracted data, checking the corresponding dtype.

ptormene commented 4 years ago

Although in many cases it is true that all fields are numeric, it is risky also in those cases to force the conversion of all values to float. I have to review all cases and read values considering the actual input data types.