/// <summary> Flag indicates if this active reader/writer needs to append schema reference information
        /// to the METS XML header by analyzing the contents of the division </summary>
        /// <param name="MetsDivision"> Division from the overall package into which to read the metadata</param>
        /// <returns> TRUE if the schema should be attached, otherwise fALSE </returns>
        public bool Schema_Reference_Required_Division(abstract_TreeNode MetsDivision)
        {
            // GEt the geo-spatial information if it exists
            GeoSpatial_Information geoInfo = MetsDivision.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;

            if ((geoInfo == null) || (!geoInfo.hasData))
            {
                return(false);
            }
            return(true);
        }
        /// <summary> Flag indicates if this active reader/writer will write a dmdSec for this node </summary>
        /// <param name="MetsDivision"> Division to check if a dmdSec will be written </param>
        /// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
        /// <returns> TRUE if the package has data to be written, otherwise fALSE </returns>
        public bool Include_dmdSec(abstract_TreeNode MetsDivision, Dictionary <string, object> Options)
        {
            // GEt the geo-spatial information if it exists
            GeoSpatial_Information geoInfo = MetsDivision.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;

            if ((geoInfo == null) || (!geoInfo.hasData))
            {
                return(false);
            }
            return(true);
        }
        /// <summary> Reads the dmdSec at the current position in the XmlTextReader and associates it with
        /// one subsection/division from the METS structure map </summary>
        /// <param name="Input_XmlReader"> Open XmlReader from which to read the metadata </param>
        /// <param name="MetsDivision"> Division from the overall package into which to read the metadata</param>
        /// <param name="Options"> Dictionary of any options which this METS section writer may utilize</param>
        /// <returns> TRUE if successful, otherwise FALSE</returns>
        public bool Read_dmdSec(XmlReader Input_XmlReader, abstract_TreeNode MetsDivision, Dictionary <string, object> Options)
        {
            // Get the geo-spatial information if it exists or create a new one
            GeoSpatial_Information geoInfo = MetsDivision.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;

            if (geoInfo == null)
            {
                geoInfo = new GeoSpatial_Information();
                MetsDivision.Add_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY, geoInfo);
            }

            return(Read_Metadata_Section(Input_XmlReader, geoInfo, Options));
        }
        /// <summary> Method performs the actual search against the polygon/coordinates
        /// in the METS file for the current item  </summary>
        protected void Perform_Coordinate_Search()
        {
            mapBuilder = new StringBuilder();
            if (CurrentMode.ViewerCode == "mapsearch")
            {
                googleItemSearch = true;
            }

            // If coordinates were passed in, pull the actual coordinates out of the URL
            validCoordinateSearchFound = false;
            if (CurrentMode.Coordinates.Length > 0)
            {
                string[] splitter = CurrentMode.Coordinates.Split(",".ToCharArray());
                if (((splitter.Length > 1) && (splitter.Length < 4)) || ((splitter.Length == 4) && (splitter[2].Length == 0) && (splitter[3].Length == 0)))
                {
                    if ((Double.TryParse(splitter[0], out providedMaxLat)) && (Double.TryParse(splitter[1], out providedMaxLong)))
                    {
                        validCoordinateSearchFound = true;
                    }
                    providedMinLat  = providedMaxLat;
                    providedMinLong = providedMaxLong;
                }
                else if (splitter.Length >= 4)
                {
                    if ((Double.TryParse(splitter[0], out providedMaxLat)) && (Double.TryParse(splitter[1], out providedMaxLong)) &&
                        (Double.TryParse(splitter[2], out providedMinLat)) && (Double.TryParse(splitter[3], out providedMinLong)))
                    {
                        validCoordinateSearchFound = true;
                    }
                }
            }

            // Get the google map API
            mapBuilder.AppendLine("<script type=\"text/javascript\" src=\"http://maps.google.com/maps/api/js?sensor=false\"></script>");
            mapBuilder.AppendLine("<script type=\"text/javascript\" src=\"" + CurrentMode.Base_URL + "default/scripts/sobekcm_map_search.js\"></script>");
            mapBuilder.AppendLine("<script type=\"text/javascript\" src=\"" + CurrentMode.Base_URL + "default/scripts/sobekcm_map_tool.js\"></script>");

            // Set some values for the map key
            string search_type  = "geographic";
            bool   areas_shown  = false;
            bool   points_shown = false;
            string areas_name   = "Sheet";

            if (CurrentItem.Bib_Info.SobekCM_Type == TypeOfResource_SobekCM_Enum.Aerial)
            {
                areas_name = "Tile";
            }

            // Load the map
            mapBuilder.AppendLine("<script type=\"text/javascript\">");
            mapBuilder.AppendLine("  //<![CDATA[");
            mapBuilder.AppendLine("  function load() {");
            mapBuilder.AppendLine(googleItemSearch
                                      ? "    load_search_map(6, 19.5, 3, \"map1\");"
                                      : "    load_map(6, 19.5, 3, \"map1\");");

            // Keep track of any matching tiles
            matchingTilesList = new List <string>();

            // Add the points
            if (CurrentItem != null)
            {
                allPolygons = new List <Coordinate_Polygon>();
                allPoints   = new List <Coordinate_Point>();
                allLines    = new List <Coordinate_Line>();

                // Add the search rectangle first
                if ((validCoordinateSearchFound) && (!googleItemSearch))
                {
                    if ((providedMaxLat != providedMinLat) || (providedMaxLong != providedMinLong))
                    {
                        search_type = "rectangle";
                        mapBuilder.AppendLine("    add_rectangle(" + providedMaxLat + ", " + providedMaxLong + ", " + providedMinLat + ", " + providedMinLong + ");");
                    }
                    else
                    {
                        search_type = "point";
                    }
                }

                // Build the matching polygon HTML to overlay the matches over the non-matches
                StringBuilder matchingPolygonsBuilder = new StringBuilder();

                // Collect all the polygons, points, and lines
                GeoSpatial_Information geoInfo = CurrentItem.Get_Metadata_Module(GlobalVar.GEOSPATIAL_METADATA_MODULE_KEY) as GeoSpatial_Information;
                if ((geoInfo != null) && (geoInfo.hasData))
                {
                    if (geoInfo.Polygon_Count > 0)
                    {
                        foreach (Coordinate_Polygon thisPolygon in geoInfo.Polygons)
                        {
                            allPolygons.Add(thisPolygon);
                        }
                    }
                    if (geoInfo.Line_Count > 0)
                    {
                        foreach (Coordinate_Line thisLine in geoInfo.Lines)
                        {
                            allLines.Add(thisLine);
                        }
                    }
                    if (geoInfo.Point_Count > 0)
                    {
                        foreach (Coordinate_Point thisPoint in geoInfo.Points)
                        {
                            allPoints.Add(thisPoint);
                        }
                    }
                }
                List <abstract_TreeNode> pages = CurrentItem.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))
                    {
                        if (geoInfo2.Polygon_Count > 0)
                        {
                            foreach (Coordinate_Polygon thisPolygon in geoInfo2.Polygons)
                            {
                                thisPolygon.Page_Sequence = (ushort)(i + 1);
                                allPolygons.Add(thisPolygon);
                            }
                        }
                        if (geoInfo2.Line_Count > 0)
                        {
                            foreach (Coordinate_Line thisLine in geoInfo2.Lines)
                            {
                                allLines.Add(thisLine);
                            }
                        }
                        if (geoInfo2.Point_Count > 0)
                        {
                            foreach (Coordinate_Point thisPoint in geoInfo2.Points)
                            {
                                allPoints.Add(thisPoint);
                            }
                        }
                    }
                }


                // Add all the polygons now
                if ((allPolygons.Count > 0) && (allPolygons[0].Edge_Points_Count > 1))
                {
                    areas_shown = true;

                    // Determine a base URL for pointing for any polygons that correspond to a page sequence
                    string currentViewerCode = CurrentMode.ViewerCode;
                    CurrentMode.ViewerCode = "XXXXXXXX";
                    string redirect_url = CurrentMode.Redirect_URL();
                    CurrentMode.ViewerCode = currentViewerCode;

                    // Add each polygon
                    foreach (Coordinate_Polygon itemPolygon in allPolygons)
                    {
                        // Determine if this polygon is within the search
                        bool in_coordinates_search = false;
                        if ((validCoordinateSearchFound) && (!googleItemSearch))
                        {
                            // Was this a point search or area search?
                            if ((providedMaxLong == providedMinLong) && (providedMaxLat == providedMinLat))
                            {
                                // Check this point
                                if (itemPolygon.is_In_Bounding_Box(providedMaxLat, providedMaxLong))
                                {
                                    in_coordinates_search = true;
                                }
                            }
                            else
                            {
                                // Chieck this area search
                                if (itemPolygon.is_In_Bounding_Box(providedMaxLat, providedMaxLong, providedMinLat, providedMinLong))
                                {
                                    in_coordinates_search = true;
                                }
                            }
                        }

                        // Look for a link for this item
                        string link = String.Empty;
                        if ((itemPolygon.Page_Sequence > 0) && (!googleItemSearch))
                        {
                            link = redirect_url.Replace("XXXXXXXX", itemPolygon.Page_Sequence.ToString());
                        }

                        // If this is an item search, don't show labels (too distracting)
                        string label = itemPolygon.Label;
                        if (googleItemSearch)
                        {
                            label = String.Empty;
                        }

                        if (in_coordinates_search)
                        {
                            // Start to call the add polygon method
                            matchingPolygonsBuilder.AppendLine("    add_polygon([");
                            foreach (Coordinate_Point thisPoint in itemPolygon.Edge_Points)
                            {
                                matchingPolygonsBuilder.AppendLine("      new google.maps.LatLng(" + thisPoint.Latitude + ", " + thisPoint.Longitude + "),");
                            }
                            matchingPolygonsBuilder.Append("      new google.maps.LatLng(" + itemPolygon.Edge_Points[0].Latitude + ", " + itemPolygon.Edge_Points[0].Longitude + ")],");
                            matchingPolygonsBuilder.AppendLine("true, '" + label + "', '" + link + "' );");

                            // Also add to the list of matching titles
                            matchingTilesList.Add("<a href=\"" + link + "\">" + itemPolygon.Label + "</a>");
                        }
                        else
                        {
                            // Start to call the add polygon method
                            mapBuilder.AppendLine("    add_polygon([");
                            foreach (Coordinate_Point thisPoint in itemPolygon.Edge_Points)
                            {
                                mapBuilder.AppendLine("      new google.maps.LatLng(" + thisPoint.Latitude + ", " + thisPoint.Longitude + "),");
                            }

                            mapBuilder.Append("      new google.maps.LatLng(" + itemPolygon.Edge_Points[0].Latitude + ", " + itemPolygon.Edge_Points[0].Longitude + ")],");

                            // If just one polygon, still show the red outline
                            if (allPolygons.Count == 1)
                            {
                                mapBuilder.AppendLine("true, '', '" + link + "' );");
                            }
                            else
                            {
                                mapBuilder.AppendLine("false, '" + label + "', '" + link + "' );");
                            }
                        }
                    }

                    // Add any matching polygons last
                    mapBuilder.Append(matchingPolygonsBuilder.ToString());
                }

                // Draw all the single points
                if (allPoints.Count > 0)
                {
                    points_shown = true;
                    for (int point = 0; point < allPoints.Count; point++)
                    {
                        mapBuilder.AppendLine("    add_point(" + allPoints[point].Latitude + ", " + allPoints[point].Longitude + ", '" + allPoints[point].Label + "' );");
                    }
                }

                // If this was a point search, also add the point
                if (validCoordinateSearchFound)
                {
                    if ((providedMaxLat == providedMinLat) && (providedMaxLong == providedMinLong))
                    {
                        search_type = "point";
                        mapBuilder.AppendLine("    add_selection_point(" + providedMaxLat + ", " + providedMaxLong + ", 8 );");
                    }
                }

                // Add the searchable, draggable polygon last (if in search mode)
                if ((validCoordinateSearchFound) && (googleItemSearch))
                {
                    if ((providedMaxLat != providedMinLat) || (providedMaxLong != providedMinLong))
                    {
                        mapBuilder.AppendLine("    add_selection_rectangle(" + providedMaxLat + ", " + providedMaxLong + ", " + providedMinLat + ", " + providedMinLong + " );");
                    }
                }

                // Add the map key
                if (!googleItemSearch)
                {
                    mapBuilder.AppendLine("    add_key(" + search_type + ", " + areas_shown.ToString().ToLower() + ", " + points_shown.ToString().ToLower() + ", '" + areas_name + "');");
                }

                // Zoom appropriately
                mapBuilder.AppendLine(matchingPolygonsBuilder.Length > 0 ? "    zoom_to_selected();" : "    zoom_to_bounds();");
            }


            mapBuilder.AppendLine("  }");
            mapBuilder.AppendLine("  //]]>");
            mapBuilder.AppendLine("</script>");
        }
Пример #5
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);
        }