public static List <ISOPolygon> ReadXML(XmlNodeList nodes)
        {
            List <ISOPolygon> items = new List <ISOPolygon>();

            foreach (XmlNode node in nodes)
            {
                items.Add(ISOPolygon.ReadXML(node));
            }
            return(items);
        }
Beispiel #2
0
        public static ISOPartfield ReadXML(XmlNode node)
        {
            ISOPartfield field = new ISOPartfield();

            field.PartfieldID         = node.GetXmlNodeValue("@A");
            field.PartfieldCode       = node.GetXmlNodeValue("@B");
            field.PartfieldDesignator = node.GetXmlNodeValue("@C");
            field.PartfieldArea       = node.GetXmlNodeValueAsUInt("@D");
            field.CustomerIdRef       = node.GetXmlNodeValue("@E");
            field.FarmIdRef           = node.GetXmlNodeValue("@F");
            field.CropTypeIdRef       = node.GetXmlNodeValue("@G");
            field.CropVarietyIdRef    = node.GetXmlNodeValue("@H");
            field.FieldIdRef          = node.GetXmlNodeValue("@I");

            XmlNodeList plnNodes = node.SelectNodes("PLN");

            if (plnNodes != null)
            {
                field.Polygons.AddRange(ISOPolygon.ReadXML(plnNodes));
            }

            XmlNodeList lsgNodes = node.SelectNodes("LSG");

            if (lsgNodes != null)
            {
                field.LineStrings.AddRange(ISOLineString.ReadXML(lsgNodes));
            }

            XmlNodeList pntNodes = node.SelectNodes("PNT");

            if (pntNodes != null)
            {
                field.Points.AddRange(ISOPoint.ReadXML(pntNodes));
            }

            XmlNodeList ggpNodes = node.SelectNodes("GGP");

            if (ggpNodes != null)
            {
                field.GuidanceGroups.AddRange(ISOGuidanceGroup.ReadXML(ggpNodes));
            }

            return(field);
        }
Beispiel #3
0
        public static ISOGuidanceGroup ReadXML(XmlNode node)
        {
            ISOGuidanceGroup item = new ISOGuidanceGroup();

            item.GuidanceGroupId         = node.GetXmlNodeValue("@A");
            item.GuidanceGroupDesignator = node.GetXmlNodeValue("@B");

            XmlNodeList gpnNodes = node.SelectNodes("GPN");

            if (gpnNodes != null)
            {
                item.GuidancePatterns.AddRange(ISOGuidancePattern.ReadXML(gpnNodes));
            }

            XmlNodeList plnNodes = node.SelectNodes("PLN");

            if (plnNodes != null)
            {
                item.BoundaryPolygons.AddRange(ISOPolygon.ReadXML(plnNodes));
            }
            return(item);
        }
        public static ISOTreatmentZone ReadXML(XmlNode tznNode)
        {
            ISOTreatmentZone treatmentZone = new ISOTreatmentZone();

            treatmentZone.TreatmentZoneCode       = tznNode.GetXmlNodeValueAsByte("@A");
            treatmentZone.TreatmentZoneDesignator = tznNode.GetXmlNodeValue("@B");
            treatmentZone.TreatmentZoneColour     = tznNode.GetXmlNodeValueAsNullableByte("@C");

            XmlNodeList pdvNodes = tznNode.SelectNodes("PDV");

            if (pdvNodes != null)
            {
                treatmentZone.ProcessDataVariables.AddRange(ISOProcessDataVariable.ReadXML(pdvNodes));
            }

            XmlNodeList plnNodes = tznNode.SelectNodes("PLN");

            if (plnNodes != null)
            {
                treatmentZone.Polygons.AddRange(ISOPolygon.ReadXML(plnNodes));
            }
            return(treatmentZone);
        }
        public static ISOGuidancePattern ReadXML(XmlNode node)
        {
            ISOGuidancePattern item = new ISOGuidancePattern();

            item.GuidancePatternId         = node.GetXmlNodeValue("@A");
            item.GuidancePatternDesignator = node.GetXmlNodeValue("@B");
            item.GuidancePatternTypeInt    = node.GetXmlNodeValueAsInt("@C");
            item.GuidancePatternOptionsInt = node.GetXmlNodeValueAsNullableInt("@D");
            item.PropagationDirectionInt   = node.GetXmlNodeValueAsNullableInt("@E");
            item.ExtensionInt        = node.GetXmlNodeValueAsNullableInt("@F");
            item.Heading             = node.GetXmlNodeValueAsNullableDecimal("@G");
            item.Radius              = node.GetXmlNodeValueAsNullableUInt("@H");
            item.GNSSMethodInt       = node.GetXmlNodeValueAsNullableInt("@I");
            item.HorizontalAccuracy  = node.GetXmlNodeValueAsNullableDecimal("@J");
            item.VerticalAccuracy    = node.GetXmlNodeValueAsNullableDecimal("@K");
            item.BaseStationRef      = node.GetXmlNodeValue("@L");
            item.OriginalSRID        = node.GetXmlNodeValue("@M");
            item.NumberOfSwathsLeft  = node.GetXmlNodeValueAsNullableUInt("@N");
            item.NumberOfSwathsRight = node.GetXmlNodeValueAsNullableUInt("@O");

            XmlNode lsgNode = node.SelectSingleNode("LSG");

            if (lsgNode != null)
            {
                item.LineString = ISOLineString.ReadXML(lsgNode);
            }

            XmlNodeList plnNodes = node.SelectNodes("PLN");

            if (plnNodes != null)
            {
                item.BoundaryPolygons.AddRange(ISOPolygon.ReadXML(plnNodes));
            }

            return(item);
        }