WritePolygon() public static method

public static WritePolygon ( XmlWriter writer, AgGateway.ADAPT.ApplicationDataModel.Shapes.MultiPolygon multiPolygon ) : void
writer System.Xml.XmlWriter
multiPolygon AgGateway.ADAPT.ApplicationDataModel.Shapes.MultiPolygon
return void
Beispiel #1
0
        private static void WriteBoundary(XmlWriter writer, MultiPolygon boundary)
        {
            if (boundary == null || boundary.Polygons == null || boundary.Polygons.Count == 0)
            {
                return;
            }

            // Guidance pattern only supports a single polygon-based boundary
            var polygon = boundary.Polygons[0];

            ShapeWriter.WritePolygon(writer, polygon);
        }
Beispiel #2
0
        private void WriteBoundary(XmlWriter writer, int?boundaryId)
        {
            if (!boundaryId.HasValue)
            {
                return;
            }

            FieldBoundary fieldBoundary = null;

            foreach (var boundary in TaskWriter.DataModel.Catalog.FieldBoundaries)
            {
                if (boundary.Id.ReferenceId == boundaryId)
                {
                    fieldBoundary = boundary;
                    break;
                }
            }
            if (fieldBoundary == null || fieldBoundary.SpatialData == null)
            {
                return;
            }

            ShapeWriter.WritePolygon(writer, fieldBoundary.SpatialData);
        }