Comments (5)
@jamie-carter I was not able to reproduce this issue.
- I changed the CSV file and didn't provide most values for nitrogen, yet the tool didn't fail; it assumed 0 for those Land Cover classes.
- I did the same in QGIS, created a lookup table using
Create Lookup Table Template
and changed nitrogen values toNull
. The tool worked as in the previous case, assuming 0 value for them.
from qnspect.
@ar-siddiqui I can recreate the problem when using a coefficient table that is saved to a CSV file. If using either a temporary table (edits saved or unsaved) or a table in a GeoPackage (just tested with edits saved) the program works with Nulls.
It fails using a CSV table if the table contains either NULLs, or if the cells are completely empty.
Note that deleting the contents of a temporary or gpkg table immediately fills the cell with NULL. Deleting a CSV cell leaves it empty. You need to manually type in NULL to fill with a NULL. Clearly QGIS is handling these tables differently. All the above comments refer to modifying the table from within QGIS by opening the Attribute Table.
Bad CSV file and log of failing run attached.
ccap_w_nulls.csv
ccap_w_empty_cells.csv
ccap_w_nulls_log.txt
ccap_w_empty_cells_log.txt
from qnspect.
@DaveEslinger, thanks for the detailed feedback. I have looked into it and can recreate the issue.
After investigating, I think the user should not have empty/null values in the lookup table. In some of the cases, depending on the file format QGIS would assume null/empty values to be zeros and not in other cases and would fail (for example csv). This might be by design where certain file formats have their default null fallback values defined, while csv does not have it.
I think we should close this issue and ask users not to leave cells empty. To be more specific about where the issue is occurring I have added a print statement for each process so that the user can easily debug where the error is originating from.
from qnspect.
I agree users should not have null values in their tables. However, I think we need to have a check for that and send an error message and stop processing if that occurs. Just telling them to use good input is unlikely to actually work. Input validation is needed.
from qnspect.
3 options discussed:
- Leave as-is. We guide users towards using CSVs with 0s and not nulls in documentation an our template. We accept some users will still introduce nulls.
- Check for CSV inputs only (not all supported formats) and then check for null values. Show specific error message and cancel the run. We probably need to check behavior of all supported formats when they contain nulls.
- Check inputs for nulls regardless of format, show error message on null and cancel the run. This would cancel runs that otherwise would have succeeded since some formats e.g. geopackage work with nulls values.
Decision for now is to stick with 1, until other must-have defects are addressed then revisit if there's time.
from qnspect.
Related Issues (20)
- Division by zero error in comparison tools HOT 7
- Restructure files and folders to make it easy to zip and ship plugin
- Add tests
- Change pollutant selection gui
- Comparison Percent Calculation Incorrect? HOT 6
- Remove alphabetical sort on land cover classes
- Reorder input fields on GUIs to be as consistent as possible HOT 1
- Modify Land Cover (NLCD/C-CAP) is failing to execute.
- Typo in Run Pollution Analysis tool HOT 1
- Add raster alignment option to Rasterize Soils tool
- Change the name for the โDesired Outputs [optional]โ group in Pollution Analysis tool HOT 4
- Warn user if `analysis` inputs are temporary layers
- Limit displayed files to common raster types when loading rasters
- Raster colors not loading consistently HOT 3
- Change most "land use" terms to land cover
- It should not be, but is, possible to reclass from CCAP to NLCD and vice-versa HOT 3
- Limit pollutant and erosion calculations to a selected polygon area HOT 5
- Change NoData value, at least in comparison results
- Concentration error introduced with SHA: 18fe2433f31
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qnspect.