private void show_coord_value()
        {
            if ((coordObject.Point_Count == 0) && (coordObject.Polygon_Count == 0) && (coordObject.KML_Reference.Length == 0))
            {
                thisBox.Text = String.Empty;
                return;
            }

            if (coordObject.KML_Reference.Length > 0)
            {
                thisBox.Text = "KML Reference (" + coordObject.KML_Reference + ")";
                return;
            }

            if (coordObject.Polygon_Count >= 1)
            {
                if (coordObject.Get_Polygon(0).Label.Trim().Length > 0)
                {
                    thisBox.Text = "Polygon Included ( \"" + coordObject.Get_Polygon(0).Label.Trim() + "\" )";
                }
                else
                {
                    thisBox.Text = "Polygon Included";
                }

                return;
            }

            if (coordObject.Point_Count > 1)
            {
                thisBox.Text = "Multiple Points";
                return;
            }

            Coordinate_Point singlePoint = coordObject.Points[0];

            if (singlePoint.Label.Trim().Length > 0)
            {
                thisBox.Text = singlePoint.Latitude + " x " + singlePoint.Longitude + " ( \"" + singlePoint.Label + "\" )";
            }
            else
            {
                thisBox.Text = singlePoint.Latitude + " x " + singlePoint.Longitude;
            }
        }
Exemple #2
0
        /// <summary> Map one or more data elements from the original METS-based object to the
        /// BriefItem object </summary>
        /// <param name="Original"> Original METS-based object </param>
        /// <param name="New"> New object to populate some data from the original </param>
        /// <returns> TRUE if successful, FALSE if an exception is encountered </returns>
        public bool MapToBriefItem(SobekCM_Item Original, BriefItemInfo New)
        {
            // Attempt to pull the top-level geo-spatial data from the source object
            GeoSpatial_Information geoInfo = Original.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;

            // If there was geo-spatial data here, add it to the new item
            if ((geoInfo != null) && (geoInfo.hasData) && ((geoInfo.Point_Count > 0) || (geoInfo.Polygon_Count > 0)))
            {
                // Ensure the brief item has a geospatial object
                if (New.GeoSpatial == null)
                {
                    New.GeoSpatial = new BriefItem_GeoSpatial();
                }

                // Add each point first into the description
                ReadOnlyCollection <Coordinate_Point> origPoints = geoInfo.Points;
                foreach (Coordinate_Point thisPoint in origPoints)
                {
                    if (!String.IsNullOrEmpty(thisPoint.Label))
                    {
                        New.Add_Description("Coordinates", thisPoint.Latitude + " x " + thisPoint.Longitude + " ( " + thisPoint.Label + " )");
                    }
                    else
                    {
                        New.Add_Description("Coordinates", thisPoint.Latitude + " x " + thisPoint.Longitude);
                    }

                    // Also add each point into the object itself
                    if (New.GeoSpatial.Points == null)
                    {
                        New.GeoSpatial.Points = new List <BriefItem_Coordinate_Point>();
                    }

                    // Create the new point
                    BriefItem_Coordinate_Point cPoint = new BriefItem_Coordinate_Point
                    {
                        Latitude    = thisPoint.Latitude,
                        Longitude   = thisPoint.Longitude,
                        Altitude    = thisPoint.Altitude,
                        Label       = thisPoint.Label,
                        FeatureType = thisPoint.FeatureType
                    };

                    // Add it
                    New.GeoSpatial.Points.Add(cPoint);
                }

                // Add the polygons to the description, if there is only one.
                if (geoInfo.Polygon_Count == 1)
                {
                    for (int i = 0; i < geoInfo.Polygon_Count; i++)
                    {
                        Coordinate_Polygon polygon        = geoInfo.Get_Polygon(i);
                        StringBuilder      polygonBuilder = new StringBuilder();
                        foreach (Coordinate_Point thisPoint in polygon.Edge_Points)
                        {
                            if (polygonBuilder.Length > 0)
                            {
                                polygonBuilder.Append(", " + thisPoint.Latitude + " x " + thisPoint.Longitude);
                            }
                            else
                            {
                                polygonBuilder.Append(thisPoint.Latitude + " x " + thisPoint.Longitude);
                            }
                        }

                        if (polygon.Label.Length > 0)
                        {
                            polygonBuilder.Append(" ( " + polygon.Label + " )");
                        }
                        if (polygonBuilder.ToString().Trim().Length > 0)
                        {
                            New.Add_Description("Polygon", polygonBuilder.ToString());
                        }
                    }
                }

                // Map each polygon over now as well
                if (geoInfo.Polygon_Count > 0)
                {
                    // Ensure the polygon collection is defined
                    if (New.GeoSpatial.Polygons == null)
                    {
                        New.GeoSpatial.Polygons = new List <BriefItem_Coordinate_Polygon>();
                    }

                    // Get the collection of polygons and step through them
                    ReadOnlyCollection <Coordinate_Polygon> origPolys = geoInfo.Polygons;
                    foreach (Coordinate_Polygon thisPoly in origPolys)
                    {
                        // Start to build the new poly
                        BriefItem_Coordinate_Polygon cPoly = new BriefItem_Coordinate_Polygon
                        {
                            Label         = thisPoly.Label,
                            FeatureType   = thisPoly.FeatureType,
                            Page_Sequence = thisPoly.Page_Sequence,
                            Rotation      = thisPoly.Rotation,
                            PolygonType   = thisPoly.PolygonType
                        };

                        // Copy over all the vertices
                        if (thisPoly.Edge_Points_Count > 0)
                        {
                            // Ensure the edge points collection is defined
                            if (cPoly.Edge_Points == null)
                            {
                                cPoly.Edge_Points = new List <BriefItem_Coordinate_Point>();
                            }

                            // Copy over all the vertices
                            ReadOnlyCollection <Coordinate_Point> origVertices = thisPoly.Edge_Points;
                            foreach (Coordinate_Point thisPoint in origVertices)
                            {
                                // Create the new point
                                BriefItem_Coordinate_Point cPoint = new BriefItem_Coordinate_Point
                                {
                                    Latitude    = thisPoint.Latitude,
                                    Longitude   = thisPoint.Longitude,
                                    Altitude    = thisPoint.Altitude,
                                    Label       = thisPoint.Label,
                                    FeatureType = thisPoint.FeatureType
                                };

                                // Add it
                                cPoly.Edge_Points.Add(cPoint);
                            }
                        }

                        // Add this poly
                        New.GeoSpatial.Polygons.Add(cPoly);
                    }
                }

                // Map each line over now as well
                if (geoInfo.Line_Count > 0)
                {
                    // Ensure the line collection is defined
                    if (New.GeoSpatial.Lines == null)
                    {
                        New.GeoSpatial.Lines = new List <BriefItem_Coordinate_Line>();
                    }

                    // Get the collection of lines and step through them
                    ReadOnlyCollection <Coordinate_Line> origLines = geoInfo.Lines;
                    foreach (Coordinate_Line thisLine in origLines)
                    {
                        // Start to build the new line
                        BriefItem_Coordinate_Line cLine = new BriefItem_Coordinate_Line
                        {
                            Label       = thisLine.Label,
                            FeatureType = thisLine.FeatureType
                        };

                        // Copy over all the vertices
                        if (thisLine.Point_Count > 0)
                        {
                            // Ensure the points collection is defined
                            if (cLine.Points == null)
                            {
                                cLine.Points = new List <BriefItem_Coordinate_Point>();
                            }

                            // Copy over all the vertices
                            ReadOnlyCollection <Coordinate_Point> origVertices = thisLine.Points;
                            foreach (Coordinate_Point thisPoint in origVertices)
                            {
                                // Create the new point
                                BriefItem_Coordinate_Point cPoint = new BriefItem_Coordinate_Point
                                {
                                    Latitude    = thisPoint.Latitude,
                                    Longitude   = thisPoint.Longitude,
                                    Altitude    = thisPoint.Altitude,
                                    Label       = thisPoint.Label,
                                    FeatureType = thisPoint.FeatureType
                                };

                                // Add it
                                cLine.Points.Add(cPoint);
                            }
                        }

                        // Add this poly
                        New.GeoSpatial.Lines.Add(cLine);
                    }
                }
            }

            // Now, copy over all the geo-spatial information at the page level
            List <abstract_TreeNode> pages = Original.Divisions.Physical_Tree.Pages_PreOrder;

            for (int i = 0; i < pages.Count; i++)
            {
                abstract_TreeNode      pageNode = pages[i];
                GeoSpatial_Information geoInfo2 = pageNode.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                if ((geoInfo2 != null) && (geoInfo2.hasData))
                {
                    // Since some data was found, make sure the geospatial object exists
                    // Ensure the brief item has a geospatial object
                    if (New.GeoSpatial == null)
                    {
                        New.GeoSpatial = new BriefItem_GeoSpatial();
                    }

                    // Any polygons exist at this page level?
                    if (geoInfo2.Polygon_Count > 0)
                    {
                        foreach (Coordinate_Polygon thisPolygon in geoInfo2.Polygons)
                        {
                            thisPolygon.Page_Sequence = (ushort)(i + 1);

                            // Ensure the polygon collection is defined
                            if (New.GeoSpatial.Polygons == null)
                            {
                                New.GeoSpatial.Polygons = new List <BriefItem_Coordinate_Polygon>();
                            }

                            // Get the collection of polygons and step through them
                            ReadOnlyCollection <Coordinate_Polygon> origPolys = geoInfo2.Polygons;
                            foreach (Coordinate_Polygon thisPoly in origPolys)
                            {
                                // Start to build the new poly
                                BriefItem_Coordinate_Polygon cPoly = new BriefItem_Coordinate_Polygon
                                {
                                    Label         = thisPoly.Label,
                                    FeatureType   = thisPoly.FeatureType,
                                    Page_Sequence = thisPoly.Page_Sequence,
                                    Rotation      = thisPoly.Rotation,
                                    PolygonType   = thisPoly.PolygonType
                                };

                                // Copy over all the vertices
                                if (thisPoly.Edge_Points_Count > 0)
                                {
                                    // Ensure the edge points collection is defined
                                    if (cPoly.Edge_Points == null)
                                    {
                                        cPoly.Edge_Points = new List <BriefItem_Coordinate_Point>();
                                    }

                                    // Copy over all the vertices
                                    ReadOnlyCollection <Coordinate_Point> origVertices = thisPoly.Edge_Points;
                                    foreach (Coordinate_Point thisPoint in origVertices)
                                    {
                                        // Create the new point
                                        BriefItem_Coordinate_Point cPoint = new BriefItem_Coordinate_Point
                                        {
                                            Latitude    = thisPoint.Latitude,
                                            Longitude   = thisPoint.Longitude,
                                            Altitude    = thisPoint.Altitude,
                                            Label       = thisPoint.Label,
                                            FeatureType = thisPoint.FeatureType
                                        };

                                        // Add it
                                        cPoly.Edge_Points.Add(cPoint);
                                    }
                                }

                                // Add this poly
                                New.GeoSpatial.Polygons.Add(cPoly);
                            }
                        }
                    }
                    if (geoInfo2.Line_Count > 0)
                    {
                        // Ensure the line collection is defined
                        if (New.GeoSpatial.Lines == null)
                        {
                            New.GeoSpatial.Lines = new List <BriefItem_Coordinate_Line>();
                        }

                        // Add each line
                        foreach (Coordinate_Line thisLine in geoInfo2.Lines)
                        {
                            // Start to build the new line
                            BriefItem_Coordinate_Line cLine = new BriefItem_Coordinate_Line
                            {
                                Label       = thisLine.Label,
                                FeatureType = thisLine.FeatureType
                            };

                            // Copy over all the vertices
                            if (thisLine.Point_Count > 0)
                            {
                                // Ensure the points collection is defined
                                if (cLine.Points == null)
                                {
                                    cLine.Points = new List <BriefItem_Coordinate_Point>();
                                }

                                // Copy over all the vertices
                                ReadOnlyCollection <Coordinate_Point> origVertices = thisLine.Points;
                                foreach (Coordinate_Point thisPoint in origVertices)
                                {
                                    // Create the new point
                                    BriefItem_Coordinate_Point cPoint = new BriefItem_Coordinate_Point
                                    {
                                        Latitude    = thisPoint.Latitude,
                                        Longitude   = thisPoint.Longitude,
                                        Altitude    = thisPoint.Altitude,
                                        Label       = thisPoint.Label,
                                        FeatureType = thisPoint.FeatureType
                                    };

                                    // Add it
                                    cLine.Points.Add(cPoint);
                                }
                            }

                            // Add this poly
                            New.GeoSpatial.Lines.Add(cLine);
                        }
                    }
                    if (geoInfo2.Point_Count > 0)
                    {
                        // Ensure the points collection was defined
                        if (New.GeoSpatial.Points == null)
                        {
                            New.GeoSpatial.Points = new List <BriefItem_Coordinate_Point>();
                        }

                        // Add each point, from the page
                        foreach (Coordinate_Point thisPoint in geoInfo2.Points)
                        {
                            // Create the new point
                            BriefItem_Coordinate_Point cPoint = new BriefItem_Coordinate_Point
                            {
                                Latitude    = thisPoint.Latitude,
                                Longitude   = thisPoint.Longitude,
                                Altitude    = thisPoint.Altitude,
                                Label       = thisPoint.Label,
                                FeatureType = thisPoint.FeatureType
                            };

                            // Add it
                            New.GeoSpatial.Points.Add(cPoint);
                        }
                    }
                }
            }

            return(true);
        }
        private void saveButton_Button_Pressed(object sender, EventArgs e)
        {
            if (!read_only)
            {
                saved = true;

                coords.KML_Reference = kmlTextBox.Text.Trim();

                coords.Clear_Points();

                try
                {
                    if ((point1LatitudeTextBox.Text.Trim().Length > 0) && (point1LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        coords.Add_Point(Convert.ToDouble(point1LatitudeTextBox.Text.Trim()), Convert.ToDouble(point1LongitudeTextBox.Text.Trim()), point1LabelTextBox.Text.Trim());
                    }

                    if ((point2LatitudeTextBox.Text.Trim().Length > 0) && (point2LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        coords.Add_Point(Convert.ToDouble(point2LatitudeTextBox.Text.Trim()), Convert.ToDouble(point2LongitudeTextBox.Text.Trim()), point2LabelTextBox.Text.Trim());
                    }

                    if ((point3LatitudeTextBox.Text.Trim().Length > 0) && (point3LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        coords.Add_Point(Convert.ToDouble(point3LatitudeTextBox.Text.Trim()), Convert.ToDouble(point3LongitudeTextBox.Text.Trim()), point3LabelTextBox.Text.Trim());
                    }

                    if ((point4LatitudeTextBox.Text.Trim().Length > 0) && (point4LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        coords.Add_Point(Convert.ToDouble(point4LatitudeTextBox.Text.Trim()), Convert.ToDouble(point4LongitudeTextBox.Text.Trim()), point4LabelTextBox.Text.Trim());
                    }

                    if ((point5LatitudeTextBox.Text.Trim().Length > 0) && (point5LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        coords.Add_Point(Convert.ToDouble(point5LatitudeTextBox.Text.Trim()), Convert.ToDouble(point5LongitudeTextBox.Text.Trim()), point5LabelTextBox.Text.Trim());
                    }
                }
                catch
                {
                }

                Coordinate_Polygon polygon = new Coordinate_Polygon();
                bool added     = false;
                bool hasPoints = false;
                if (coords.Polygon_Count > 0)
                {
                    added   = true;
                    polygon = coords.Get_Polygon(0);
                }

                polygon.Clear_Edge_Points();

                // Check for semicolons and blank longitudes
                if ((poly1LatitudeTextBox.Text.IndexOf(";") > 0) && (poly1LongitudeTextBox.Text.Trim().Length == 0))
                {
                    string[] split = poly1LatitudeTextBox.Text.Split(";".ToCharArray());
                    if (split.Length > 1)
                    {
                        poly1LatitudeTextBox.Text  = split[0];
                        poly1LongitudeTextBox.Text = split[1];
                    }
                }
                if ((poly2LatitudeTextBox.Text.IndexOf(";") > 0) && (poly2LongitudeTextBox.Text.Trim().Length == 0))
                {
                    string[] split = poly2LatitudeTextBox.Text.Split(";".ToCharArray());
                    if (split.Length > 1)
                    {
                        poly2LatitudeTextBox.Text  = split[0];
                        poly2LongitudeTextBox.Text = split[1];
                    }
                }
                if ((poly3LatitudeTextBox.Text.IndexOf(";") > 0) && (poly3LongitudeTextBox.Text.Trim().Length == 0))
                {
                    string[] split = poly3LatitudeTextBox.Text.Split(";".ToCharArray());
                    if (split.Length > 1)
                    {
                        poly3LatitudeTextBox.Text  = split[0];
                        poly3LongitudeTextBox.Text = split[1];
                    }
                }
                if ((poly4LatitudeTextBox.Text.IndexOf(";") > 0) && (poly4LongitudeTextBox.Text.Trim().Length == 0))
                {
                    string[] split = poly4LatitudeTextBox.Text.Split(";".ToCharArray());
                    if (split.Length > 1)
                    {
                        poly4LatitudeTextBox.Text  = split[0];
                        poly4LongitudeTextBox.Text = split[1];
                    }
                }
                if ((poly5LatitudeTextBox.Text.IndexOf(";") > 0) && (poly5LongitudeTextBox.Text.Trim().Length == 0))
                {
                    string[] split = poly5LatitudeTextBox.Text.Split(";".ToCharArray());
                    if (split.Length > 1)
                    {
                        poly5LatitudeTextBox.Text  = split[0];
                        poly5LongitudeTextBox.Text = split[1];
                    }
                }
                if ((poly6LatitudeTextBox.Text.IndexOf(";") > 0) && (poly6LongitudeTextBox.Text.Trim().Length == 0))
                {
                    string[] split = poly6LatitudeTextBox.Text.Split(";".ToCharArray());
                    if (split.Length > 1)
                    {
                        poly6LatitudeTextBox.Text  = split[0];
                        poly6LongitudeTextBox.Text = split[1];
                    }
                }

                try
                {
                    // Now assign any values that are present to the polygon
                    if ((poly1LatitudeTextBox.Text.Trim().Length > 0) && (poly1LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        hasPoints = true;
                        polygon.Add_Edge_Point(Convert.ToDouble(poly1LatitudeTextBox.Text.Trim()), Convert.ToDouble(poly1LongitudeTextBox.Text.Trim()), String.Empty);
                    }

                    if ((poly2LatitudeTextBox.Text.Trim().Length > 0) && (poly2LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        hasPoints = true;
                        polygon.Add_Edge_Point(Convert.ToDouble(poly2LatitudeTextBox.Text.Trim()), Convert.ToDouble(poly2LongitudeTextBox.Text.Trim()), String.Empty);
                    }

                    if ((poly3LatitudeTextBox.Text.Trim().Length > 0) && (poly3LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        hasPoints = true;
                        polygon.Add_Edge_Point(Convert.ToDouble(poly3LatitudeTextBox.Text.Trim()), Convert.ToDouble(poly3LongitudeTextBox.Text.Trim()), String.Empty);
                    }

                    if ((poly4LatitudeTextBox.Text.Trim().Length > 0) && (poly4LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        hasPoints = true;
                        polygon.Add_Edge_Point(Convert.ToDouble(poly4LatitudeTextBox.Text.Trim()), Convert.ToDouble(poly4LongitudeTextBox.Text.Trim()), String.Empty);
                    }

                    if ((poly5LatitudeTextBox.Text.Trim().Length > 0) && (poly5LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        hasPoints = true;
                        polygon.Add_Edge_Point(Convert.ToDouble(poly5LatitudeTextBox.Text.Trim()), Convert.ToDouble(poly5LongitudeTextBox.Text.Trim()), String.Empty);
                    }

                    if ((poly6LatitudeTextBox.Text.Trim().Length > 0) && (poly6LongitudeTextBox.Text.Trim().Length > 0))
                    {
                        hasPoints = true;
                        polygon.Add_Edge_Point(Convert.ToDouble(poly6LatitudeTextBox.Text.Trim()), Convert.ToDouble(poly6LongitudeTextBox.Text.Trim()), String.Empty);
                    }
                }
                catch
                {
                }

                polygon.Label = polyLabelTextBox.Text.Trim();
                if ((polygon.Label.Length == 0) && (isMap))
                {
                    polygon.Label = "Map Coverage";
                }

                // Are there just two points in this polygon?
                if (polygon.Edge_Points_Count == 2)
                {
                    Coordinate_Point first_point  = polygon.Edge_Points[0];
                    Coordinate_Point second_point = polygon.Edge_Points[1];

                    polygon.Clear_Edge_Points();

                    polygon.Add_Edge_Point(first_point);
                    polygon.Add_Edge_Point(first_point.Latitude, second_point.Longitude);
                    polygon.Add_Edge_Point(second_point);
                    polygon.Add_Edge_Point(second_point.Latitude, first_point.Longitude);
                }

                // If this has not been added and has points, add it
                if ((!added) && (hasPoints))
                {
                    coords.Add_Polygon(polygon);
                }
            }

            Close();
        }
        public void Set_Coordinates(GeoSpatial_Information Coords)
        {
            coords = Coords;

            // Display the data
            kmlTextBox.Text = Coords.KML_Reference;

            if (Coords.Point_Count > 0)
            {
                point1LatitudeTextBox.Text  = Coords.Points[0].Latitude.ToString();
                point1LongitudeTextBox.Text = Coords.Points[0].Longitude.ToString();
                point1LabelTextBox.Text     = Coords.Points[0].Label;
            }

            if (Coords.Point_Count > 1)
            {
                point2LatitudeTextBox.Text  = Coords.Points[1].Latitude.ToString();
                point2LongitudeTextBox.Text = Coords.Points[1].Longitude.ToString();
                point2LabelTextBox.Text     = Coords.Points[1].Label;
            }

            if (Coords.Point_Count > 2)
            {
                point3LatitudeTextBox.Text  = Coords.Points[2].Latitude.ToString();
                point3LongitudeTextBox.Text = Coords.Points[2].Longitude.ToString();
                point3LabelTextBox.Text     = Coords.Points[2].Label;
            }

            if (Coords.Point_Count > 3)
            {
                point4LatitudeTextBox.Text  = Coords.Points[3].Latitude.ToString();
                point4LongitudeTextBox.Text = Coords.Points[3].Longitude.ToString();
                point4LabelTextBox.Text     = Coords.Points[3].Label;
            }

            if (Coords.Point_Count > 4)
            {
                point5LatitudeTextBox.Text  = Coords.Points[4].Latitude.ToString();
                point5LongitudeTextBox.Text = Coords.Points[4].Longitude.ToString();
                point5LabelTextBox.Text     = Coords.Points[4].Label;
            }

            if (Coords.Polygon_Count > 0)
            {
                Coordinate_Polygon polygon = Coords.Get_Polygon(0);
                polyLabelTextBox.Text = polygon.Label;
                if (polygon.Edge_Points_Count > 0)
                {
                    poly1LatitudeTextBox.Text  = polygon.Edge_Points[0].Latitude.ToString();
                    poly1LongitudeTextBox.Text = polygon.Edge_Points[0].Longitude.ToString();
                }
                if (polygon.Edge_Points_Count > 1)
                {
                    poly2LatitudeTextBox.Text  = polygon.Edge_Points[1].Latitude.ToString();
                    poly2LongitudeTextBox.Text = polygon.Edge_Points[1].Longitude.ToString();
                }
                if (polygon.Edge_Points_Count > 2)
                {
                    poly3LatitudeTextBox.Text  = polygon.Edge_Points[2].Latitude.ToString();
                    poly3LongitudeTextBox.Text = polygon.Edge_Points[2].Longitude.ToString();
                }
                if (polygon.Edge_Points_Count > 3)
                {
                    poly4LatitudeTextBox.Text  = polygon.Edge_Points[3].Latitude.ToString();
                    poly4LongitudeTextBox.Text = polygon.Edge_Points[3].Longitude.ToString();
                }
                if (polygon.Edge_Points_Count > 4)
                {
                    poly5LatitudeTextBox.Text  = polygon.Edge_Points[4].Latitude.ToString();
                    poly5LongitudeTextBox.Text = polygon.Edge_Points[4].Longitude.ToString();
                }
                if (polygon.Edge_Points_Count > 5)
                {
                    poly6LatitudeTextBox.Text  = polygon.Edge_Points[5].Latitude.ToString();
                    poly6LongitudeTextBox.Text = polygon.Edge_Points[5].Longitude.ToString();
                }
            }

            point1LatitudeTextBox.TextChanged  += textChanged;
            kmlTextBox.TextChanged             += textChanged;
            point1LabelTextBox.TextChanged     += textChanged;
            point1LongitudeTextBox.TextChanged += textChanged;
            point3LabelTextBox.TextChanged     += textChanged;
            point3LongitudeTextBox.TextChanged += textChanged;
            point3LatitudeTextBox.TextChanged  += textChanged;
            point2LabelTextBox.TextChanged     += textChanged;
            point2LongitudeTextBox.TextChanged += textChanged;
            point5LabelTextBox.TextChanged     += textChanged;
            point5LongitudeTextBox.TextChanged += textChanged;
            point5LatitudeTextBox.TextChanged  += textChanged;
            point4LabelTextBox.TextChanged     += textChanged;
            point4LongitudeTextBox.TextChanged += textChanged;
            point4LatitudeTextBox.TextChanged  += textChanged;
            point2LatitudeTextBox.TextChanged  += textChanged;
            point2LongitudeTextBox.TextChanged += textChanged;
            poly5LongitudeTextBox.TextChanged  += textChanged;
            poly5LatitudeTextBox.TextChanged   += textChanged;
            poly4LongitudeTextBox.TextChanged  += textChanged;
            poly4LatitudeTextBox.TextChanged   += textChanged;
            poly3LongitudeTextBox.TextChanged  += textChanged;
            poly3LatitudeTextBox.TextChanged   += textChanged;
            poly2LongitudeTextBox.TextChanged  += textChanged;
            poly2LatitudeTextBox.TextChanged   += textChanged;
            poly1LongitudeTextBox.TextChanged  += textChanged;
            poly1LatitudeTextBox.TextChanged   += textChanged;
            poly6LongitudeTextBox.TextChanged  += textChanged;
            poly6LatitudeTextBox.TextChanged   += textChanged;
            polyLabelTextBox.TextChanged       += textChanged;
        }