RasterLayer Class
Contents
[
Hide
]Summary: Represents a raster layer.
Module: aspose.gis.raster
Full Name: aspose.gis.raster.RasterLayer
Aspose.PSD Version: 25.9.0
Properties
| Name | Type | Access | Description |
|---|---|---|---|
| band_count | int | r | Gets the number of bands in the raster layer. |
| bounds | RasterRect | r | Gets the raster bounds. |
| cell_size | IRasterCellSize | r | Gets cell or pixel size of the raster. |
| driver | Driver | r | Gets the RasterLayer.driver that instantiated this layer. |
| height | int | r | Gets the height of the raster in pixels. Also it is known as rows count. |
| no_data_values | IRasterValues | r | Gets the values that represents background or ’no data’ of the raster. |
| spatial_reference_system | SpatialReferenceSystem | r | Gets a spatial reference system of raster. Can be |
| upper_left_x | double | r | Gets x-coordinate of the raster upper left corner. |
| upper_left_y | double | r | Gets y-coordinate of the raster upper left corner. |
| width | int | r | Gets the width of the raster in pixels. Also it is known as columns count. |
Methods
| Name | Description |
|---|---|
| crop(geometry, masks) | Crops the raster layer using a shape form (and band mask). |
| crop(masks) | Crops the raster layer using a band mask). |
| get_band(index) | Gets a band by the specified index. |
| get_extent() | Calculates a spatial extent of this layer. |
| get_spatial_point(cell_x, cell_y) | Converts the specified column and row to the spatial coordinate. |
| get_statistics(band_index, exclude_nodata_value) | Calculate summary statistics consisting of count, sum, mean, min, max. |
| get_values(cell_x, cell_y) | Reads the values in the specified cell. |
| get_values_dump(rect) | Reads the values in the specified block as a 1-dimension array. |
| warp(options) | Warps the raster layer to another. |
Method: crop(geometry, masks)
crop(geometry, masks)
Crops the raster layer using a shape form (and band mask).
Parameters:
| Parameter | Type | Description |
|---|---|---|
| geometry | IGeometry | Geometry represented the shape form. |
| masks | double | Mask for crop layer |
Returns
| Type | Description |
|---|---|
| RasterLayer | The cropped raster layer. If no intersections found returns |
Method: crop(masks)
crop(masks)
Crops the raster layer using a band mask).
Parameters:
| Parameter | Type | Description |
|---|---|---|
| masks | double | Mask for crop layer |
Returns
| Type | Description |
|---|---|
| RasterLayer | The cropped raster layer. If no intersections found returns |
Method: get_band(index)
get_band(index)
Gets a band by the specified index.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| index | int | Band numbers start at 0 and band is assumed to be 0 if not specified. |
Returns
| Type | Description |
|---|---|
| IRasterBand | Returns basic meta data about a raster band. |
Method: get_extent()
get_extent()
Calculates a spatial extent of this layer.
Returns
| Type | Description |
|---|---|
| Extent | A spatial extent of this layer. |
Method: get_spatial_point(cell_x, cell_y)
get_spatial_point(cell_x, cell_y)
Converts the specified column and row to the spatial coordinate.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| cell_x | int | The value for column (x-coordinate). Numbering starts at 0. |
| cell_y | int | The value for row (y-coordinate). Numbering starts at 0. |
Returns
| Type | Description |
|---|---|
| IPoint | Returns the x-coordinate of upper left corner given a column and row. |
Method: get_statistics(band_index, exclude_nodata_value)
get_statistics(band_index, exclude_nodata_value)
Calculate summary statistics consisting of count, sum, mean, min, max.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| band_index | int | The index of the band. Numbering starts from 0. |
| exclude_nodata_value | bool | Allows to exclude ’nodata’ values. If ’excludeNodataValue’ is set to false, then all pixels are considered. |
Returns
| Type | Description |
|---|---|
| RasterStatistics | The summary statistics. |
Method: get_values(cell_x, cell_y)
get_values(cell_x, cell_y)
Reads the values in the specified cell.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| cell_x | int | The value for column (x-coordinate). Numbering starts at 0. |
| cell_y | int | The value for row (y-coordinate). Numbering starts at 0. |
Returns
| Type | Description |
|---|---|
| IRasterValues | The raster values. |
Method: get_values_dump(rect)
get_values_dump(rect)
Reads the values in the specified block as a 1-dimension array.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| rect | RasterRect | Block of raster cells where dump is read. |
Returns
| Type | Description |
|---|---|
| IRasterValues[] | The dump of values. |
Method: warp(options)
warp(options)
Warps the raster layer to another.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| options | WarpOptions | Options for the reprojection procedure. |
Returns
| Type | Description |
|---|---|
| RasterLayer | The warp raster layer. |