Skip to content
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

Holes aren't plotted #65

Open
nathanielvirgo opened this issue Jul 6, 2022 · 3 comments
Open

Holes aren't plotted #65

nathanielvirgo opened this issue Jul 6, 2022 · 3 comments

Comments

@nathanielvirgo
Copy link

nathanielvirgo commented Jul 6, 2022

The following operations create a shape with a hole in it. The hole is there but is not displayed in the plot. The same thing happens with any other operations that create a hole. This confused me for ages because I thought shapes with holes weren't supported at all and I was trying to work around that, so it would definitely be better if holes were plotted properly.

shape = readgeom("LINESTRING(0 0, 0 2, 1 1, 2 2, 2 0, 0 0)")
shape = buffer(shape, 0.25, 3)
plot(shape)

## uncomment these lines to 'fake' plotting the hole
#inner = LibGEOS.Polygon([coordinates(shape)[2]])
#plot!(inner,color="white")

plot without the hole:

image

plot with a 'fake' hole showing roughly how it should look:

image

@visr visr transferred this issue from JuliaGeo/LibGEOS.jl Jul 6, 2022
@visr
Copy link
Member

visr commented Jul 6, 2022

Thanks for the report and example @nathanielvirgo. I've moved the issue from LibGEOS.jl to GeoInterface.jl (or rather GeoInterfaceRecipes which lives in the same repo) since that is where it will have to be fixed.

It looks like the issue is known at least for polygons, going by this comment:

ring = first(GI.getgeom(geom)) # currently doesn't plot holes

@rafaqz
Copy link
Member

rafaqz commented Jul 6, 2022

This is more of a Plots.jl than a GeoInterface.jl issue. Maybe we can get Makie.jl working with holes.

@visr
Copy link
Member

visr commented Jul 6, 2022

Yeah good point. This is the Plots.jl issue: JuliaPlots/Plots.jl#972
The last comment may provide a way to get holes with the GR backend, besides the workaround used above to plot white shapes over it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants