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

Proposal: allow `Polygon` to be constructed from a vector of `PointTrait` geometries

Open asinghvi17 opened this issue 1 year ago • 5 comments

That would allow a much cleaner syntax than the current Polygon([LinearRing(...)])...

asinghvi17 avatar Sep 26 '24 21:09 asinghvi17

Just syntax? Or you want it to actually wrap that?

We could do like the last PR and auto wrap it in a vector of LinearRing and call Polygon again.

rafaqz avatar Sep 26 '24 22:09 rafaqz

Yeah, the wrapping approach is what I was thinking.

asinghvi17 avatar Sep 26 '24 22:09 asinghvi17

You'll run into issues like having to check the points form a ring, otherwise they're not a valid polygon.

evetion avatar Sep 27 '24 05:09 evetion

I think LinearRing doesn't check validity either ?

rafaqz avatar Sep 27 '24 06:09 rafaqz

LinearRing does IIRC, but you can pass a LineString which does not into a GI.Polygon and it just works.

asinghvi17 avatar May 15 '25 01:05 asinghvi17