Raster#

class caris.coverage.Raster#
add_band()#

Add a new band

Parameters:

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

begin_transaction()#

Begin a new transaction

block_areas()#

Iterates over areas of the raster using the raster’s preferred block size. :returns: Iterator that returns grid-areas to process as tuples. :rtype: GridBoxIterator

commit_transaction()#

Commit a transaction

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_band_min_max()#

Added in version 5.5.0.

Set the band’s minimum and maximum values.

Parameters:
  • band_name (str) – The name of the band to update.

  • min – A tuple/value of size tuple_length containing the minimum value

  • max – A tuple/value of size tuple_length containing the maximum value

set_band_true_pos()#

Added in version 5.6.8.

Set the band’s true position band which contains the true coordinates for data of the band.

Parameters:
  • band_name (str) – The name of the band to update.

  • true_pos_band_name (str) – The name of the true position band

set_string_table()#

Added 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

When using the unnamed parameters, the offset must be specified. Area is not supported in this context.

Keyword Arguments:
  • 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.

  • area ((x1, y1), (x2, y2)) – The lower-left and upper-right corners of the area to write.

  • data (numpy.ndarray) – The data to write

When using the named keyword arguments, either offset or area must be specified. Both cannot be specified at the same time.

property band_info#

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

Type:

dict

property block_size#

The recommended block size to use when reading.

Type:

(width, height) of int

property bounding_polygon#

Added in version 5.1.0.

str: The bounding polygon in WKT format.

property dims#

The dimensions in pixels of the raster

Type:

(width, height) of int

property elevation_band_name#

The default elevation band name.

Type:

str

property extents#

The extents of the raster

Type:

((x1, y1), (x2, y2)) of float

property highest_level#

The highest resolution level.

Type:

int

property iso19139_xml#

The iso xml metadata

Type:

str

property lowest_level#

The lowest resolution level.

Type:

int

property transform#

The raster transform.

Type:

RasterTransform

property uri#

The uri of the opened csar file

Type:

str

property wkt_cosys#

The coordinate system in WKT format.

Type:

str