private static string GetGeometryUsingNTS(IGeometry geometry) { var gmlWriter = new GMLWriter(); var ms = new MemoryStream(); gmlWriter.Write(geometry, ms); return System.Text.Encoding.Default.GetString(ms.ToArray()); }
private static string GenerateTestFragment() { StringBuilder sb = new StringBuilder(); XmlTextWriter writer = new XmlTextWriter(new StringWriter(sb)); writer.WriteStartElement("test"); writer.WriteAttributeString("xmlns", "gml", null, "http://www.opengis.net/gml"); Point geom = new Point(52, -0.9); GMLWriter gmlWriter = new GMLWriter(); gmlWriter.Write(geom, writer); writer.WriteEndElement(); return sb.ToString(); }
/// <summary> /// Returns the feature representation as GML 2.1.1 XML document. /// This XML document is based on <c>Geometry.xsd</c> schema. /// NO features or XLink are implemented here! /// </summary> public XmlReader ToGMLFeature() { GMLWriter writer = new GMLWriter(); return writer.Write(this); }