Exemplo n.º 1
0
        private void AddTiledLayer(WMS.Layer wmsLayer, WMS.Style style)
        {
            double baseTileDegrees = 180;
            int    totalLevels     = 12;

            string styles = style != null ? style.Name : "";

            string url = FillBoundingBoxUrl(MakeWmsGetMapUrl(wmsLayer.Name, styles, 0, 0, 0, 0, 256, 256, "", ""));

            int baseLevel = 1;


            string imageType  = ".png";
            double meanRadius = 300000000; //todo

            string referenceFrame = LayerManager.CurrentMap;

            string thumbUrl = "http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=" + referenceFrame;

            ImageSetHelper ish = new ImageSetHelper(wmsLayer.Title, url, ImageSetType.Planet, BandPass.Visible, ProjectionType.Equirectangular, (int)(uint)url.GetHashCode32(), baseLevel, totalLevels, 512, baseTileDegrees, imageType, true, "", 0, 0, 0, false, thumbUrl, false, false, 1, 0, 0, wmsLayer.Abstract, "", "", "", meanRadius, referenceFrame);

            if (AddAsLayer.Checked == false)
            {
                Earth3d.MainWindow.CurrentImageSet = ish;
            }
            else
            {
                ImageSetLayer layer = new ImageSetLayer(ish);
                layer.Enabled        = true;
                layer.Name           = wmsLayer.Title;
                layer.ReferenceFrame = LayerManager.CurrentMap;

                LayerManager.Add(layer, true);
            }
        }
Exemplo n.º 2
0
        public static Tile GetCachedTile(int level, int x, int y, IImageSet dataset, Tile parent)
        {
            if (level < dataset.BaseLevel)
            {
                return(null);
            }

            Tile retTile = null;
            long tileKey = ImageSetHelper.GetTileKey(dataset, level, x, y);

            try
            {
                if (!tiles.ContainsKey(tileKey))
                {
                    return(null);
                }
                else
                {
                    retTile = tiles[tileKey];
                }
            }
            catch
            {
                if (Earth3d.Logging)
                {
                    Earth3d.WriteLogMessage("Tile Initialize: Exception");
                }
            }



            return(retTile);
        }
Exemplo n.º 3
0
        private void AddTiledLayer(WMS_Tile_ServiceTiledPatternsTiledGroup tileGroup)
        {
            string tilePatern = GetPattern(tileGroup.TilePattern[0].Value);

            double degrees = GetLngDegrees(tilePatern);

            foreach (WMS_Tile_ServiceTiledPatternsTiledGroupTilePattern pat in tileGroup.TilePattern)
            {
                double deg = GetLngDegrees(pat.Value);

                if (deg < degrees)
                {
                    degrees = deg;
                }
            }



            double baseTileDegrees = degrees;
            int    totalLevels     = -1;

            while (baseTileDegrees < 180)
            {
                totalLevels++;
                baseTileDegrees *= 2;
            }


            string url       = serviceUrl + FillBoundingBoxUrl(tilePatern.Replace("&time=${time}", ""));
            int    baseLevel = 3;

            //if (tileGroup.TilePattern.Length > totalLevels)
            {
                //     baseLevel = (totalLevels +8) - tileGroup.TilePattern.Length;
            }


            string imageType  = ".png";
            double meanRadius = 300000000; //todo

            string referenceFrame = LayerManager.CurrentMap;

            string thumbUrl = "http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=" + referenceFrame;

            ImageSetHelper ish = new ImageSetHelper(tileGroup.Title, url, ImageSetType.Planet, BandPass.Visible, ProjectionType.Equirectangular, (int)(uint)url.GetHashCode32(), baseLevel, totalLevels, 512, baseTileDegrees, imageType, true, "", 0, 0, 0, false, thumbUrl, false, false, 1, 0, 0, tileGroup.Abstract, "", "", "", meanRadius, referenceFrame);

            if (AddAsLayer.Checked == false)
            {
                Earth3d.MainWindow.CurrentImageSet = ish;
            }
            else
            {
                ImageSetLayer layer = new ImageSetLayer(ish);
                layer.Enabled        = true;
                layer.Name           = tileGroup.Title;
                layer.ReferenceFrame = LayerManager.CurrentMap;

                LayerManager.Add(layer, true);
            }
        }
Exemplo n.º 4
0
        public override void ProcessRequest(string request, ref Socket socket, bool authenticated, string body)
        {
            QueryString query = new QueryString(request);

            String sMimeType = "text/xml";
            string data      = "";

            string id   = query.GetValues("id")[0];
            int    hash = 0;

            try
            {
                hash = Convert.ToInt32(id);
                if (Earth3d.ImagesetHashTable.ContainsKey(hash))
                {
                    StringBuilder sb = new StringBuilder();
                    StringWriter  sw = new StringWriter(sb);
                    using (XmlTextWriter xmlWriter = new XmlTextWriter(sw))
                    {
                        xmlWriter.Formatting = Formatting.Indented;
                        xmlWriter.WriteProcessingInstruction("xml", "version='1.0' encoding='UTF-8'");
                        xmlWriter.WriteStartElement("Folder");

                        IImageSet imageset     = (IImageSet)Earth3d.ImagesetHashTable[hash];
                        string    alternateUrl = "";

                        try
                        {
                            if (File.Exists(imageset.Url))
                            {
                                alternateUrl = string.Format("http://{0}:5050/imageset/{1}/{2}", MyWebServer.IpAddress, hash, Path.GetFileName(imageset.Url));
                            }
                        }
                        catch
                        {
                        }
                        ImageSetHelper.SaveToXml(xmlWriter, imageset, alternateUrl);
                        xmlWriter.WriteFullEndElement();
                        xmlWriter.Close();
                    }
                    data = sb.ToString();
                }
            }
            catch
            {
            }


            SendHeaderAndData(data, ref socket, sMimeType);
        }
Exemplo n.º 5
0
        internal void SaveToXml(System.Xml.XmlTextWriter xmlWriter, string elementName)
        {
            xmlWriter.WriteStartElement(elementName);
            xmlWriter.WriteAttributeString("Name", name);
            xmlWriter.WriteAttributeString("DataSetType", this.Type.ToString());
            if (this.Type == ImageSetType.Sky)
            {
                xmlWriter.WriteAttributeString("RA", camParams.RA.ToString());
                xmlWriter.WriteAttributeString("Dec", camParams.Dec.ToString());
            }
            else
            {
                xmlWriter.WriteAttributeString("Lat", Lat.ToString());
                xmlWriter.WriteAttributeString("Lng", Lng.ToString());
            }

            xmlWriter.WriteAttributeString("Constellation", constellation);
            xmlWriter.WriteAttributeString("Classification", Classification.ToString());
            xmlWriter.WriteAttributeString("Magnitude", magnitude.ToString());
            xmlWriter.WriteAttributeString("Distance", distnace.ToString());
            xmlWriter.WriteAttributeString("AngularSize", AngularSize.ToString());
            xmlWriter.WriteAttributeString("ZoomLevel", ZoomLevel.ToString());
            xmlWriter.WriteAttributeString("Rotation", camParams.Rotation.ToString());
            xmlWriter.WriteAttributeString("Angle", camParams.Angle.ToString());
            xmlWriter.WriteAttributeString("Opacity", camParams.Opacity.ToString());
            xmlWriter.WriteAttributeString("Target", Target.ToString());
            xmlWriter.WriteAttributeString("ViewTarget", camParams.ViewTarget.ToString());
            xmlWriter.WriteAttributeString("TargetReferenceFrame", camParams.TargetReferenceFrame);
            xmlWriter.WriteAttributeString("DomeAlt", camParams.DomeAlt.ToString());
            xmlWriter.WriteAttributeString("DomeAz", camParams.DomeAz.ToString());
            xmlWriter.WriteStartElement("Description");
            xmlWriter.WriteCData(HtmlDescription);
            xmlWriter.WriteEndElement();


            if (backgroundImageSet != null)
            {
                xmlWriter.WriteStartElement("BackgroundImageSet");
                ImageSetHelper.SaveToXml(xmlWriter, backgroundImageSet, "");
                xmlWriter.WriteEndElement();
            }

            if (studyImageset != null)
            {
                ImageSetHelper.SaveToXml(xmlWriter, studyImageset, "");
            }
            xmlWriter.WriteEndElement();
        }
Exemplo n.º 6
0
        public static Tile GetTileNow(int level, int x, int y, IImageSet dataset, Tile parent)
        {
            if (level < dataset.BaseLevel)
            {
                return(null);
            }

            Tile retTile = null;
            long tileKey = ImageSetHelper.GetTileKey(dataset, level, x, y);

            try
            {
                if (!tiles.ContainsKey(tileKey))
                {
                    retTile = ImageSetHelper.GetNewTile(dataset, level, x, y, parent);
                    tileMutex.WaitOne();
                    tiles.Add(tileKey, retTile);
                    tileMutex.ReleaseMutex();
                }
                else
                {
                    retTile = tiles[tileKey];
                }
            }
            catch
            {
                if (Earth3d.Logging)
                {
                    Earth3d.WriteLogMessage("GetTile: Exception");
                }
            }
            finally
            {
                //todoperf get rid of this write for GC
                retTile.AccessCount = AccessID++;
            }

            // Create if not ready to render

            if (!retTile.ReadyToRender)
            {
                TileCache.GetTileFromWeb(retTile, false);
                retTile.CreateGeometry(Earth3d.MainWindow.RenderContext11, false);
            }


            return(retTile);
        }
        public override void WriteLayerProperties(System.Xml.XmlTextWriter xmlWriter)
        {
            if (imageSet.WcsImage != null)
            {
                xmlWriter.WriteAttributeString("Extension", Path.GetExtension(imageSet.WcsImage.Filename));
            }

            if (imageSet.WcsImage is FitsImage)
            {
                FitsImage fi = imageSet.WcsImage as FitsImage;
                xmlWriter.WriteAttributeString("ScaleType", fi.lastScale.ToString());
                xmlWriter.WriteAttributeString("MinValue", fi.lastBitmapMin.ToString());
                xmlWriter.WriteAttributeString("MaxValue", fi.lastBitmapMax.ToString());
            }

            xmlWriter.WriteAttributeString("OverrideDefault", overrideDefaultLayer.ToString());

            ImageSetHelper.SaveToXml(xmlWriter, imageSet, "");
            base.WriteLayerProperties(xmlWriter);
        }
        public override void InitializeFromXml(System.Xml.XmlNode node)
        {
            XmlNode imageSetNode = node["ImageSet"];

            ImageSetHelper ish = ImageSetHelper.FromXMLNode(imageSetNode);

            if (!String.IsNullOrEmpty(ish.Url) && Earth3d.ReplacementImageSets.ContainsKey(ish.Url))
            {
                imageSet = Earth3d.ReplacementImageSets[ish.Url];
            }
            else
            {
                imageSet = ish;
            }

            if (node.Attributes["Extension"] != null)
            {
                extension = node.Attributes["Extension"].Value;
            }

            if (node.Attributes["ScaleType"] != null)
            {
                lastScale = (ScaleTypes)Enum.Parse(typeof(ScaleTypes), node.Attributes["ScaleType"].Value);
            }

            if (node.Attributes["MinValue"] != null)
            {
                min = double.Parse(node.Attributes["MinValue"].Value);
            }

            if (node.Attributes["MaxValue"] != null)
            {
                max = double.Parse(node.Attributes["MaxValue"].Value);
            }

            if (node.Attributes["OverrideDefault"] != null)
            {
                overrideDefaultLayer = bool.Parse(node.Attributes["OverrideDefault"].Value);
            }
        }
Exemplo n.º 9
0
        public static Tile GetTile(int level, int x, int y, IImageSet dataset, Tile parent)
        {
            if (level < dataset.BaseLevel)
            {
                return(null);
            }

            Tile retTile = null;
            long tileKey = ImageSetHelper.GetTileKey(dataset, level, x, y);

            try
            {
                if (!tiles.ContainsKey(tileKey))
                {
                    retTile = ImageSetHelper.GetNewTile(dataset, level, x, y, parent);
                    tileMutex.WaitOne();
                    tiles.Add(tileKey, retTile);
                    tileMutex.ReleaseMutex();
                }
                else
                {
                    retTile = tiles[tileKey];
                }
            }
            catch
            {
                if (Earth3d.Logging)
                {
                    Earth3d.WriteLogMessage("GetTile: Exception");
                }
            }
            finally
            {
                //todoperf get rid of this write for GC
                retTile.AccessCount = AccessID++;
            }


            return(retTile);
        }
Exemplo n.º 10
0
        private void AddTiledLayer(WMS.Layer wmsLayer, Style style)
        {
            double baseTileDegrees = 180;
            var totalLevels = 12;

            var styles = style != null ? style.Name : "";

            var url = FillBoundingBoxUrl(MakeWmsGetMapUrl(wmsLayer.Name, styles, 0, 0, 0, 0, 256, 256, "", ""));

            var baseLevel = 1;

            var imageType = ".png";
            double meanRadius = 300000000; //todo

            var referenceFrame = LayerManager.CurrentMap;

            var thumbUrl = "http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=" + referenceFrame;

            var ish = new ImageSetHelper(wmsLayer.Title, url, ImageSetType.Planet, BandPass.Visible, ProjectionType.Equirectangular, (int)(uint)url.GetHashCode32(), baseLevel, totalLevels, 512, baseTileDegrees, imageType, true, "", 0, 0, 0, false, thumbUrl, false, false, 1, 0, 0, wmsLayer.Abstract, "", "", "", meanRadius, referenceFrame);

            if (AddAsLayer.Checked == false)
            {
                Earth3d.MainWindow.CurrentImageSet = ish;
            }
            else
            {
                var layer = new ImageSetLayer(ish);
                layer.Enabled = true;
                layer.Name = wmsLayer.Title;
                layer.ReferenceFrame = LayerManager.CurrentMap;

                LayerManager.Add(layer, true);
            }
        }
Exemplo n.º 11
0
        private void AddTiledLayer(WMS_Tile_ServiceTiledPatternsTiledGroup tileGroup)
        {
            var tilePatern = GetPattern(tileGroup.TilePattern[0].Value);

            var degrees = GetLngDegrees(tilePatern);

            foreach(var pat in tileGroup.TilePattern)
            {
                var deg = GetLngDegrees(pat.Value);

                if (deg < degrees)
                {
                    degrees = deg;
                }
            }

            var baseTileDegrees = degrees;
            var totalLevels = -1;

            while (baseTileDegrees < 180)
            {
                totalLevels++;
                baseTileDegrees *= 2;
            }

            var url = serviceUrl + FillBoundingBoxUrl(tilePatern.Replace("&time=${time}",""));
            var baseLevel = 3;

            //if (tileGroup.TilePattern.Length > totalLevels)
            {
               //     baseLevel = (totalLevels +8) - tileGroup.TilePattern.Length;
            }

            var imageType = ".png";
            double meanRadius = 300000000; //todo

            var referenceFrame = LayerManager.CurrentMap;

            var thumbUrl = "http://www.worldwidetelescope.org/wwtweb/thumbnail.aspx?name=" + referenceFrame;

            var ish = new ImageSetHelper(tileGroup.Title, url, ImageSetType.Planet, BandPass.Visible, ProjectionType.Equirectangular, (int)(uint)url.GetHashCode32(), baseLevel, totalLevels, 512, baseTileDegrees, imageType, true,"", 0, 0, 0, false, thumbUrl, false, false, 1, 0, 0, tileGroup.Abstract, "", "", "", meanRadius, referenceFrame);

            if (AddAsLayer.Checked == false)
            {
                Earth3d.MainWindow.CurrentImageSet = ish;
            }
            else
            {
                var layer = new ImageSetLayer(ish);
                layer.Enabled = true;
                layer.Name = tileGroup.Title;
                layer.ReferenceFrame = LayerManager.CurrentMap;

                LayerManager.Add(layer, true);
            }
        }
Exemplo n.º 12
0
        internal static TourPlace FromXml(XmlNode place)
        {
            TourPlace newPlace = new TourPlace();

            newPlace.name = place.Attributes["Name"].Value;
            newPlace.Type = (ImageSetType)Enum.Parse(typeof(ImageSetType), place.Attributes["DataSetType"].Value);
            if (newPlace.Type == ImageSetType.Sky)
            {
                newPlace.camParams.RA  = Convert.ToDouble(place.Attributes["RA"].Value);
                newPlace.camParams.Dec = Convert.ToDouble(place.Attributes["Dec"].Value);
            }
            else
            {
                newPlace.Lat = Convert.ToDouble(place.Attributes["Lat"].Value);
                newPlace.Lng = Convert.ToDouble(place.Attributes["Lng"].Value);
            }

            newPlace.constellation  = place.Attributes["Constellation"].Value;
            newPlace.Classification = (Classification)Enum.Parse(typeof(Classification), place.Attributes["Classification"].Value);
            newPlace.magnitude      = Convert.ToDouble(place.Attributes["Magnitude"].Value);
            if (place.Attributes["Magnitude"] != null)
            {
                newPlace.magnitude = Convert.ToDouble(place.Attributes["Magnitude"].Value);
            }
            newPlace.AngularSize        = Convert.ToDouble(place.Attributes["AngularSize"].Value);
            newPlace.ZoomLevel          = Convert.ToDouble(place.Attributes["ZoomLevel"].Value);
            newPlace.camParams.Rotation = Convert.ToDouble(place.Attributes["Rotation"].Value);
            newPlace.camParams.Angle    = Convert.ToDouble(place.Attributes["Angle"].Value);
            if (place.Attributes["Opacity"] != null)
            {
                newPlace.camParams.Opacity = Convert.ToSingle(place.Attributes["Opacity"].Value);
            }
            else
            {
                newPlace.camParams.Opacity = 100;
            }

            if (place.Attributes["Target"] != null)
            {
                newPlace.Target = (SolarSystemObjects)Enum.Parse(typeof(SolarSystemObjects), place.Attributes["Target"].Value);
            }

            if (place.Attributes["ViewTarget"] != null)
            {
                newPlace.camParams.ViewTarget = Vector3d.Parse(place.Attributes["ViewTarget"].Value);
            }

            if (place.Attributes["TargetReferenceFrame"] != null)
            {
                newPlace.camParams.TargetReferenceFrame = place.Attributes["TargetReferenceFrame"].Value;
            }

            if (place.Attributes["DomeAlt"] != null)
            {
                newPlace.camParams.DomeAlt = Convert.ToDouble(place.Attributes["DomeAlt"].Value);
            }

            if (place.Attributes["DomeAz"] != null)
            {
                newPlace.camParams.DomeAz = Convert.ToDouble(place.Attributes["DomeAz"].Value);
            }

            XmlNode descriptionNode = place["Description"];

            if (descriptionNode != null)
            {
                newPlace.HtmlDescription = descriptionNode.Value;
            }

            XmlNode backgroundImageSet = place["BackgroundImageSet"];

            if (backgroundImageSet != null)
            {
                XmlNode imageSet = backgroundImageSet["ImageSet"];

                ImageSetHelper ish = ImageSetHelper.FromXMLNode(imageSet);

                if (!String.IsNullOrEmpty(ish.Url) && Earth3d.ReplacementImageSets.ContainsKey(ish.Url))
                {
                    newPlace.backgroundImageSet = Earth3d.ReplacementImageSets[ish.Url];
                }
                else
                {
                    newPlace.backgroundImageSet = ish;
                }
            }

            XmlNode study = place["ImageSet"];

            if (study != null)
            {
                ImageSetHelper ish = ImageSetHelper.FromXMLNode(study);

                if (!String.IsNullOrEmpty(ish.Url) && Earth3d.ReplacementImageSets.ContainsKey(ish.Url))
                {
                    newPlace.studyImageset = Earth3d.ReplacementImageSets[ish.Url];
                }
                else
                {
                    newPlace.studyImageset = ish;
                }
            }
            return(newPlace);
        }
Exemplo n.º 13
0
        private bool SetBackgroundByName(Folder folder, string name)
        {
            foreach (object o in folder.Children)
            {
                if (o is IPlace)
                {

                    IPlace place = (IPlace)o;

                    if (place.Name.ToLower().Contains(name.ToLower()))
                    {
                        if (place.BackgroundImageSet != null && place.BackgroundImageSet.DataSetType != Earth3d.MainWindow.CurrentImageSet.DataSetType)
                        {
                            continue;
                        }
                        if (place.Classification == Classification.SolarSystem && Earth3d.MainWindow.CurrentImageSet.DataSetType == ImageSetType.SolarSystem)
                        {
                            CurrentImageSet = new ImageSetHelper(ImageSetType.SolarSystem, BandPass.Visible);
                        }
                        IImageSet imageSet = null;
                        if (place.StudyImageset != null)
                        {
                            imageSet = place.StudyImageset;
                        }
                        if (place.BackgroundImageSet != null)
                        {
                            imageSet = place.BackgroundImageSet;
                        }

                        if (imageSet != null)
                        {
                            this.CurrentImageSet = imageSet;
                        }
                        GotoTarget(place, false, false, true);
                        return true;
                    }
                }
            }
            return false;
        }
Exemplo n.º 14
0
        private void LoadImage(string filename)
        {
            WcsImage wcsImage = WcsImage.FromFile(filename);

            bool hasAvm = wcsImage.ValidWcs;
            {
                Bitmap bmp = wcsImage.GetBitmap();
                wcsImage.AdjustScale(bmp.Width, bmp.Height);

                ImageSetHelper imageSet = null;
                TourPlace place = null;
                if (hasAvm)
                {
                    imageSet = new ImageSetHelper(wcsImage.Description, filename, ImageSetType.Sky, BandPass.Visible, ProjectionType.SkyImage, Math.Abs(filename.GetHashCode32()), 0, 0, 256, wcsImage.ScaleY, ".tif", wcsImage.ScaleX > 0, "", wcsImage.CenterX, wcsImage.CenterY, wcsImage.Rotation, false, "", false, false, 1, wcsImage.ReferenceX, wcsImage.ReferenceY, wcsImage.Copyright, wcsImage.CreditsUrl, "", "", 0, "");
                    place = new TourPlace(UiTools.GetNamesStringFromArray(wcsImage.Keywords.ToArray()), wcsImage.CenterY, wcsImage.CenterX / 15, Classification.Unidentified, constellationCheck.FindConstellationForPoint(wcsImage.CenterX, wcsImage.CenterY), ImageSetType.Sky, -1);
                }
                else
                {

                    imageSet = new ImageSetHelper(wcsImage.Description, filename, ImageSetType.Sky, BandPass.Visible, ProjectionType.SkyImage, Math.Abs(filename.GetHashCode32()), 0, 0, 256, .001, ".tif", false, "", RA * 15, ViewLat, 0, false, "", false, false, 1, bmp.Width / 2, bmp.Height / 2, wcsImage.Copyright, wcsImage.CreditsUrl, "", "", 0, "");
                    place = new TourPlace(UiTools.GetNamesStringFromArray(wcsImage.Keywords.ToArray()), this.ViewLat, RA, Classification.Unidentified, constellationCheck.FindConstellationForPoint(wcsImage.CenterX, wcsImage.CenterY), ImageSetType.Sky, -1);
                }
                imageSet.WcsImage = wcsImage;
                place.StudyImageset = imageSet;
                place.Tag = wcsImage;
                Place pl = Place.FromIPlace(place);

                pl.ThumbNail = UiTools.MakeThumbnail(bmp);
                StudyImageset = pl.StudyImageset;
                GotoTarget(pl, false, false, true);



                explorePane.OpenImages.AddChildPlace(pl);

                bmp.Dispose();
                GC.SuppressFinalize(bmp);
                bmp = null;

                explorePane.ShowOpenImages();

            }
            if (!hasAvm)
            {
                MessageBox.Show(Language.GetLocalizedText(112, "The image file did not contain recognizable WCS or AVM Metadata to position it in the sky"), Language.GetLocalizedText(113, "Load Image"), MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
            }
        }
Exemplo n.º 15
0
        public ArrayList GetPlaceList()
        {
            if (dataList == null || CheckExpiration())
            {
                dataList = new System.Collections.ArrayList();
                if (dataSetType == DataSetType.Place)
                {
                    DataSetManager.DownloadFile(url, Properties.Settings.Default.CahceDirectory + @"data\places\" + name + ".txt", false, true);


                    TourPlace    place;
                    StreamReader sr = new StreamReader(Properties.Settings.Default.CahceDirectory + @"data\places\" + name + ".txt");
                    string       line;
                    while (sr.Peek() >= 0)
                    {
                        line = sr.ReadLine();

                        place = new TourPlace(line, sky);
                        dataList.Add(place);
                    }
                    sr.Close();
                }
                else if (dataSetType == DataSetType.Imageset)
                {
                    string filename = Properties.Settings.Default.CahceDirectory + @"data\places\" + name + ".xml";

                    DataSetManager.DownloadFile(url, filename, false, true);



                    XmlDocument doc = new XmlDocument();
                    doc.Load(filename);

                    if (!Directory.Exists(Properties.Settings.Default.CahceDirectory + @"thumbnails\"))
                    {
                        Directory.CreateDirectory(Properties.Settings.Default.CahceDirectory + @"thumbnails\");
                    }

                    XmlNode imageSets = doc["ImageSets"];
                    if (imageSets == null)
                    {
                        imageSets = doc["Folder"];
                    }

                    foreach (XmlNode imageset in imageSets.ChildNodes)
                    {
                        ImageSetHelper newImageset = ImageSetHelper.FromXMLNode(imageset);
                        if (newImageset != null)
                        {
                            TourPlace newPlace = new TourPlace(newImageset.Name, (newImageset.CenterY), (newImageset.CenterX) / 15, Classification.Unidentified, "Err", ImageSetType.Sky, newImageset.BaseTileDegrees * 10);
                            newPlace.StudyImageset = newImageset;

                            newPlace.ThumbNail = UiTools.LoadThumbnailFromWeb(newImageset.ThumbnailUrl);
                            dataList.Add(newPlace);
                            if (!String.IsNullOrEmpty(newImageset.AltUrl) && !Earth3d.ReplacementImageSets.ContainsKey(newImageset.AltUrl))
                            {
                                Earth3d.ReplacementImageSets.Add(newImageset.AltUrl, newImageset);
                            }
                        }
                    }
                }
            }
            return(dataList);
        }