PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ test_band_new_offline_from_path()

static void test_band_new_offline_from_path ( )
static

Definition at line 1262 of file cu_band_basics.c.

1262 {
1263 rt_band band = NULL;
1264 int width = 10;
1265 int height = 10;
1266 char *path = POSTGIS_TOP_SRC_DIR "/raster/test/regress/loader/testraster.tif";
1267 uint8_t extband = 0;
1268
1269 /* offline band */
1271 width, height,
1272 0, 0,
1273 2, path,
1274 FALSE
1275 );
1276 CU_ASSERT(band != NULL);
1277
1278 /* isoffline */
1279 CU_ASSERT(rt_band_is_offline(band));
1280
1281 /* ext path */
1282 CU_ASSERT_STRING_EQUAL(rt_band_get_ext_path(band), path);
1283
1284 /* ext band number */
1285 CU_ASSERT_EQUAL(rt_band_get_ext_band_num(band, &extband), ES_NONE);
1286 CU_ASSERT_EQUAL(extband, 1);
1287
1288 /* test rt_band_check_is_nodata */
1289 CU_ASSERT_EQUAL(rt_band_check_is_nodata(band), FALSE);
1290
1291 /* dimensions */
1292 CU_ASSERT_EQUAL(rt_band_get_width(band), width);
1293 CU_ASSERT_EQUAL(rt_band_get_height(band), height);
1294
1295 rt_band_destroy(band);
1296}
#define FALSE
Definition dbfopen.c:72
uint16_t rt_band_get_width(rt_band band)
Return width of this band.
Definition rt_band.c:799
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
Definition rt_band.c:2089
@ ES_NONE
Definition librtcore.h:182
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition rt_band.c:499
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).
Definition rt_band.c:535
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).
Definition rt_band.c:522
rt_band rt_band_new_offline_from_path(uint16_t width, uint16_t height, int hasnodata, double nodataval, uint8_t bandNum, const char *path, int force)
Create an out-db rt_band from path.
Definition rt_band.c:358
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
Definition rt_band.c:488
uint16_t rt_band_get_height(rt_band band)
Return height of this band.
Definition rt_band.c:808

References ES_NONE, FALSE, rt_band_check_is_nodata(), rt_band_destroy(), rt_band_get_ext_band_num(), rt_band_get_ext_path(), rt_band_get_height(), rt_band_get_width(), rt_band_is_offline(), and rt_band_new_offline_from_path().

Referenced by band_basics_suite_setup().

Here is the call graph for this function:
Here is the caller graph for this function: