GeometryBasics.jl icon indicating copy to clipboard operation
GeometryBasics.jl copied to clipboard

Why are `Multi{Polygon,Linestring,...} <: AbstractVector` and not `<: AbstractGeometry`

Open greimel opened this issue 5 years ago • 2 comments

What is the benefit of them being AbstractVectors?

In AlgebraOfGraphics we would like to support all shapes that are plottable. We would like to just implement methods for AbstractGeometry. Instead we have to define methods for Multi* types separately.

https://github.com/JuliaPlots/AlgebraOfGraphics.jl/pull/80

related to #70

greimel avatar Sep 28 '20 14:09 greimel

@greimel I don't know the rationale behind this decision, but it is very strange for sure. I am working on a major refactoring of the code in the cleanup branch, and will keep note of this issue there.

juliohm avatar Oct 08 '20 09:10 juliohm

The idea behind this is, that indexing into them behaves like an AbstractVector of its elements.. Anyways, that type hierarchy is not really used anywhere, so would be easy to change if needed

SimonDanisch avatar May 16 '21 13:05 SimonDanisch