Exemplo n.º 1
0
        private async Task DownloadMapData(string id, string title, DateTime ingestionDate)
        {
            Console.WriteLine("Downloading file");
            MyProgress.ProgressChanged += (sender, value) =>
            {
                value = Math.Round(value);

                if (value == _old)
                {
                    Console.WriteLine(value + "% downloaded ");
                    _old = value + 10;
                }
            };
            CopernicusService service = new CopernicusService(username, password);

            await service.DownloadMetaDataAsync("/app/Copernicus/Downloads", MyProgress, id : id);

            Console.WriteLine("File downloaded");
            ExtractData(id, title, ingestionDate);
        }
Exemplo n.º 2
0
        public static async Task Teste()
        {
            MyProgress.ProgressChanged += (sender, value) =>
            {
                value = Math.Round(value, 2);

                if (value != old)
                {
                    Console.WriteLine($"{value} %");
                }

                old = value;
            };

            CopernicusService service = new CopernicusService("userName", "password");
            string            id      = "'fea3cd38-918d-4974-8586-2578cbb07844'";
            var teste = await service.GetDataAsync(id : id);

            var    test2 = teste.ExtractJsonId();
            string url   = $"https://scihub.copernicus.eu/dhus/odata/v1/Products({id})/$value";

            Console.WriteLine($"\n\n\n {url}");
            var seila = await service.DownloadMetaDataAsync(@"C:\Users\pedro\Desktop\Teste", MyProgress, id : id);
        }