예제 #1
0
파일: recipe.py 프로젝트: akarmas/rasdaman
 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
예제 #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)
예제 #3
0
파일: recipe.py 프로젝트: javyxu/rasdaman
 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
예제 #4
0
 def _init_epsg_xy_crs(self):
     """
     From the first file of input file, detect its EPSG code for XY axes
     """
     for file in self.session.get_files():
         try:
             gdal_ds = GDALGmlUtil(file.get_filepath())
             self.epsg_xy_crs = gdal_ds.get_crs()
             break
         except Exception as e:
             if ConfigManager.skip == True:
                 pass
             else:
                 raise e
예제 #5
0
파일: recipe.py 프로젝트: kalxas/rasdaman
 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)
예제 #6
0
 def _init_epsg_xy_crs(self):
     """
     From the first file of input file, detect its EPSG code for XY axes
     """
     gdal_ds = GDALGmlUtil(self.session.get_files()[0].get_filepath())
     self.epsg_xy_crs = gdal_ds.get_crs()