Comments (6)
Indeed, that’s a cryptic error message.
I now added a warning if NULL values are contained in an input data set (in the selected field).
Could you test whether the new version (3.1.5rc, 93ecc3e) reliably prevents you from going forward with data sets containing NULL values? (download the archive using the link below, then install it using QGIS’ plugin manager->Install from ZIP)
from cartogram3.
It does seem to work with my test data.
from cartogram3.
Great, thanks! I still tested it on Windows 10 (additionally to my own Gnome setup; both only QGIS 3.26), from the screenshot I assume you’re on MacOS.
Just submitted a new version to QGIS’ plugin repository, it will take a few days until it’s approved and available as an update.
I still plan to write a short discussion on the implications of the different ways of handling NULL values (omitting, filling with 0, filling with average, ...; see earlier comment in this thread), maybe as a wiki page on github, and would add a link pointing to that discussion to the error message. (Leaving this issue open until then)
from cartogram3.
This is a really good observation! Thank you for reporting it.
If you don’t mind, what’s your use case or data source, in which NULL values are frequent?
To be perfectly honest, at first, I was a bit hesitant to implement data mangling beyond a simple warning the user. There are simply too many different reasons why a data set might have NULL values, and - as you already wrote - no one-fits-all way of treating such features exists:
- for instance, in same cases, it might be good to set NULL values to zero (the Dougenik algorithm then sets them to 1), which shrinks features to practical invisibility.
- In other cases, it might be more appropriate to skip such features alltogether (and leave a whole in the output layer).
- In yet another variant, it might be advisable to assign a value that’s equivalent to the feature’s original areal share, in order to retain its approximate size (but that should be accompanied with appropriate styling to highlight the data deficiency).
- There are probably still other options that don’t come to me from the top of my head.
I’m still a bit divided on whether that should be something the plugin handles, or whether it should rather provide instructions on how to use QGIS’ existing data management tools to fill NULL values with a sensible value. The latter option would mean that users are necessarily aware of what they did to the input data; of course it comes at the price of a slight inconvenience.
I’m currently travelling, so this change will take at least a few weeks, which also gives me more time to think about how to implement it, and how to integrate the warning(s) and option(s) into the user interface in an unobstrusive and accessible way.
from cartogram3.
Adding an error message at minimum would be super helpful here (or even better gracefully handle them somehow). I was about to submit a bug report before realizing my issue is actually caused by a null value. The tool just exited with a cryptic log entry TypeError: cannot pickle 'QVariant' object
from cartogram3.
(note to self): The error message also still need to be translated! (re #30 )
from cartogram3.
Related Issues (20)
- QgsPointV2 renamed to QgsPoint HOT 1
- QgsGeometry: API Change HOT 1
- AttributeError: type object 'QgsMessageBar' has no attribute 'INFO' HOT 3
- Save iteration progress after crash? HOT 1
- Memory management on Windows HOT 1
- TypeError: QgsMapLayer.exportNamedStyle(): argument 2 has unexpected type 'str' HOT 6
- TypeError: QgsMapLayer.exportNamedStyle(): not enough arguments HOT 5
- QgsGeometry.set() is deprecated HOT 1
- Just hangs in 0% with this dataset HOT 3
- Crashing HOT 14
- Plugin crash in Qgis 3.22 HOT 16
- rewrite does not (yet) allow cancel button HOT 1
- Plugin does not anymore report remaining average error
- Cartogram computation never moves beyond 1% HOT 12
- Update translations
- Add help text to Processing plugin HOT 1
- Fix invalid polygons in input data set
- Bug on MacOS HOT 8
- Plugin does not work on Python < 3.8 HOT 3
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 cartogram3.