58 #ifndef LIBRTCORE_H_INCLUDED 59 #define LIBRTCORE_H_INCLUDED 62 #if defined(__linux__) 72 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) 90 #if defined(__MSDOS__) 96 #if defined(__WIN32__) || defined(__NT__) || defined(_WIN32) 100 #if defined(__BORLANDC__) && defined(MSDOS) 105 #if defined(__APPLE__) 111 #if defined(sun) || defined(__sun) 126 #include "gdal_alg.h" 127 #include "gdal_frmts.h" 129 #include "gdalwarper.h" 131 #include "cpl_conv.h" 133 #include "ogr_srs_api.h" 135 #include "../../postgis_config.h" 136 #include "../raster_config.h" 139 # define __attribute__ (x) 229 typedef void* (*rt_allocator)(
size_t size);
230 typedef void* (*rt_reallocator)(
void *mem,
size_t size);
249 extern void*
rtalloc(
size_t size);
250 extern void*
rtrealloc(
void* mem,
size_t size);
276 #if POSTGIS_DEBUG_LEVEL > 0 279 #define RASTER_DEBUG(level, msg) \ 281 if (POSTGIS_DEBUG_LEVEL >= level) \ 282 rtinfo("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__); \ 286 #define RASTER_DEBUGF(level, msg, ...) \ 288 if (POSTGIS_DEBUG_LEVEL >= level) \ 289 rtinfo("[%s:%s:%d] " msg, __FILE__, __func__, __LINE__, __VA_ARGS__); \ 295 #define RASTER_DEBUG(level, msg) \ 299 #define RASTER_DEBUGF(level, msg, ...) \ 361 double val,
double refval,
389 rt_pixel npixel,
int count,
392 uint16_t distancex, uint16_t distancey,
421 uint16_t width, uint16_t height,
423 uint32_t hasnodata,
double nodataval,
447 uint16_t width, uint16_t height,
449 uint32_t hasnodata,
double nodataval,
450 uint8_t bandNum,
const char* path
689 void **vals, uint16_t *nvals
731 uint16_t distancex, uint16_t distancey,
732 int exclude_nodata_value,
748 rt_band
band,
int exclude_nodata_value,
749 double *searchset,
int searchcount,
799 double *newval,
int *corrected
817 int exclude_nodata_value,
double sample,
int inc_vals,
818 uint64_t *cK,
double *cM,
double *cQ
841 int bin_count,
double *bin_widths,
int bin_widths_count,
842 int right,
double min,
double max,
858 double *quantiles,
int quantiles_count,
uint32_t *rtn_count);
895 int exclude_nodata_value,
double sample,
898 double *quantiles,
int quantiles_count,
917 rt_band
band,
int exclude_nodata_value,
918 double *search_values,
uint32_t search_values_count,
double roundto,
936 uint32_t hasnodata,
double nodataval,
937 rt_reclassexpr *exprset,
int exprcount
1060 double initialvalue,
1061 uint32_t hasnodata,
double nodatavalue,
1075 double scaleX,
double scaleY);
1105 double x,
double y);
1135 double skewX,
double skewY);
1166 double *i_mag,
double *j_mag,
double *theta_i,
double *theta_ij) ;
1184 double i_mag,
double j_mag,
double theta_i,
double theta_ij) ;
1203 double xskew,
double yskew,
double yscale,
1204 double *i_mag,
double *j_mag,
double *theta_i,
double *theta_ij) ;
1224 double j_mag,
double theta_i,
double theta_ij,
1225 double *xscale,
double *xskew,
double *yskew,
double *yscale) ;
1254 double *
gt,
double *igt
1290 double xr,
double yr,
1291 double* xw,
double* yw,
1309 double xw,
double yw,
1310 double *xr,
double *yr,
1439 int exclude_nodata_value,
1495 rt_raster torast, rt_raster fromrast,
1496 int fromindex,
int toindex
1548 char *format,
char **options, uint64_t *gdalsize);
1581 int *excludeNodataValues,
1583 GDALDriverH *rtn_drv,
int *destroy_rtn_drv
1627 const char *src_srs,
const char *dst_srs,
1628 double *scale_x,
double *scale_y,
1629 int *width,
int *height,
1630 double *ul_xw,
double *ul_yw,
1631 double *grid_xw,
double *grid_yw,
1632 double *skew_x,
double *skew_y,
1633 GDALResampleAlg resample_alg,
double max_err);
1664 double *init,
double *
value,
1665 double *nodata,
uint8_t *hasnodata,
1666 int *width,
int *height,
1667 double *scale_x,
double *scale_y,
1668 double *ul_xw,
double *ul_yw,
1669 double *grid_xw,
double *grid_yw,
1670 double *skew_x,
double *skew_y,
1691 rt_raster rast1,
int nband1,
1692 rt_raster rast2,
int nband2,
1713 rt_raster rast1,
int nband1,
1714 rt_raster rast2,
int nband2,
1735 rt_raster rast1,
int nband1,
1736 rt_raster rast2,
int nband2,
1757 rt_raster rast1,
int nband1,
1758 rt_raster rast2,
int nband2,
1779 rt_raster rast1,
int nband1,
1780 rt_raster rast2,
int nband2,
1801 rt_raster rast1,
int nband1,
1802 rt_raster rast2,
int nband2,
1823 rt_raster rast1,
int nband1,
1824 rt_raster rast2,
int nband2,
1847 rt_raster rast1,
int nband1,
1848 rt_raster rast2,
int nband2,
1872 rt_raster rast1,
int nband1,
1873 rt_raster rast2,
int nband2,
1892 int *aligned,
char **reason
1911 rt_raster rast1, rt_raster rast2,
1913 rt_raster *rtnraster,
double *offset
1954 rt_iterator itrset, uint16_t itrcount,
1957 uint8_t hasnodata,
double nodataval,
1958 uint16_t distancex, uint16_t distancey,
1962 rt_iterator_arg arg,
1967 rt_raster *rtnraster
1983 rt_colormap colormap
1991 extern void *
rtalloc(
size_t size);
1992 extern void *
rtrealloc(
void *mem,
size_t size);
1999 #define GDAL_ENABLE_ALL "ENABLE_ALL" 2000 #define GDAL_DISABLE_ALL "DISABLE_ALL" 2001 #define GDAL_VSICURL "VSICURL" 2007 #if !defined(POSTGIS_RASTER_WARN_ON_TRUNCATION) 2008 #define POSTGIS_RASTER_WARN_ON_TRUNCATION 0 2011 #define POSTGIS_RT_1BBMAX 1 2012 #define POSTGIS_RT_2BUIMAX 3 2013 #define POSTGIS_RT_4BUIMAX 15 2047 double initialvalue,
2048 int32_t checkvalint,
uint32_t checkvaluint,
2049 float checkvalfloat,
double checkvaldouble,
2184 #define FLT_NEQ(x, y) (fabs(x - y) > FLT_EPSILON) 2185 #define FLT_EQ(x, y) (!FLT_NEQ(x, y)) 2186 #define DBL_NEQ(x, y) (fabs(x - y) > DBL_EPSILON) 2187 #define DBL_EQ(x, y) (!DBL_NEQ(x, y)) 2192 #define ROUND(x, y) (((x > 0.0) ? floor((x * pow(10, y) + 0.5)) : ceil((x * pow(10, y) - 0.5))) / pow(10, y)) Datum coveredby(PG_FUNCTION_ARGS)
void *(* rt_allocator)(size_t size)
Global functions for memory/logging handlers.
int32_t rt_util_clamp_to_32BSI(double value)
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 ...
rt_errorstate rt_band_corrected_clamped_value(rt_band band, double val, double *newval, int *corrected)
Correct value when clamped value is equal to clamped NODATA value.
int quantile_llist_destroy(struct quantile_llist **list, uint32_t list_count)
uint32_t rt_util_clamp_to_32BUI(double value)
void * rt_raster_serialize(rt_raster raster)
Return this raster in serialized form.
int rt_util_gdal_register_all(int force_register_all)
double rt_raster_get_x_offset(rt_raster raster)
Get raster x offset, in projection units.
int rt_raster_get_num_bands(rt_raster raster)
double rt_raster_get_y_skew(rt_raster raster)
Get skew about the Y axis.
void *(* rt_reallocator)(void *mem, size_t size)
Datum covers(PG_FUNCTION_ARGS)
struct quantile_llist_element * element
rt_errorstate rt_raster_same_alignment(rt_raster rast1, rt_raster rast2, int *aligned, char **reason)
void default_rt_info_handler(const char *fmt, va_list ap)
struct quantile_llist_element * prev
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
void(* rt_message_handler)(const char *string, va_list ap) __attribute__((format(printf
struct rt_pixel_t * rt_pixel
rt_errorstate rt_pixel_set_to_array(rt_pixel npixel, int count, rt_mask mask, int x, int y, uint16_t distancex, uint16_t distancey, double ***value, int ***nodata, int *dimx, int *dimy)
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.
rt_geomval rt_raster_gdal_polygonize(rt_raster raster, int nband, int exclude_nodata_value, int *pnElements)
Returns a set of "geomval" value, one for each group of pixel sharing the same value for the provided...
void rt_raster_set_geotransform_matrix(rt_raster raster, double *gt)
Set raster's geotransform using 6-element array.
struct rt_raster_t * rt_raster
Types definitions.
void rt_raster_get_geotransform_matrix(rt_raster raster, double *gt)
Get 6-element array of raster geotransform matrix.
void rt_raster_set_skews(rt_raster raster, double skewX, double skewY)
Set skews about the X and Y axis.
struct rt_gdaldriver_t * rt_gdaldriver
void rt_set_handlers(rt_allocator allocator, rt_reallocator reallocator, rt_deallocator deallocator, rt_message_handler error_handler, rt_message_handler info_handler, rt_message_handler warning_handler)
This function is called when the PostgreSQL backend is taking care of the memory and we want to use p...
rt_errorstate rt_raster_from_two_rasters(rt_raster rast1, rt_raster rast2, rt_extenttype extenttype, rt_raster *rtnraster, double *offset)
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.
Datum contains(PG_FUNCTION_ARGS)
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
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.
void * rtalloc(size_t size)
Wrappers used for managing memory.
void * default_rt_reallocator(void *mem, size_t size)
rt_raster rt_raster_gdal_warp(rt_raster raster, const char *src_srs, const char *dst_srs, double *scale_x, double *scale_y, int *width, int *height, double *ul_xw, double *ul_yw, double *grid_xw, double *grid_yw, double *skew_x, double *skew_y, GDALResampleAlg resample_alg, double max_err)
Return a warped raster using GDAL Warp API.
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 t...
void * rtrealloc(void *mem, size_t size)
rt_errorstate rt_raster_covers(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *covers)
Return ES_ERROR if error occurred in function.
LWPOLY * rt_util_envelope_to_lwpoly(rt_envelope ext)
int rt_band_get_pixel_of_value(rt_band band, int exclude_nodata_value, double *searchset, int searchcount, rt_pixel *pixels)
Search band for pixel(s) with search values.
rt_errorstate
Enum definitions.
int rt_util_same_geotransform_matrix(double *gt1, double *gt2)
rt_errorstate rt_raster_contains(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *contains)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_band_set_nodata(rt_band band, double val, int *converted)
Set nodata value.
Datum overlaps(PG_FUNCTION_ARGS)
void rt_band_destroy(rt_band band)
Destroy a raster band.
struct rt_reclassexpr_t * rt_reclassexpr
struct rt_quantile_t * rt_quantile
uint8_t * rt_raster_to_wkb(rt_raster raster, int outasin, uint32_t *wkbsize)
Return this raster in WKB form.
int rt_raster_is_empty(rt_raster raster)
Return TRUE if the raster is empty.
Datum touches(PG_FUNCTION_ARGS)
rt_quantile rt_band_get_quantiles_stream(rt_band band, int exclude_nodata_value, double sample, uint64_t cov_count, struct quantile_llist **qlls, uint32_t *qlls_count, double *quantiles, int quantiles_count, uint32_t *rtn_count)
Compute the default set of or requested quantiles for a coverage.
rt_geos_spatial_test
GEOS spatial relationship tests available.
rt_errorstate rt_band_get_nodata(rt_band band, double *nodata)
Get NODATA value.
rt_errorstate rt_raster_get_convex_hull(rt_raster raster, LWGEOM **hull)
Get raster's convex hull.
void default_rt_warning_handler(const char *fmt, va_list ap)
const char * rt_band_get_ext_path(rt_band band)
Return band's external path (only valid when rt_band_is_offline returns non-zero).
struct quantile_llist_element * next
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.
int rt_pixtype_alignment(rt_pixtype pixtype)
Return alignment requirements for data in the given pixel type.
rt_errorstate rt_raster_surface(rt_raster raster, int nband, LWMPOLY **surface)
Get a raster as a surface (multipolygon).
uint16_t rt_util_clamp_to_16BUI(double value)
void rt_band_set_ownsdata_flag(rt_band band, int flag)
struct quantile_llist_element * tail
GDALDataType rt_util_pixtype_to_gdal_datatype(rt_pixtype pt)
Convert rt_pixtype to GDALDataType.
void rt_util_to_ogr_envelope(rt_envelope ext, OGREnvelope *env)
int rt_util_gdal_driver_registered(const char *drv)
void rtwarn(const char *fmt,...)
int rt_band_get_ownsdata_flag(rt_band band)
Return 0 (FALSE) or non-zero (TRUE) indicating if rt_band is responsible for managing the memory for ...
Datum intersects(PG_FUNCTION_ARGS)
rt_quantile rt_band_get_quantiles(rt_bandstats stats, double *quantiles, int quantiles_count, uint32_t *rtn_count)
Compute the default set of or requested quantiles for a set of data the quantile formula used is same...
rt_errorstate rt_raster_intersects(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *intersects)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
enum rt_colormap_t::@7 method
rt_extenttype rt_util_extent_type(const char *name)
void rt_raster_set_scale(rt_raster raster, double scaleX, double scaleY)
Set scale in projection units.
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.
rt_pixtype rt_pixtype_index_from_name(const char *pixname)
char * rt_raster_to_hexwkb(rt_raster raster, int outasin, uint32_t *hexwkbsize)
Return this raster in HEXWKB form (null-terminated hex)
rt_errorstate rt_util_rgb_to_hsv(double rgb[3], double hsv[3])
rt_errorstate rt_band_get_pixel_line(rt_band band, int x, int y, uint16_t len, void **vals, uint16_t *nvals)
Get values of multiple pixels.
rt_raster rt_raster_clone(rt_raster raster, uint8_t deep)
Clone an existing raster.
void rt_raster_set_offsets(rt_raster raster, double x, double y)
Set insertion points in projection units.
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. ...
int rt_util_gdal_supported_sr(const char *srs)
rt_errorstate rt_band_load_offline_data(rt_band band)
Load offline band's data.
rt_raster rt_raster_from_wkb(const uint8_t *wkb, uint32_t wkbsize)
Construct an rt_raster from a binary WKB representation.
int8_t rt_util_clamp_to_8BSI(double value)
int rt_util_dbl_trunc_warning(double initialvalue, int32_t checkvalint, uint32_t checkvaluint, float checkvalfloat, double checkvaldouble, rt_pixtype pixtype)
int rt_band_clamped_value_is_nodata(rt_band band, double val)
Compare clamped value to band's clamped NODATA value.
rt_band rt_raster_get_band(rt_raster raster, int bandNum)
Return Nth band, or NULL if unavailable.
int rt_raster_copy_band(rt_raster torast, rt_raster fromrast, int fromindex, int toindex)
Copy one band from one raster to another.
rt_pixtype rt_util_gdal_datatype_to_pixtype(GDALDataType gdt)
Convert GDALDataType to rt_pixtype.
void rtinfo(const char *fmt,...)
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
int rt_band_get_hasnodata_flag(rt_band band)
Get hasnodata flag value.
struct rt_colormap_entry_t * rt_colormap_entry
double rt_raster_get_x_scale(rt_raster raster)
Get scale X in projection units.
LWPOLY * rt_raster_pixel_as_polygon(rt_raster raster, int x, int y)
Get a raster pixel as a polygon.
uint16_t rt_band_get_width(rt_band band)
Return width of this band.
int rt_raster_has_band(rt_raster raster, int nband)
Return TRUE if the raster has a band of this number.
uint16_t rt_band_get_height(rt_band band)
Return height of this band.
rt_errorstate rt_raster_get_envelope_geom(rt_raster raster, LWGEOM **env)
Get raster's envelope as a geometry.
struct rt_band_t * rt_band
void * rt_band_get_data(rt_band band)
Get pointer to raster band data.
double rt_pixtype_get_min_value(rt_pixtype pixtype)
Return minimum value possible for pixel type.
void rt_raster_set_srid(rt_raster raster, int32_t srid)
Set raster's SRID.
int32_t rt_raster_get_srid(rt_raster raster)
Get raster's SRID.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
rt_band rt_raster_replace_band(rt_raster raster, rt_band band, int index)
Replace band at provided index with new band.
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.
rt_bandstats rt_band_get_summary_stats(rt_band band, int exclude_nodata_value, double sample, int inc_vals, uint64_t *cK, double *cM, double *cQ)
Compute summary statistics for a band.
double rt_raster_get_y_scale(rt_raster raster)
Get scale Y in projection units.
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
double rt_raster_get_x_skew(rt_raster raster)
Get skew about the X axis.
rt_band rt_band_new_inline(uint16_t width, uint16_t height, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, uint8_t *data)
Create an in-db rt_band with no data.
struct rt_histogram_t * rt_histogram
Datum distance(PG_FUNCTION_ARGS)
rt_errorstate rt_band_get_ext_band_num(rt_band band, uint8_t *bandnum)
Return bands' external band number (only valid when rt_band_is_offline returns non-zero).
uint8_t rt_util_clamp_to_4BUI(double value)
void rt_band_set_hasnodata_flag(rt_band band, int flag)
Set hasnodata flag value.
uint8_t rt_util_clamp_to_8BUI(double value)
int rt_pixtype_size(rt_pixtype pixtype)
Return size in bytes of a value in the given pixtype.
uint8_t rt_util_clamp_to_1BB(double value)
struct rt_geomval_t * rt_geomval
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.
struct rt_mask_t * rt_mask
struct rt_valuecount_t * rt_valuecount
void default_rt_error_handler(const char *fmt, va_list ap)
void(* rt_deallocator)(void *mem)
struct rt_bandstats_t * rt_bandstats
uint16_t rt_raster_get_width(rt_raster raster)
rt_valuecount rt_band_get_value_count(rt_band band, int exclude_nodata_value, double *search_values, uint32_t search_values_count, double roundto, uint32_t *rtn_total, uint32_t *rtn_count)
Count the number of times provided value(s) occur in the band.
rt_raster rt_raster_from_hexwkb(const char *hexwkb, uint32_t hexwkbsize)
Construct an rt_raster from a text HEXWKB representation.
void default_rt_deallocator(void *mem)
rt_errorstate rt_band_set_isnodata_flag(rt_band band, int flag)
Set isnodata flag value.
void rtdealloc(void *mem)
uint8_t * rt_raster_to_gdal(rt_raster raster, const char *srs, char *format, char **options, uint64_t *gdalsize)
Return formatted GDAL raster from raster.
rt_band rt_band_duplicate(rt_band band)
Create a new band duplicated from source band.
rt_gdaldriver rt_raster_gdal_drivers(uint32_t *drv_count, uint8_t cancc)
Returns a set of available GDAL drivers.
double rt_band_get_min_value(rt_band band)
Returns the minimal possible value for the band according to the pixel type.
rt_errorstate rt_raster_touches(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *touches)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_raster_get_inverse_geotransform_matrix(rt_raster raster, double *gt, double *igt)
Get 6-element array of raster inverse geotransform matrix.
char * rt_util_gdal_convert_sr(const char *srs, int proj4)
const char * rt_pixtype_name(rt_pixtype pixtype)
rt_errorstate rt_raster_iterator(rt_iterator itrset, uint16_t itrcount, rt_extenttype extenttype, rt_raster customextent, rt_pixtype pixtype, uint8_t hasnodata, double nodataval, uint16_t distancex, uint16_t distancey, rt_mask mask, void *userarg, int(*callback)(rt_iterator_arg arg, void *userarg, double *value, int *nodata), rt_raster *rtnraster)
n-raster iterator.
void * default_rt_allocator(size_t size)
The default memory/logging handlers installed by lwgeom_install_default_allocators() ...
struct quantile_llist_index * index
rt_pixtype rt_band_get_pixtype(rt_band band)
Return pixeltype of this band.
rt_errorstate rt_band_set_pixel_line(rt_band band, int x, int y, void *vals, uint32_t len)
Set values of multiple pixels.
rt_raster rt_raster_compute_skewed_raster(rt_envelope extent, double *skew, double *scale, double tolerance)
rt_histogram rt_band_get_histogram(rt_bandstats stats, int bin_count, double *bin_widths, int bin_widths_count, int right, double min, double max, uint32_t *rtn_count)
Count the distribution of data.
int rt_raster_add_band(rt_raster raster, rt_band band, int index)
Add band data to a raster.
rt_errorstate rt_util_gdal_sr_auth_info(GDALDatasetH hds, char **authname, char **authcode)
Get auth name and code.
void rt_util_from_ogr_envelope(OGREnvelope env, rt_envelope *ext)
struct rt_iterator_arg_t * rt_iterator_arg
uint8_t rt_util_clamp_to_2BUI(double value)
int rt_band_get_isnodata_flag(rt_band band)
Get isnodata flag value.
struct rt_colormap_t * rt_colormap
rt_errorstate rt_raster_fully_within_distance(rt_raster rast1, int nband1, rt_raster rast2, int nband2, double distance, int *dfwithin)
Return ES_ERROR if error occurred in function.
float rt_util_clamp_to_32F(double value)
rt_errorstate rt_band_set_pixel(rt_band band, int x, int y, double val, int *converted)
Set single pixel's value.
int rt_util_gdal_configured(void)
const char * rt_util_gdal_version(const char *request)
rt_raster rt_raster_from_gdal_dataset(GDALDatasetH ds)
Return a raster from a GDAL dataset.
struct quantile_llist_element * head
rt_errorstate rt_raster_get_perimeter(rt_raster raster, int nband, LWGEOM **perimeter)
Get raster perimeter.
rt_band rt_band_reclass(rt_band srcband, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, rt_reclassexpr *exprset, int exprcount)
Returns new band with values reclassified.
rt_errorstate rt_raster_coveredby(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *coveredby)
Return ES_ERROR if error occurred in function.
uint16_t rt_raster_get_height(rt_raster raster)
struct rt_iterator_t * rt_iterator
GDALResampleAlg rt_util_gdal_resample_alg(const char *algname)
Convert cstring name to GDAL Resample Algorithm.
rt_raster rt_raster_colormap(rt_raster raster, int nband, rt_colormap colormap)
Returns a new raster with up to four 8BUI bands (RGBA) from applying a colormap to the user-specified...
rt_errorstate rt_raster_within_distance(rt_raster rast1, int nband1, rt_raster rast2, int nband2, double distance, int *dwithin)
Return ES_ERROR if error occurred in function.
int rt_band_get_nearest_pixel(rt_band band, int x, int y, uint16_t distancex, uint16_t distancey, int exclude_nodata_value, rt_pixel *npixels)
Get nearest pixel(s) with value (not NODATA) to specified pixel.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.
rt_errorstate rt_raster_get_envelope(rt_raster raster, rt_envelope *env)
Get raster's envelope.
GDALDatasetH rt_util_gdal_open(const char *fn, GDALAccess fn_access, int shared)
double rt_raster_get_y_offset(rt_raster raster)
Get raster y offset, in projection units.
rt_errorstate rt_util_hsv_to_rgb(double hsv[3], double rgb[3])
void(*) voi rt_install_default_allocators)(void)
Apply the default memory management (malloc() and free()) and error handlers.
rt_errorstate rt_pixtype_compare_clamped_values(rt_pixtype pixtype, double val, double refval, int *isequal)
Test to see if two values are equal when clamped.
This library is the generic geometry handling section of PostGIS.
rt_band rt_band_new_offline(uint16_t width, uint16_t height, rt_pixtype pixtype, uint32_t hasnodata, double nodataval, uint8_t bandNum, const char *path)
Create an out-db rt_band.
int16_t rt_util_clamp_to_16BSI(double value)
rt_errorstate rt_raster_contains_properly(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *contains)
Return ES_ERROR if error occurred in function.
rt_errorstate rt_raster_overlaps(rt_raster rast1, int nband1, rt_raster rast2, int nband2, int *overlaps)
Return ES_ERROR if error occurred in function.