/// <summary> /// Reads an XML Position From An Existing DOM /// </summary> /// <param name="rootnode">Node Containing the GML Position</param> public override void ReadXML(XmlNode rootnode) { GMLPos postmp; if (rootnode.LocalName == "Envelope") { this.ReadXMLBase(rootnode); foreach (XmlNode childnode in rootnode.ChildNodes) { if (string.IsNullOrEmpty(childnode.InnerText)) { continue; } switch (childnode.LocalName) { case "lowerCorner": postmp = new GMLPos(); postmp.FromString(childnode.InnerText); this.lowercorner.Pos = postmp; break; case "upperCorner": postmp = new GMLPos(); postmp.FromString(childnode.InnerText); this.uppercorner.Pos = postmp; break; case "#comment": break; default: throw new ArgumentException("Unexpected Child Node Name: " + childnode.Name + " in GMLEnvelope"); } } } else { throw new ArgumentException("Unexpected Node Name: " + rootnode.Name + " in GMLPolycon"); } }
/// <summary> /// Initializes a new instance of the GMLCircleByCenterPoint class /// Default Constructor - Sets Fixed Values /// </summary> public GMLCircleByCenterPoint() { this.point = new GMLPos(); this.interpolation = "circularArcCenterPointWithRadius"; this.numArc = 1; }
/// <summary> /// Reads an XML Position From An Existing DOM /// </summary> /// <param name="rootnode">Node Containing the GML Position</param> public override void ReadXML(XmlNode rootnode) { foreach (XmlAttribute attrib in rootnode.Attributes) { if (string.IsNullOrEmpty(attrib.InnerText)) { continue; } switch (attrib.LocalName) { case "interpolation": this.interpolation = attrib.InnerText; break; case "numArc": this.numArc = int.Parse(attrib.InnerText); break; default: if (attrib.Prefix != "xmlns") { throw new ArgumentException("Unexpected attribute " + attrib.Name + " in cirlebycenterpoint"); } break; } } foreach (XmlNode childnode in rootnode.ChildNodes) { if (string.IsNullOrEmpty(rootnode.InnerText)) { continue; } switch (childnode.LocalName) { case "pos": case "gml:pos": this.point = new GMLPos(); this.point.ReadXML(childnode); break; case "radius": case "gml:radius": if (childnode.Attributes.Count > 0) { this.uom = new Uri(childnode.Attributes[0].InnerText); } this.radius = double.Parse(childnode.InnerText); break; case "#comment": break; default: throw new ArgumentException("Unexpected child node " + childnode.Name + " in cirlebycenterpoint"); } } }
/// <summary> /// Initializes a new instance of the GMLPoint class with the specified namespace /// Default Constructor /// </summary> /// <param name="gmlNamespace">What namespace should be used for this object</param> public GMLPoint(string gmlNamespace) : base(gmlNamespace) { this.gmlNamespace = gmlNamespace; this.pos = new GMLPos(gmlNamespace); }