def can_read(url, *args, **kwargs): # Todo update for girder-hosted files if not isinstance(url, str): return False extension = get_uri_extension(url) if extension == 'tif' or extension == 'tiff': return True return False
def can_read(data_source, *args, **kwargs): if isinstance(data_source, string_types): # Check string for a supported filename/url extension = '.{}'.format(get_uri_extension(data_source)) if extension in formats.VECTOR: return True return False elif isinstance(data_source, geojson.GeoJSON): return True
def __init__(self, url, *args, **kwargs): super(GaiaGDALReader, self).__init__(*args, **kwargs) self.uri = url self.ext = '.%s' % get_uri_extension(self.uri) self.as_numpy_array = False self.as_single_band = True self.old_nodata = None self.new_nodata = None
def __init__(self, data_source, *args, **kwargs): super(GaiaGeoJSONReader, self).__init__(*args, **kwargs) self.geojson_object = None self.uri = None self.ext = None if isinstance(data_source, string_types): self.uri = data_source self.ext = '.%s' % get_uri_extension(self.uri) elif isinstance(data_source, geojson.GeoJSON): self.geojson_object = data_source
def write_dataset(raster_dataset, filepath, fileFormat=None): # if no fileFormat is provide, it will be looked up from the filepath driverName = fileFormat if not driverName: ext = get_uri_extension(filepath) if ext in driver_lookup: driverName = driver_lookup[ext] else: msg = 'No format provide, could not be guessed from %s' % filepath raise UnsupportedFormatException(msg) output_driver = gdal.GetDriverByName(driverName) outfile = output_driver.CreateCopy(filepath, raster_dataset, False) logger.debug(str(outfile)) outfile = None
def can_read(*args, **kwargs): if 'uri' in kwargs: extension = get_uri_extension(kwargs['uri']) if extension == 'geojson': return True return False
def __init__(self, *args, **kwargs): super(GaiaGeoJSONReader, self).__init__(*args, **kwargs) if 'uri' in kwargs: self.uri = kwargs['uri'] self.ext = '.%s' % get_uri_extension(self.uri)