@@ -145,25 +145,20 @@ Returns some iterator, which yields tuples of points. Each tuple is an edge.
145
145
It goes `(p1, p2), (p2, p3), (p3, p4), ...` etc.
146
146
"""
147
147
eachedge (geom) = eachedge (GI. trait (geom), geom, Float64)
148
-
149
148
function eachedge (geom, :: Type{T} ) where T
150
149
eachedge (GI. trait (geom), geom, T)
151
150
end
152
-
153
151
# implementation for LineString and LinearRing
154
152
function eachedge (trait:: GI.AbstractCurveTrait , geom, :: Type{T} ) where T
155
153
return (_tuple_point .((GI. getpoint (geom, i), GI. getpoint (geom, i+ 1 )), T) for i in 1 : GI. npoint (geom)- 1 )
156
154
end
157
-
158
155
# implementation for Polygon, MultiPolygon, MultiLineString, GeometryCollection
159
156
function eachedge (trait:: GI.AbstractGeometryTrait , geom, :: Type{T} ) where T
160
157
return Iterators. flatten ((eachedge (r, T) for r in flatten (GI. AbstractCurveTrait, geom)))
161
158
end
162
-
163
159
function eachedge (trait:: GI.PointTrait , geom, :: Type{T} ) where T
164
160
return ArgumentError (" Can't get edges from points, $geom was a PointTrait." )
165
161
end
166
-
167
162
function eachedge (trait:: GI.MultiPointTrait , geom, :: Type{T} ) where T
168
163
return ArgumentError (" Can't get edges from MultiPoint, $geom was a MultiPointTrait." )
169
164
end
0 commit comments