JuliaGeo / Shapefile.jl

Parsing .shp files in Julia
http://juliageo.org/Shapefile.jl/
MIT License
82 stars 14 forks source link

Plotting polygons with CairoMakie shows interior lines #104

Closed tiemvanderdeure closed 3 months ago

tiemvanderdeure commented 5 months ago

When plotting a polygon using CairoMakie, some vertices/lines appear within the polygon.

I don't have the same problem with GLMakie and it also only seems to affect Shapefile-polygons (I tried GeometryBasics and had no problems).

To reproduce (see attached .zip for the shape, which is from the NaturalEarth dataset):

using Shapefile, CairoMakie
taz = Shapefile.Table("tanzania/tanzania.shp").geometry[1]
f_cairo = CairoMakie.poly(taz)

using GLMakie
f_gl = GLMakie.poly(taz)

tanzania_cairo tanzania_gl

tanzania.zip

SimonDanisch commented 5 months ago

I noticed this too... Didn't have time to debug it though. Maybe @jkrumbiegel has an idea?

jkrumbiegel commented 5 months ago

Haha why do these keep happening 😄 Simon maybe you have to take a look at the override mechanism I am using for polygons in CairoMakie. This happens whenever some type does not hit the override methods and falls back to mesh drawing. Maybe the dispatch structure needs to be more generic so that I don't have to add every single possible type

asinghvi17 commented 3 months ago

Should be fixed in latest CairoMakie.