private void WriteCompoundCurve(CompoundCurve compoundCurve) { wkbWriter.Write(compoundCurve.Geometries.Count); foreach (Geometry geometry in compoundCurve.Geometries) { WriteInternal(geometry); } }
private void WriteCompoundCurve(CompoundCurve compoundCurve) { wktBuilder.Append("("); foreach (Geometry geometry in compoundCurve.Geometries) { Write(geometry, geometry.GeometryType == GeometryType.LineString); wktBuilder.Append(","); } wktBuilder.Remove(wktBuilder.Length - 1, 1); wktBuilder.Append(")"); }
private CompoundCurve ReadCompoundCurve(Dimension dimension) { CompoundCurve compoundCurve = new CompoundCurve(); uint geometryCount = wkbReader.ReadUInt32(); for (int i = 0; i < geometryCount; i++) { compoundCurve.Geometries.Add(Read <Curve>()); } return(compoundCurve); }
protected CompoundCurve ReadCompoundCurve(Dimension dimension) { ExpectGroupStart(); CompoundCurve compoundCurve = new CompoundCurve(); compoundCurve.Dimension = dimension; do { compoundCurve.Geometries.Add((Curve)ReadType(GeometryType.LineString, dimension, GeometryType.LineString, GeometryType.CircularString)); } while (IsMatch(",")); ExpectGroupEnd(); return(compoundCurve); }
protected Geometry CreateGeometry(GeometryType geometryType, Dimension dimension) { Geometry geometry = null; switch (geometryType) { case GeometryType.Point: geometry = new Point(); break; case GeometryType.LineString: geometry = new LineString(); break; case GeometryType.Polygon: geometry = new Polygon(); break; case GeometryType.MultiPoint: geometry = new MultiPoint(); break; case GeometryType.MultiLineString: geometry = new MultiLineString(); break; case GeometryType.MultiPolygon: geometry = new MultiPolygon(); break; case GeometryType.GeometryCollection: geometry = new GeometryCollection(); break; case GeometryType.CircularString: geometry = new CircularString(); break; case GeometryType.CompoundCurve: geometry = new CompoundCurve(); break; case GeometryType.CurvePolygon: geometry = new CurvePolygon(); break; case GeometryType.MultiCurve: geometry = new MultiCurve(); break; case GeometryType.MultiSurface: geometry = new MultiSurface(); break; case GeometryType.PolyhedralSurface: geometry = new PolyhedralSurface(); break; case GeometryType.Tin: geometry = new Tin(); break; case GeometryType.Triangle: geometry = new Triangle(); break; default: throw new NotSupportedException(geometryType.ToString()); } geometry.Dimension = dimension; return(geometry); }