Beispiel #1
0
        void GetByArea(Vector2 leftBottom, Vector2 rightTop, string fileName)
        {
            string filePath = @"cache\OpenStreetMap\GeoObjects\" + fileName + ".xml";

            XmlDocument xmlDoc;

            if (File.Exists(filePath))
            {
                xmlDoc = new XmlDocument();
                xmlDoc.Load(filePath);
            }
            else
            {
                xmlDoc = downloader.DownloadXml(GenerateUrl(leftBottom.X, leftBottom.Y, rightTop.X, rightTop.Y), filePath);
            }

            ParseXml(xmlDoc);
        }
        XmlDocument LoadWikiDocument(string url, string path)
        {
            XmlDocument xmlDoc;

            if (File.Exists(path))
            {
                xmlDoc = new XmlDocument();
                xmlDoc.Load(path);
            }
            else
            {
                xmlDoc = downloader.DownloadXml(url, path);
            }
            return(xmlDoc);
        }