Raster

class caris.coverage.Raster
__init__()

Constructor

One of filename or uri is required.

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 lower-left and upper-right corners of the area to read from.
  • level (int, optional) – The resolution level to read from. Defaults to hi_level.
Returns:

raster data from left to right, then bottom to top

Return type:

list

read_np_array()

Read raster data as a numpy array

Parameters:
  • band_name (str) – The band to read from.
  • area ((x1, y1), (x2, y2)) – The lower-left and upper-right corners of the area to read from.
  • 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.
set_string_table()

New in version 5.3.0.

Replace a band’s string table

Parameters:
  • band_name (str) – The name of the band to update.
  • string_table (list(str)) – The new string table.
write()

Write data to a Raster

Parameters:
  • band_name (str) – The name of the band to write to
  • offset ((x_offset, y_offset), (width, height) – The lower-left offset into the Raster to begin the write and the width and height of the area to 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.

bounding_polygon

New in version 5.1.0.

str: The bounding polygon in WKT format.

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 float – 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.