-
Notifications
You must be signed in to change notification settings - Fork 1
Multi Geometries
copied from the #geo channel in http://julialang.slack.com on 24 Feb 2019:
Simon Danisch [1:45 PM] I'm wondering if we should just get rid off all these multi types^^... wouldn't
const MultiLineString = AbstractVector{LineString}
be enough? (edited)Yeesian Ng [1:46 PM] i guess it would. But people might want to treat it as a single object rather than as a vector of objects
Simon Danisch [1:46 PM] for what? I mean, I guess I can see that... Afterall the same could be said for Polygon so maybe we should just make it a subtype of
AbstractVector{LineString}
Yeesian Ng [1:48 PM] https://sgillies.net/2010/03/24/origin-of-the-multi-geometry.html and https://sgillies.net/2014/01/02/maybe-the-shapefile-was-right-after-all.html (edited)
Martijn Visser [Yesterday at 1:52 PM] Yeah I guess we can reduce the amount of complexity considerably that way. I remember struggling with shapely (geos) because we didn't know ahead of time whether an operation would return a polygon or a multipolygon
Martijn Visser [1:53 PM] Need to keep in mind though that multipolygons are quite common, and are often used as a way to share metadata, e.g. one record is one district here: https://github.com/JuliaGeo/GeoInterface.jl/pull/12#issuecomment-355061122
Yeesian Ng [21 hours ago] same here. i still dont know if there’s an easy answer to it haha
Yeesian Ng [21 hours ago] the hope is that we’ll be sufficiently comprehensive in functionality (in julia) for both polygons and multipolygons such that it doesn’t become of concern to the user
Yeesian Ng [21 hours ago] lots of occasions where I see python code (a) only working for polygons or multipolygons, or (b) having if-statements to handle both
Martijn Visser [21 hours ago] yeah I image if we do a union of two polygons that we should return a vector of polygons, and this can contain either one or two depending if they intersected
Simon Danisch [21 hours ago] all algorithms that work on multipolygons + polygons, should just be defined on AbstractVector{<: Polygon} and implement the polygon case like this:
algorithm(x::Polygon) = algorithm([x])