-
Notifications
You must be signed in to change notification settings - Fork 125
Shape reader: multiple variables alowed #1460
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Shape reader can ingest multiple variables, one per polygon. For this the shape file needs a string field called `variable` that contains the name of the variable requested by `get_variables`. All tests pass for standard `land_binary_mask` fed directly without the `variable` field. All tests pass for a model requesting a landmask when this is in a file together with other variables. Variable requests tests pass for variables that are not `land_binary_mask`. Multiple shapefile read tests pass for variables with the `variable` field Fixes #5380, refs #5379 and refs #5321
Perhaps @gauteh could also have a look at this one. |
I downloaded the
|
Firs of all let me say that the reader works with shapefiles without any attributes or with attributes that are not called Shapefiles have features and attributes. As far as I know they don't have layers embedded, you need an extra file to do that and that would add to the complexity. The use case for this change is to allow for the introduction of other binary masks in addition to For uses of the shape file reader to get variables other than |
We are generally a bit skeptical to include things that are fairly specific, as it increases complexity and future maintenance. In fact we are striving to reduce complexity as much as possible. However, this is well programmed with docstrings and unittests. Thus I am willing to merge this if you can add a small tutorial so that this can also be used by others. Maybe the best would be to make an example script for the gallery, where you could add some text/comments on how to produce and make use of such a shapefile. It could be named something like Maybe one alternative to needing to have attributes named "variable", could be to specify a mapping to the shapereader constructor, e.g. If you can add such an example script to this PR, I can eventually merge it. |
Shape reader can ingest multiple variables, one per polygon. For this the shape file needs a string field called
variable
that contains the name of the variable requested byget_variables
.All tests pass for standard
land_binary_mask
fed directly without thevariable
field.All tests pass for a model requesting a landmask when this is in a file together with other variables.
Variable requests tests pass for variables that are not
land_binary_mask
.Multiple shapefile read tests pass for variables with the
variable
field