Serialization of GML basic types

41 views
Skip to first unread message

Vyacheslav

unread,
Jun 19, 2018, 7:26:41 AM6/19/18
to NetTopologySuite
Hello!
Can this tool help me with the problem of serializable classes for GML? I need classes for basic GML objects with IXmlSerializable implementation to use it in my own custom serializable types. Currently I have to write them manually, for example

public class PosList : IXmlSerializable
{
public int SrsDimension { get; set; }
public int Count { get; set; }
public List<Position> Positions { get; set; }

public XmlSchema GetSchema()
{
return null;
}

public void WriteXml(XmlWriter writer)
{
writer.WriteAttributeString("SrsDimension", SrsDimension.ToString());
writer.WriteAttributeString("Count", Count.ToString());
writer.WriteValue(string.Join(" ", Positions));
}
}


to enable GML-serialization into

<gml:posList srsDimension="2" count="6">187782.730 99247.599 187810.805 99619.590 188071.776 99683.002</gml:posList>

Thanks for any advise.
Reply all
Reply to author
Forward
0 new messages