Ejemplo n.º 1
0
        public void DatasetTest_SRTM_GL1()
        {
            DEMDataSet dataset = DEMDataSet.SRTM_GL1;

            _gdalService.Setup(dataset, _rasterService.GetLocalDEMPath(dataset));

            Assert.True(_gdalService.Sources(dataset).Any());
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Compare LST file and local directory and generates dictionary with key : remoteFile and value = true if file is present and false if it is not downloaded
        /// </summary>
        /// <param name="dataSet">DEM dataset information</param>
        /// <param name="bbox">Bbox for filtering</param>
        /// <returns>A Dictionnary</returns>
        public List <DemFileReport> GenerateReport(DEMDataSet dataSet, BoundingBox bbox = null)
        {
            List <DemFileReport> statusByFile = new List <DemFileReport>();

            if (dataSet.DataSource.IsGlobalFile)
            {
                statusByFile.Add(new DemFileReport()
                {
                    IsExistingLocally   = File.Exists(dataSet.DataSource.IndexFilePath),
                    IsMetadataGenerated = File.Exists(GetMetadataFileName(dataSet.DataSource.IndexFilePath, ".json")),
                    LocalName           = dataSet.DataSource.IndexFilePath,
                    URL = dataSet.DataSource.IndexFilePath
                });
            }
            else
            {
                _gdalVrtService.Setup(dataSet, GetLocalDEMPath(dataSet));

                foreach (GDALSource source in _gdalVrtService.Sources(dataSet))
                {
                    if (bbox == null || BoundingBoxIntersects(source.BBox, bbox))
                    {
                        statusByFile.Add(new DemFileReport()
                        {
                            IsExistingLocally   = File.Exists(source.LocalFileName),
                            IsMetadataGenerated = File.Exists(GetMetadataFileName(source.LocalFileName, ".json")),
                            LocalName           = source.LocalFileName,
                            URL    = source.SourceFileNameAbsolute,
                            Source = source
                        });
                    }
                }
            }

            return(statusByFile);
        }