-
Notifications
You must be signed in to change notification settings - Fork 4
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
polygonize
should return a MultiPolygon
, not a Vector
of Polygon
#139
Comments
Shouldn't it actually return a feature collection, with one feature for each unique value? Or do you mean in the special case of an |
We don't actually do that case at the moment. But I'll add it, and yes that would need a Currently is just (I guess we can make it a feature collection of pooled |
That sounds good to me. Makie uses Contour.jl and Isoband.jl to generate isolines - perhaps we could create an extension on that and use it as an algorithm if needed, the necessary code can be copied wholesale from Makie. |
This is actually a very different algorithm, its exact pixels like the raster. But we could have those too. (practically ive found exact pixels better to work with, and most R packages do this too, or allow for 4/8/16 nodes rather than just 4, which I'm also considering doing) |
I added handling for (and now I'm thinking this approach will be slow for large numbers of values, though its fast for small numbers... maybe we need to create all polygons at the same time...) |
I have no guage of this being fast or not, its 10 million pixels and 400 categories... julia> @time featurecollection = polygonize(rand(1:400, 10000, 1000));
16.385245 seconds (29.87 M allocations: 7.798 GiB, 29.17% gc time)
No scratch that the number of categories is not the main cost. Probably this can be faster with a Dict lookup |
Maybe test against Contours.jl? I can send a script later tonight once I get on the plane and have to stay awake. I can see the appeal of exact pixel polygons though. |
Just thought of this but as you mentioned it's not really a comparison - the algorithms are too different! |
fixed by #141 I think |
See: https://discourse.julialang.org/t/polygonize-a-raster/114189/7
The text was updated successfully, but these errors were encountered: