Raster

class caris.coverage.Raster([filename = ''[, uri = ''[, options = None]]])

Raster

__init__()

Constructor

Only use one of filename or uri (use named parameters for uri) All parameters are optional.

Keyword Arguments:
 
  • filename (str) – The filename of the opened csar file.
  • uri (str) – The uri of the opened csar file.
  • options (Options) – Options to use when opening the csar file. Defaults to READ mode if no options supplied
add_band()

Add a new band

Parameters:band_info (BandInfo) – The BandInfo describing the band to be added
create_copy()

Save a copy of this Raster

Either uri or path must be specified.

Keyword Arguments:
 
  • path (str) – The file path of the destination CSAR file”
  • uri (str) – The file uri of the destination CSAR file.”
read()

Read raster data

Parameters:
  • band_name (str) – The band to read from.
  • area (((x1, y1), (x2, y2))) – The area to read from.
  • level (int, optional) – The resolution level to read from. Defaults to hi_level.
read_np_array()

Read raster data as a numpy array

Parameters:
  • band_name (str) – The band to read from.
  • area (tuple) – The area to read from. ((offset_x, offset_y), (width, height))
  • level (int, optional) – The resolution level to read from. Defaults to hi_level.
Returns:

The data read”

Return type:

numpy.ndarray

remove_band()

Remove a band

Parameters:band_name (str) – The name of the band to be removed.
write()

Write data to a Raster

Parameters:
  • band_name (str) – The name of the band to write to
  • offset ((x (int), y (int))) – The offset into the Raster to begin the write
  • data (numpy.ndarray) – The data to write”
band_info

dict – The dictionary of (key=band_name, value= BandInfo)

block_size

(width, height) of int – The recommended block size to use when reading.

dims

(width, height) of int – The dimensions in pixels of the raster

elevation_band_name

str – The default elevation band name.

extents

((x1, y1), (x2, y2)) of double – The extents of the raster

highest_level

int – The highest resolution level.

iso19139_xml

str – The iso xml metadata

lowest_level

int – The lowest resolution level.

transform

RasterTransform – The raster transform.

uri

str – The uri of the opened csar file

wkt_cosys

str – The coordinate system in WKT format.