Exemplo n.º 1
0
 def _get_coverage(self):
     """
     Returns the coverage to be used for the importer
     """
     gdal_dataset = GDALGmlUtil(self.session.get_files()[0].get_filepath())
     slices = self._get_slices(gdal_dataset)
     fields = GdalRangeFieldsGenerator(gdal_dataset, self.options['band_names']).get_range_fields()
     coverage = Coverage(self.session.get_coverage_id(), slices, fields, gdal_dataset.get_crs(),
         gdal_dataset.get_band_gdal_type(), self.options['tiling'])
     return coverage
Exemplo n.º 2
0
 def _get_coverage(self):
     # Get the crs of one of the images using a GDAL helper class. We are assuming all images have the same CRS
     gdal_dataset = GDALGmlUtil(self.session.get_files()[0].get_filepath())
     # Get the crs of the coverage by compounding the two crses
     crs = CRSUtil.get_compound_crs(
         [gdal_dataset.get_crs(), self.options['time_crs']])
     fields = GdalRangeFieldsGenerator(gdal_dataset).get_range_fields()
     pixel_type = gdal_dataset.get_band_gdal_type()
     coverage_id = self.session.get_coverage_id()
     slices = self._get_slices(crs)
     return Coverage(coverage_id, slices, fields, crs, pixel_type)
Exemplo n.º 3
0
 def _get_coverage(self):
     """
     Returns the coverage to be used for the importer
     """
     gdal_dataset = GDALGmlUtil(self.session.get_files()[0].get_filepath())
     slices = self._get_slices(gdal_dataset)
     fields = GdalRangeFieldsGenerator(
         gdal_dataset, self.options['band_names']).get_range_fields()
     coverage = Coverage(self.session.get_coverage_id(), slices, fields,
                         gdal_dataset.get_crs(),
                         gdal_dataset.get_band_gdal_type(),
                         self.options['tiling'])
     return coverage
Exemplo n.º 4
0
 def _get_coverage(self):
     # Get the crs of one of the images using a GDAL helper class. We are assuming all images have the same CRS
     for file in self.session.get_files():
         try:
             file_path = file.get_filepath()
             gdal_dataset = GDALGmlUtil(file_path)
             break
         except Exception as e:
             if ConfigManager.skip == True:
                 pass
             else:
                 raise e
     # Get the crs of the coverage by compounding the two crses
     crs = CRSUtil.get_compound_crs([gdal_dataset.get_crs(), self.options['time_crs']])
     fields = GdalRangeFieldsGenerator(gdal_dataset).get_range_fields()
     pixel_type = gdal_dataset.get_band_gdal_type()
     coverage_id = self.session.get_coverage_id()
     slices = self._get_slices(crs)
     return Coverage(coverage_id, slices, fields, crs, pixel_type)