Example #1
0
        public List <OsmGeo> GetOsmGeoList(MapBounds mapbounds)
        {
            var task = this.Client
                       .GetStreamAsync($"{BaseAddress}/map?bbox={mapbounds.Left},{mapbounds.Bottom},{mapbounds.Right},{mapbounds.Top}");

            using (var stream = new XmlOsmStreamSource(task.Result))
            {
                return(stream.ToList());
            }
        }
        public List <OsmGeo> GetOsmGeoList(MapBounds mapbounds)
        {
            string suffix   = $"map?bbox={mapbounds.Left}%2C{mapbounds.Bottom}%2C{mapbounds.Right}%2C{mapbounds.Top}";
            string filename = $"{OsmDetailsFile}_{MapBounds.Serialize(mapbounds).GetHashCode()}.xml";

            Console.WriteLine($"!ACESAPI:acesHttpOperation(osmParam,{suffix},,,file://{filename})");

            if (!WaitForInput())
            {
                throw new Exception($"Error in getting {filename}");
            }

            Console.WriteLine($"Downloaded osm for: {MapBounds.Serialize(mapbounds)}");

            using (var stream = new XmlOsmStreamSource(File.Open(filename, FileMode.Open)))
            {
                return(stream.ToList());
            }
        }