PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ test_band_new_offline_from_path()

static void test_band_new_offline_from_path ( )
static

Definition at line 1256 of file cu_band_basics.c.

References ovdump::band, band_basics_suite_setup(), 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().

1256  {
1257  rt_band band = NULL;
1258  int width = 10;
1259  int height = 10;
1260  char *path = "../regress/loader/testraster.tif";
1261  uint8_t extband = 0;
1262 
1263  /* offline band */
1265  width, height,
1266  0, 0,
1267  2, path,
1268  FALSE
1269  );
1270  CU_ASSERT(band != NULL);
1271 
1272  /* isoffline */
1273  CU_ASSERT(rt_band_is_offline(band));
1274 
1275  /* ext path */
1276  CU_ASSERT_STRING_EQUAL(rt_band_get_ext_path(band), path);
1277 
1278  /* ext band number */
1279  CU_ASSERT_EQUAL(rt_band_get_ext_band_num(band, &extband), ES_NONE);
1280  CU_ASSERT_EQUAL(extband, 1);
1281 
1282  /* test rt_band_check_is_nodata */
1283  CU_ASSERT_EQUAL(rt_band_check_is_nodata(band), FALSE);
1284 
1285  /* dimensions */
1286  CU_ASSERT_EQUAL(rt_band_get_width(band), width);
1287  CU_ASSERT_EQUAL(rt_band_get_height(band), height);
1288 
1289  rt_band_destroy(band);
1290 }
band
Definition: ovdump.py:57
int rt_band_is_offline(rt_band band)
Return non-zero if the given band data is on the filesystem.
Definition: rt_band.c:325
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:195
void rt_band_destroy(rt_band band)
Destroy a raster band.
Definition: rt_band.c:336
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:359
int rt_band_check_is_nodata(rt_band band)
Returns TRUE if the band is only nodata values.
Definition: rt_band.c:1704
uint16_t rt_band_get_width(rt_band band)
Return width of this band.
Definition: rt_band.c:592
uint16_t rt_band_get_height(rt_band band)
Return height of this band.
Definition: rt_band.c:601
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:372
#define FALSE
Definition: dbfopen.c:168
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: