public List <LineSegment> GetLineSegments() { switch (this.Type) { case GeometryType.LineString: return(GetLineSegments(false)); case GeometryType.Polygon: return(Geometries.SelectMany(i => i.GetLineSegments(true)).ToList()); case GeometryType.MultiLineString: return(Geometries.SelectMany(i => i.GetLineSegments(false)).ToList()); case GeometryType.MultiPolygon: return(Geometries.SelectMany(i => i.GetLineSegments()).ToList()); case GeometryType.GeometryCollection: return(Geometries.SelectMany(i => i.GetLineSegments()).ToList()); case GeometryType.Point: case GeometryType.MultiPoint: case GeometryType.CircularString: case GeometryType.CompoundCurve: case GeometryType.CurvePolygon: default: throw new NotImplementedException(); } }
public IPoint[] GetAllPoints() { if (Points != null) { return(Points); } else if (Geometries != null) { return(Geometries.SelectMany(i => i.GetAllPoints()).ToArray()); } else { return(null); } }