Example #1
0
 def get_gml_file(self):
     """
     Returns the file path to the file containing the coverage held by the mediator
     :rtype: File
     """
     gml = self.get_gml_coverage().to_gml()
     fu = FileUtil()
     return File(fu.write_to_tmp_file(gml))
Example #2
0
 def _get_data_type(self, slice):
     """
     Returns the data type of the slice by downloading the slice and trying to guess it with GDAL
     :param Slice slice: slice
     :rtype: str
     """
     if isinstance(slice.data_provider, UrlDataProvider):
         # Do this only for coverages that have more than one axis
         if len(slice.axis_subsets) > 1:
             fu = FileUtil()
             contents = validate_and_read_url(slice.data_provider.get_url())
             file_path = fu.write_to_tmp_file(contents, "tif")
             return GDALGmlUtil(file_path).get_band_gdal_type()
     return None