PostGIS  2.4.9dev-r@@SVN_REVISION@@
rt_raster.c File Reference
#include "librtcore.h"
#include "librtcore_internal.h"
#include <math.h>
Include dependency graph for rt_raster.c:

Go to the source code of this file.

Data Structures

struct  _rti_rasterize_arg_t
 

Typedefs

typedef struct _rti_rasterize_arg_t_rti_rasterize_arg
 

Functions

rt_raster rt_raster_new (uint32_t width, uint32_t height)
 Construct a raster with given dimensions. More...
 
void rt_raster_destroy (rt_raster raster)
 Release memory associated to a raster. More...
 
static void _rt_raster_geotransform_warn_offline_band (rt_raster raster)
 
uint16_t rt_raster_get_width (rt_raster raster)
 
uint16_t rt_raster_get_height (rt_raster raster)
 
void rt_raster_set_scale (rt_raster raster, double scaleX, double scaleY)
 Set scale in projection units. More...
 
double rt_raster_get_x_scale (rt_raster raster)
 Get scale X in projection units. More...
 
double rt_raster_get_y_scale (rt_raster raster)
 Get scale Y in projection units. More...
 
void rt_raster_set_skews (rt_raster raster, double skewX, double skewY)
 Set skews about the X and Y axis. More...
 
double rt_raster_get_x_skew (rt_raster raster)
 Get skew about the X axis. More...
 
double rt_raster_get_y_skew (rt_raster raster)
 Get skew about the Y axis. More...
 
void rt_raster_set_offsets (rt_raster raster, double x, double y)
 Set insertion points in projection units. More...
 
double rt_raster_get_x_offset (rt_raster raster)
 Get raster x offset, in projection units. More...
 
double rt_raster_get_y_offset (rt_raster raster)
 Get raster y offset, in projection units. More...
 
void rt_raster_get_phys_params (rt_raster rast, double *i_mag, double *j_mag, double *theta_i, double *theta_ij)
 Calculates and returns the physically significant descriptors embodied in the geotransform attached to the provided raster. More...
 
void rt_raster_calc_phys_params (double xscale, double xskew, double yskew, double yscale, double *i_mag, double *j_mag, double *theta_i, double *theta_ij)
 Calculates the physically significant descriptors embodied in an arbitrary geotransform. More...
 
void rt_raster_set_phys_params (rt_raster rast, double i_mag, double j_mag, double theta_i, double theta_ij)
 Calculates the geotransform coefficients and applies them to the supplied raster. More...
 
int rt_raster_calc_gt_coeff (double i_mag, double j_mag, double theta_i, double theta_ij, double *xscale, double *xskew, double *yskew, double *yscale)
 Calculates the coefficients of a geotransform given the physically significant parameters describing the transform. More...
 
int32_t rt_raster_get_srid (rt_raster raster)
 Get raster's SRID. More...
 
void rt_raster_set_srid (rt_raster raster, int32_t srid)
 Set raster's SRID. More...
 
int rt_raster_get_num_bands (rt_raster raster)
 
rt_band rt_raster_get_band (rt_raster raster, int n)
 Return Nth band, or NULL if unavailable. More...
 
int rt_raster_add_band (rt_raster raster, rt_band band, int index)
 Add band data to a raster. More...
 
int rt_raster_generate_new_band (rt_raster raster, rt_pixtype pixtype, double initialvalue, uint32_t hasnodata, double nodatavalue, int index)
 Generate a new inline band and add it to a raster. More...
 
rt_errorstate rt_raster_get_inverse_geotransform_matrix (rt_raster raster, double *gt, double *igt)
 Get 6-element array of raster inverse geotransform matrix. More...
 
void rt_raster_get_geotransform_matrix (rt_raster raster, double *gt)
 Get 6-element array of raster geotransform matrix. More...
 
void rt_raster_set_geotransform_matrix (rt_raster raster, double *gt)
 Set raster's geotransform using 6-element array. More...
 
rt_errorstate rt_raster_cell_to_geopoint (rt_raster raster, double xr, double yr, double *xw, double *yw, double *gt)
 Convert an xr, yr raster point to an xw, yw point on map. More...
 
rt_errorstate rt_raster_geopoint_to_cell (rt_raster raster, double xw, double yw, double *xr, double *yr, double *igt)
 Convert an xw,yw map point to a xr,yr raster point. More...
 
rt_errorstate rt_raster_get_envelope (rt_raster raster, rt_envelope *env)
 Get raster's envelope. More...
 
rt_raster rt_raster_compute_skewed_raster (rt_envelope extent, double *skew, double *scale, double tolerance)
 
int rt_raster_is_empty (rt_raster raster)
 Return TRUE if the raster is empty. More...
 
int rt_raster_has_band (rt_raster raster, int nband)
 Return TRUE if the raster has a band of this number. More...
 
int rt_raster_copy_band (rt_raster torast, rt_raster fromrast, int fromindex, int toindex)
 Copy one band from one raster to another. More...
 
rt_raster rt_raster_from_band (rt_raster raster, uint32_t *bandNums, int count)
 Construct a new rt_raster from an existing rt_raster and an array of band numbers. More...
 
rt_band rt_raster_replace_band (rt_raster raster, rt_band band, int index)
 Replace band at provided index with new band. More...
 
rt_raster rt_raster_clone (rt_raster raster, uint8_t deep)
 Clone an existing raster. More...
 
uint8_trt_raster_to_gdal (rt_raster raster, const char *srs, char *format, char **options, uint64_t *gdalsize)
 Return formatted GDAL raster from raster. More...
 
rt_gdaldriver rt_raster_gdal_drivers (uint32_t *drv_count, uint8_t cancc)
 Returns a set of available GDAL drivers. More...
 
GDALDatasetH rt_raster_to_gdal_mem (rt_raster raster, const char *srs, uint32_t *bandNums, int *excludeNodataValues, int count, GDALDriverH *rtn_drv, int *destroy_rtn_drv)
 Return GDAL dataset using GDAL MEM driver from raster. More...
 
rt_raster rt_raster_from_gdal_dataset (GDALDatasetH ds)
 Return a raster from a GDAL dataset. More...
 
static _rti_rasterize_arg _rti_rasterize_arg_init ()
 
static void _rti_rasterize_arg_destroy (_rti_rasterize_arg arg)
 
rt_raster rt_raster_gdal_rasterize (const unsigned char *wkb, uint32_t wkb_len, const char *srs, uint32_t num_bands, rt_pixtype *pixtype, double *init, double *value, double *nodata, uint8_t *hasnodata, int *width, int *height, double *scale_x, double *scale_y, double *ul_xw, double *ul_yw, double *grid_xw, double *grid_yw, double *skew_x, double *skew_y, char **options)
 Return a raster of the provided geometry. More...
 
rt_errorstate rt_raster_from_two_rasters (rt_raster rast1, rt_raster rast2, rt_extenttype extenttype, rt_raster *rtnraster, double *offset)