Geodot Plugin
|
#include <GeoRaster.h>
Public Types | |
enum | FORMAT { RGB , RGBA , RF , BYTE , MIXED , UNKNOWN } |
Public Member Functions | |
GeoRaster (GDALDataset *data, int interpolation_type) | |
GeoRaster (GDALDataset *data, int pixel_offset_x, int pixel_offset_y, int source_window_size_pixels, int destination_window_size_pixels, int interpolation_type) | |
void * | get_as_array () |
void * | get_band_as_array (int band_index) |
Return the data within a single band of the GeoRaster as an array. The type of the array can be any of: BYTE, RF, or UNKNOWN. More... | |
int | get_size_in_bytes () |
FORMAT | get_format () |
Return the format of the data of this GeoRaster. | |
FORMAT | get_band_format (int band_index) |
get the FORMAT of the band at band_index within the dataset. This function is most useful when working with either MIXED datasets or simply for extracting specific band information More... | |
int | get_pixel_size_x () |
int | get_pixel_size_y () |
uint64_t * | get_histogram () |
int * | get_most_common (int number_of_elements) |
Static Public Member Functions | |
static FORMAT | get_format_for_dataset (GDALDataset *data) |
Wrapper for GDALDataset and its relevant functions. Provides easy access without GDAL dependencies to library users.
void * GeoRaster::get_as_array | ( | ) |
Return the data of the GeoRaster as an array. The array contains type of the raster format (get_format). BYTE -> (B)(B)(B) with B of type uint8_t RGB -> (RGB)(RGB)(RGB) with R, G, B of type uint8_t RGBA -> (RGBA)(RGBA)(RGBA) with R, G, B, A of type uint8_t RF -> (F)(F)(F) with F of type float @RequiresManualDelete
void * GeoRaster::get_band_as_array | ( | int | band_index | ) |
Return the data within a single band of the GeoRaster as an array. The type of the array can be any of: BYTE, RF, or UNKNOWN.
band_index | the index of the band to be returned as array. |
GeoRaster::FORMAT GeoRaster::get_band_format | ( | int | band_index | ) |
get the FORMAT of the band at band_index within the dataset. This function is most useful when working with either MIXED datasets or simply for extracting specific band information
band_index | index of the band whose format will be found |
uint64_t * GeoRaster::get_histogram | ( | ) |
Return a histogram in the format of ID -> number of occurrences. Only works with BYTE images! @RequiresManualDelete
int * GeoRaster::get_most_common | ( | int | number_of_elements | ) |
Return the number_of_elements most common IDs in the GeoRaster. Note: This function is optimized for few elements (less than ~10). For use cases where a more complete sorted list is required, the array should be sorted with a proper sorting algorithm. @RequiresManualDelete
int GeoRaster::get_size_in_bytes | ( | ) |
Return the total size of the data in bytes. Useful in conjunction with get_as_array. An optional pixel_size can be given if it deviates from the standard size saved in the object.