static string GeometryToWktString(MultiLineString multiLineString) { return string.Format("({0})", string.Join(",", multiLineString.LineStrings.Select(GeometryToWktString))); }
public static MultiCurveType ToGmlMultiCurve(this Terradue.GeoJson.Geometry.GeometryObject geometry) { if (geometry is LineString) { List<LineString> lineStrings = new List<LineString>(); lineStrings.Add((LineString)geometry); MultiLineString multiLineString = new MultiLineString(lineStrings); return ToGmlMultiCurve((MultiLineString)multiLineString); } else if (geometry is MultiLineString) { return ToGmlMultiCurve((MultiLineString)geometry); } else return null; }
public static XmlElement ToMultiCurveGml(this Terradue.GeoJson.Geometry.GeometryObject geometry) { XmlDocument xdoc = new XmlDocument(); using (XmlWriter writer = xdoc.CreateNavigator().AppendChild()) { if (geometry is LineString) { List<LineString> lineStrings = new List<LineString>(); lineStrings.Add((LineString)geometry); MultiLineString multiLineString = new MultiLineString(lineStrings); GmlMultiSurfaceSerializer.Serialize(writer, GeometryToGml((MultiLineString)multiLineString)); } else if (geometry is MultiLineString) { GmlMultiSurfaceSerializer.Serialize(writer, GeometryToGml((MultiLineString)geometry)); } else return null; } return xdoc.DocumentElement; }
static string GeometryToWktString(MultiLineString multiLineString) { return(string.Format("({0})", string.Join(",", multiLineString.LineStrings.Select(GeometryToWktString)))); }
public static Terradue.GeoJson.Gml.MultiCurveType GeometryToGml(MultiLineString multiLineString) { Terradue.GeoJson.Gml.MultiCurveType gmlMultiLineString = new Terradue.GeoJson.Gml.MultiCurveType(); gmlMultiLineString.curveMembers = new Terradue.GeoJson.Gml.CurveArrayPropertyType(); List<Terradue.GeoJson.Gml.LineStringType> gmlLineStrings = new List<Terradue.GeoJson.Gml.LineStringType>(); foreach (var lineString in multiLineString.LineStrings) { gmlLineStrings.Add(GeometryToGml(lineString)); } gmlMultiLineString.curveMembers.Items = gmlLineStrings.ToArray(); return gmlMultiLineString; }