コード例 #1
0
 static string GeometryToWktString(MultiLineString multiLineString)
 {
     return string.Format("({0})", string.Join(",", multiLineString.LineStrings.Select(GeometryToWktString)));
 }
コード例 #2
0
        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;
        }
コード例 #3
0
        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;
        }
コード例 #4
0
 static string GeometryToWktString(MultiLineString multiLineString)
 {
     return(string.Format("({0})", string.Join(",", multiLineString.LineStrings.Select(GeometryToWktString))));
 }
コード例 #5
0
 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;
 }