-
Notifications
You must be signed in to change notification settings - Fork 36
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
[low priority] CategoricalArrays support #761
Comments
julia> using StatsBase; Rasters.zonal(countmap, grain; of = GO.polygonize(grain))
3-element Vector{Union{Missing, Dict{CategoricalValue{String, UInt32}, Int64}}}:
Dict{CategoricalValue{String, UInt32}, Int64}("sand" => 1, "clay" => 1)
Dict{CategoricalValue{String, UInt32}, Int64}("sand" => 1)
Dict{CategoricalValue{String, UInt32}, Int64}() |
Aaaah I didn't realize DimensionalArrays has a CategoricalArrays extension! This makes much more sense now :D |
Yeah maybe @tiemvanderdeure added that |
Ok seems a UInt8 or UInt16 if there are more than 256 are what to do. The dbf table trick is kinda weird but we could write one in a RastersCategoricalArraysExt extension, and have a Maybe netcdf can handle categories without that |
Yes I added a small extensions that defines the basic operation of |
Another one to add to the list is to make |
Right now, some in memory operations work with a Raster that wraps a CategoricalArray.
Here's an mwe:
This works fine, I'll update the issue to check if things like zonal work as intended.
.dbf
file (see https://gis.stackexchange.com/questions/404747/raster-categorical-attributes-not-showing-in-arcgis) so that the value is recognized as categorical, and https://desktop.arcgis.com/en/arcmap/latest/manage-data/raster-and-images/raster-dataset-attribute-tables.htmWriting does not work:
so maybe there need to be some more specific dispatches there.
The text was updated successfully, but these errors were encountered: