*authcode = rtalloc(sizeof(char) * (strlen(pszAuthorityCode) + 1));
if (*authname == NULL || *authcode == NULL) {
- rterror("rt_util_gdal_sr_auth_info: Unable to allocate memory for auth name and code");
+ rterror("rt_util_gdal_sr_auth_info: Could not allocate memory for auth name and code");
if (*authname != NULL) rtdealloc(*authname);
if (*authcode != NULL) rtdealloc(*authcode);
OSRDestroySpatialReference(hSRS);
npoly = lwpoly_construct(SRID_UNKNOWN, 0, 1, rings);
if (npoly == NULL) {
- rterror("rt_util_envelope_to_lwpoly: Unable to build envelope's geometry");
+ rterror("rt_util_envelope_to_lwpoly: Could not build envelope's geometry");
return NULL;
}
nodatas = rtalloc(sizeof(int *) * dim[1]);
if (values == NULL || nodatas == NULL) {
- rterror("rt_pixel_set_to_array: Unable to allocate memory for 2D array");
+ rterror("rt_pixel_set_to_array: Could not allocate memory for 2D array");
return ES_ERROR;
}
nodatas[i] = rtalloc(sizeof(int) * dim[0]);
if (values[i] == NULL || nodatas[i] == NULL) {
- rterror("rt_pixel_set_to_array: Unable to allocate memory for dimension of 2D array");
+ rterror("rt_pixel_set_to_array: Could not allocate memory for dimension of 2D array");
if (values[i] == NULL) {
for (j = 0; j < i; j++) {
/* properly set nodataval as it may need to be constrained to the data type */
if (hasnodata && rt_band_set_nodata(band, nodataval, NULL) != ES_NONE) {
- rterror("rt_band_new_inline: Unable to set NODATA value");
+ rterror("rt_band_new_inline: Could not set NODATA value");
rt_band_destroy(band);
return NULL;
}
/* properly set nodataval as it may need to be constrained to the data type */
if (hasnodata && rt_band_set_nodata(band, nodataval, NULL) != ES_NONE) {
- rterror("rt_band_new_offline: Unable to set NODATA value");
+ rterror("rt_band_new_offline: Could not set NODATA value");
rt_band_destroy(band);
return NULL;
}
/* make sure len of values to copy don't exceed end of data */
if (len > (band->width * band->height) - offset) {
- rterror("rt_band_set_pixel_line: Unable to apply pixels as values length exceeds end of data");
+ rterror("rt_band_set_pixel_line: Could not apply pixels as values length exceeds end of data");
return ES_ERROR;
}
_vals = rtalloc(_nvals * pixsize);
if (_vals == NULL) {
- rterror("rt_band_get_pixel_line: Unable to allocate memory for pixel values");
+ rterror("rt_band_get_pixel_line: Could not allocate memory for pixel values");
return ES_ERROR;
}
&pixval,
&isnodata
) != ES_NONE) {
- rterror("rt_band_get_nearest_pixel: Unable to get pixel value");
+ rterror("rt_band_get_nearest_pixel: Could not get pixel value");
if (count) rtdealloc(*npixels);
return -1;
}
else
*npixels = (rt_pixel) rtrealloc(*npixels, sizeof(struct rt_pixel_t) * count);
if (*npixels == NULL) {
- rterror("rt_band_get_nearest_pixel: Unable to allocate memory for nearest pixel(s)");
+ rterror("rt_band_get_nearest_pixel: Could not allocate memory for nearest pixel(s)");
return -1;
}
else
*pixels = (rt_pixel) rtrealloc(*pixels, sizeof(struct rt_pixel_t) * count);
if (*pixels == NULL) {
- rterror("rt_band_get_pixel_of_value: Unable to allocate memory for pixel(s)");
+ rterror("rt_band_get_pixel_of_value: Could not allocate memory for pixel(s)");
return -1;
}
if (band->width < 1 || band->height < 1) {
stats = (rt_bandstats) rtalloc(sizeof(struct rt_bandstats_t));
if (NULL == stats) {
- rterror("rt_band_get_summary_stats: Unable to allocate memory for stats");
+ rterror("rt_band_get_summary_stats: Could not allocate memory for stats");
return NULL;
}
if (rt_band_get_isnodata_flag(band) != FALSE) {
stats = (rt_bandstats) rtalloc(sizeof(struct rt_bandstats_t));
if (NULL == stats) {
- rterror("rt_band_get_summary_stats: Unable to allocate memory for stats");
+ rterror("rt_band_get_summary_stats: Could not allocate memory for stats");
return NULL;
}
if (inc_vals) {
values = rtalloc(sizeof(double) * sample_size);
if (NULL == values) {
- rtwarn("Unable to allocate memory for values");
+ rtwarn("Could not allocate memory for values");
inc_vals = 0;
}
}
/* initialize stats */
stats = (rt_bandstats) rtalloc(sizeof(struct rt_bandstats_t));
if (NULL == stats) {
- rterror("rt_band_get_summary_stats: Unable to allocate memory for stats");
+ rterror("rt_band_get_summary_stats: Could not allocate memory for stats");
return NULL;
}
stats->sample = sample;
if (bin_count < 2) {
bins = rtalloc(sizeof(struct rt_histogram_t));
if (NULL == bins) {
- rterror("rt_util_get_histogram: Unable to allocate memory for histogram");
+ rterror("rt_util_get_histogram: Could not allocate memory for histogram");
return NULL;
}
if (NULL == bin_width) {
bin_width = rtalloc(sizeof(double));
if (NULL == bin_width) {
- rterror("rt_util_get_histogram: Unable to allocate memory for bin widths");
+ rterror("rt_util_get_histogram: Could not allocate memory for bin widths");
return NULL;
}
init_width = 1;
/* initialize bins */
bins = rtalloc(bin_count * sizeof(struct rt_histogram_t));
if (NULL == bins) {
- rterror("rt_util_get_histogram: Unable to allocate memory for histogram");
+ rterror("rt_util_get_histogram: Could not allocate memory for histogram");
if (init_width) rtdealloc(bin_width);
return NULL;
}
quantiles = rtalloc(sizeof(double) * quantiles_count);
init_quantiles = 1;
if (NULL == quantiles) {
- rterror("rt_band_get_quantiles: Unable to allocate memory for quantile input");
+ rterror("rt_band_get_quantiles: Could not allocate memory for quantile input");
return NULL;
}
/* initialize rt_quantile */
rtn = rtalloc(sizeof(struct rt_quantile_t) * quantiles_count);
if (NULL == rtn) {
- rterror("rt_band_get_quantiles: Unable to allocate memory for quantile output");
+ rterror("rt_band_get_quantiles: Could not allocate memory for quantile output");
if (init_quantiles) rtdealloc(quantiles);
return NULL;
}
quantiles = rtalloc(sizeof(double) * quantiles_count);
init_quantiles = 1;
if (NULL == quantiles) {
- rterror("rt_band_get_quantiles_stream: Unable to allocate memory for quantile input");
+ rterror("rt_band_get_quantiles_stream: Could not allocate memory for quantile input");
return NULL;
}
RASTER_DEBUGF(4, "qlls_count = %d", *qlls_count);
*qlls = rtalloc(sizeof(struct quantile_llist) * *qlls_count);
if (NULL == *qlls) {
- rterror("rt_band_get_quantiles_stream: Unable to allocate memory for quantile output");
+ rterror("rt_band_get_quantiles_stream: Could not allocate memory for quantile output");
if (init_quantiles) rtdealloc(quantiles);
return NULL;
}
/* initialize index */
qll->index = rtalloc(sizeof(struct quantile_llist_index) * j);
if (NULL == qll->index) {
- rterror("rt_band_get_quantiles_stream: Unable to allocate memory for quantile output");
+ rterror("rt_band_get_quantiles_stream: Could not allocate memory for quantile output");
if (init_quantiles) rtdealloc(quantiles);
return NULL;
}
if (search_values_count > 0 && NULL != search_values) {
vcnts = (rt_valuecount) rtalloc(sizeof(struct rt_valuecount_t) * search_values_count);
if (NULL == vcnts) {
- rterror("rt_band_get_count_of_values: Unable to allocate memory for value counts");
+ rterror("rt_band_get_count_of_values: Could not allocate memory for value counts");
*rtn_count = 0;
return NULL;
}
else {
vcnts = (rt_valuecount) rtalloc(sizeof(struct rt_valuecount_t));
if (NULL == vcnts) {
- rterror("rt_band_get_count_of_values: Unable to allocate memory for value counts");
+ rterror("rt_band_get_count_of_values: Could not allocate memory for value counts");
*rtn_count = 0;
return NULL;
}
/* add new valuecount */
vcnts = rtrealloc(vcnts, sizeof(struct rt_valuecount_t) * (vcnts_count + 1));
if (NULL == vcnts) {
- rterror("rt_band_get_count_of_values: Unable to allocate memory for value counts");
+ rterror("rt_band_get_count_of_values: Could not allocate memory for value counts");
*rtn_count = 0;
return NULL;
}
memcpy(_gt, gt, sizeof(double) * 6);
if (!GDALInvGeoTransform(_gt, igt)) {
- rterror("rt_raster_get_inverse_geotransform_matrix: Unable to compute inverse geotransform matrix");
+ rterror("rt_raster_get_inverse_geotransform_matrix: Could not compute inverse geotransform matrix");
return ES_ERROR;
}
FLT_EQ(_igt[5], 0.)
) {
if (rt_raster_get_inverse_geotransform_matrix(raster, NULL, _igt) != ES_NONE) {
- rterror("rt_raster_geopoint_to_cell: Unable to get inverse geotransform matrix");
+ rterror("rt_raster_geopoint_to_cell: Could not get inverse geotransform matrix");
return ES_ERROR;
}
}
&p4d.x, &p4d.y,
gt
) != ES_NONE) {
- rterror("rt_raster_get_convex_hull: Unable to get second point for linestring");
+ rterror("rt_raster_get_convex_hull: Could not get second point for linestring");
return ES_ERROR;
}
ptarray_append_point(pts, &p4d, LW_TRUE);
/* only one ring */
rings = (POINTARRAY **) rtalloc(sizeof (POINTARRAY*));
if (!rings) {
- rterror("rt_raster_get_convex_hull: Unable to allocate memory for polygon ring");
+ rterror("rt_raster_get_convex_hull: Could not allocate memory for polygon ring");
return ES_ERROR;
}
rings[0] = ptarray_construct(0, 0, 5);
/* TODO: handle error on ptarray construction */
/* XXX jorgearevalo: the error conditions aren't managed in ptarray_construct */
if (!rings[0]) {
- rterror("rt_raster_get_convex_hull: Unable to construct point array");
+ rterror("rt_raster_get_convex_hull: Could not construct point array");
return ES_ERROR;
}
pts = rings[0];
_gt
);
if (rtn != ES_NONE) {
- rterror("rt_raster_get_envelope: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_get_envelope: Could not compute spatial coordinates for raster pixel");
return ES_ERROR;
}
raster = rt_raster_new(_dim[0], _dim[1]);
if (raster == NULL) {
- rterror("rt_raster_compute_skewed_raster: Unable to create output raster");
+ rterror("rt_raster_compute_skewed_raster: Could not create output raster");
return NULL;
}
/* get inverse geotransform matrix */
if (!GDALInvGeoTransform(_gt, _igt)) {
- rterror("rt_raster_compute_skewed_raster: Unable to compute inverse geotransform matrix");
+ rterror("rt_raster_compute_skewed_raster: Could not compute inverse geotransform matrix");
rt_raster_destroy(raster);
return NULL;
}
/* prevent possible infinite loop */
if (run > max_run) {
- rterror("rt_raster_compute_skewed_raster: Unable to compute skewed extent due to check preventing infinite loop");
+ rterror("rt_raster_compute_skewed_raster: Could not compute skewed extent due to check preventing infinite loop");
rt_raster_destroy(raster);
return NULL;
}
_igt
);
if (rtn != ES_NONE) {
- rterror("rt_raster_compute_skewed_raster: Unable to compute raster pixel for spatial coordinates");
+ rterror("rt_raster_compute_skewed_raster: Could not compute raster pixel for spatial coordinates");
rt_raster_destroy(raster);
return NULL;
}
_gt
);
if (rtn != ES_NONE) {
- rterror("rt_raster_compute_skewed_raster: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_compute_skewed_raster: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(raster);
return NULL;
}
/* get inverse geotransform matrix */
if (!GDALInvGeoTransform(_gt, _igt)) {
- rterror("rt_raster_compute_skewed_raster: Unable to compute inverse geotransform matrix");
+ rterror("rt_raster_compute_skewed_raster: Could not compute inverse geotransform matrix");
rt_raster_destroy(raster);
return NULL;
}
_igt
);
if (rtn != ES_NONE) {
- rterror("rt_raster_compute_skewed_raster: Unable to compute raster pixel for spatial coordinates");
+ rterror("rt_raster_compute_skewed_raster: Could not compute raster pixel for spatial coordinates");
rt_raster_destroy(raster);
return NULL;
}
{
LWPOLY *npoly = rt_util_envelope_to_lwpoly(extent);
if (npoly == NULL) {
- rterror("rt_raster_compute_skewed_raster: Unable to build extent's geometry for covers test");
+ rterror("rt_raster_compute_skewed_raster: Could not build extent's geometry for covers test");
rt_raster_destroy(raster);
return NULL;
}
/* construct sgeom from raster */
if ((rt_raster_get_convex_hull(raster, &geom) != ES_NONE) || geom == NULL) {
- rterror("rt_raster_compute_skewed_raster: Unable to build skewed extent's geometry for covers test");
+ rterror("rt_raster_compute_skewed_raster: Could not build skewed extent's geometry for covers test");
GEOSGeom_destroy(ngeom);
rt_raster_destroy(raster);
return NULL;
GEOSGeom_destroy(sgeom);
if (covers == 2) {
- rterror("rt_raster_compute_skewed_raster: Unable to run covers test");
+ rterror("rt_raster_compute_skewed_raster: Could not run covers test");
GEOSGeom_destroy(ngeom);
rt_raster_destroy(raster);
return NULL;
/* construct sgeom from raster */
if ((rt_raster_get_convex_hull(raster, &geom) != ES_NONE) || geom == NULL) {
- rterror("rt_raster_compute_skewed_raster: Unable to build skewed extent's geometry for minimizing dimensions");
+ rterror("rt_raster_compute_skewed_raster: Could not build skewed extent's geometry for minimizing dimensions");
GEOSGeom_destroy(ngeom);
rt_raster_destroy(raster);
return NULL;
GEOSGeom_destroy(sgeom);
if (covers == 2) {
- rterror("rt_raster_compute_skewed_raster: Unable to run covers test for minimizing dimensions");
+ rterror("rt_raster_compute_skewed_raster: Could not run covers test for minimizing dimensions");
GEOSGeom_destroy(ngeom);
rt_raster_destroy(raster);
return NULL;
pathlen = strlen((char*) ptr);
band->data.offline.path = rtalloc(sizeof(char) * (pathlen + 1));
if (band->data.offline.path == NULL) {
- rterror("rt_raster_deserialize: Unable to allocate momory for offline band path");
+ rterror("rt_raster_deserialize: Could not allocate momory for offline band path");
for (j = 0; j <= i; j++) rt_band_destroy(rast->bands[j]);
rt_raster_destroy(rast);
return NULL;
flag = rt_raster_copy_band(rast, raster, idx, i);
if (flag < 0) {
- rterror("rt_raster_from_band: Unable to copy band");
+ rterror("rt_raster_from_band: Could not copy band");
for (j = 0; j < i; j++) rt_band_destroy(rast->bands[j]);
rt_raster_destroy(rast);
return NULL;
nband = rtalloc(sizeof(uint32_t) * numband);
if (nband == NULL) {
- rterror("rt_raster_clone: Unable to allocate memory for deep clone");
+ rterror("rt_raster_clone: Could not allocate memory for deep clone");
return NULL;
}
for (i = 0; i < numband; i++)
rt_raster_get_height(raster)
);
if (rtn == NULL) {
- rterror("rt_raster_clone: Unable to create cloned raster");
+ rterror("rt_raster_clone: Could not create cloned raster");
return NULL;
}
/* load raster into a GDAL MEM raster */
src_ds = rt_raster_to_gdal_mem(raster, srs, NULL, NULL, 0, &src_drv);
if (NULL == src_ds) {
- rterror("rt_raster_to_gdal: Unable to convert raster to GDAL MEM format");
+ rterror("rt_raster_to_gdal: Could not convert raster to GDAL MEM format");
return 0;
}
/* load driver */
rtn_drv = GDALGetDriverByName(format);
if (NULL == rtn_drv) {
- rterror("rt_raster_to_gdal: Unable to load the output GDAL driver");
+ rterror("rt_raster_to_gdal: Could not load the output GDAL driver");
GDALClose(src_ds);
return 0;
}
NULL /* progress data */
);
if (NULL == rtn_ds) {
- rterror("rt_raster_to_gdal: Unable to create the output GDAL dataset");
+ rterror("rt_raster_to_gdal: Could not create the output GDAL dataset");
GDALClose(src_ds);
return 0;
}
rtn = VSIGetMemFileBuffer("/vsimem/out.dat", &rtn_lenvsi, TRUE);
RASTER_DEBUG(3, "Done copying GDAL memory file to buffer");
if (NULL == rtn) {
- rterror("rt_raster_to_gdal: Unable to create the output GDAL raster");
+ rterror("rt_raster_to_gdal: Could not create the output GDAL raster");
return 0;
}
count = GDALGetDriverCount();
rtn = (rt_gdaldriver) rtalloc(count * sizeof(struct rt_gdaldriver_t));
if (NULL == rtn) {
- rterror("rt_raster_gdal_drivers: Unable to allocate memory for gdaldriver structure");
+ rterror("rt_raster_gdal_drivers: Could not allocate memory for gdaldriver structure");
return 0;
}
GDALRegister_MEM();
drv = GDALGetDriverByName("MEM");
if (NULL == drv) {
- rterror("rt_raster_to_gdal_mem: Unable to load the MEM GDAL driver");
+ rterror("rt_raster_to_gdal_mem: Could not load the MEM GDAL driver");
return 0;
}
*rtn_drv = drv;
rt_raster_get_geotransform_matrix(raster, gt);
cplerr = GDALSetGeoTransform(ds, gt);
if (cplerr != CE_None) {
- rterror("rt_raster_to_gdal_mem: Unable to set geotransformation");
+ rterror("rt_raster_to_gdal_mem: Could not set geotransformation");
GDALClose(ds);
return 0;
}
if (NULL != srs && strlen(srs)) {
char *_srs = rt_util_gdal_convert_sr(srs, 0);
if (_srs == NULL) {
- rterror("rt_raster_to_gdal_mem: Unable to convert srs to GDAL accepted format");
+ rterror("rt_raster_to_gdal_mem: Could not convert srs to GDAL accepted format");
GDALClose(ds);
return 0;
}
cplerr = GDALSetProjection(ds, _srs);
CPLFree(_srs);
if (cplerr != CE_None) {
- rterror("rt_raster_to_gdal_mem: Unable to set projection");
+ rterror("rt_raster_to_gdal_mem: Could not set projection");
GDALClose(ds);
return 0;
}
count = numBands;
bandNums = (uint32_t *) rtalloc(sizeof(uint32_t) * count);
if (NULL == bandNums) {
- rterror("rt_raster_to_gdal_mem: Unable to allocate memory for band indices");
+ rterror("rt_raster_to_gdal_mem: Could not allocate memory for band indices");
GDALClose(ds);
return 0;
}
if (NULL == excludeNodataValues) {
excludeNodataValues = (int *) rtalloc(sizeof(int) * count);
if (NULL == excludeNodataValues) {
- rterror("rt_raster_to_gdal_mem: Unable to allocate memory for NODATA flags");
+ rterror("rt_raster_to_gdal_mem: Could not allocate memory for NODATA flags");
GDALClose(ds);
return 0;
}
for (i = 0; i < count; i++) {
rtband = rt_raster_get_band(raster, bandNums[i]);
if (NULL == rtband) {
- rterror("rt_raster_to_gdal_mem: Unable to get requested band index %d", bandNums[i]);
+ rterror("rt_raster_to_gdal_mem: Could not get requested band index %d", bandNums[i]);
if (allocBandNums) rtdealloc(bandNums);
if (allocNodataValues) rtdealloc(excludeNodataValues);
GDALClose(ds);
gdband = NULL;
gdband = GDALGetRasterBand(ds, i);
if (NULL == gdband) {
- rterror("rt_raster_from_gdal_dataset: Unable to get GDAL band");
+ rterror("rt_raster_from_gdal_dataset: Could not get GDAL band");
rt_raster_destroy(rast);
return NULL;
}
0, 0
);
if (cplerr != CE_None) {
- rterror("rt_raster_from_gdal_dataset: Unable to get data from GDAL raster");
+ rterror("rt_raster_from_gdal_dataset: Could not get data from GDAL raster");
rtdealloc(values);
rt_raster_destroy(rast);
return NULL;
arg = rtalloc(sizeof(struct _rti_warp_arg_t));
if (arg == NULL) {
- rterror("_rti_warp_arg_init: Unable to allocate memory for _rti_warp_arg");
+ rterror("_rti_warp_arg_init: Could not allocate memory for _rti_warp_arg");
return NULL;
}
/* internal variables */
arg = _rti_warp_arg_init();
if (arg == NULL) {
- rterror("rt_raster_gdal_warp: Unable to initialize internal variables");
+ rterror("rt_raster_gdal_warp: Could not initialize internal variables");
return NULL;
}
arg->dst.srs = rt_util_gdal_convert_sr(dst_srs, 0);
if (arg->src.srs == NULL || arg->dst.srs == NULL) {
- rterror("rt_raster_gdal_warp: Unable to convert srs values to GDAL accepted format");
+ rterror("rt_raster_gdal_warp: Could not convert srs values to GDAL accepted format");
_rti_warp_arg_destroy(arg);
return NULL;
}
/* load raster into a GDAL MEM dataset */
arg->src.ds = rt_raster_to_gdal_mem(raster, arg->src.srs, NULL, NULL, 0, &(arg->src.drv));
if (NULL == arg->src.ds) {
- rterror("rt_raster_gdal_warp: Unable to convert raster to GDAL MEM format");
+ rterror("rt_raster_gdal_warp: Could not convert raster to GDAL MEM format");
_rti_warp_arg_destroy(arg);
return NULL;
}
arg->transform.option.len = 2;
arg->transform.option.item = rtalloc(sizeof(char *) * (arg->transform.option.len + 1));
if (NULL == arg->transform.option.item) {
- rterror("rt_raster_gdal_warp: Unable to allocation memory for transform options");
+ rterror("rt_raster_gdal_warp: Could not allocation memory for transform options");
_rti_warp_arg_destroy(arg);
return NULL;
}
break;
}
if (NULL == arg->transform.option.item[i]) {
- rterror("rt_raster_gdal_warp: Unable to allocation memory for transform options");
+ rterror("rt_raster_gdal_warp: Could not allocation memory for transform options");
_rti_warp_arg_destroy(arg);
return NULL;
}
/* transformation object for building dst dataset */
arg->transform.arg.transform = GDALCreateGenImgProjTransformer2(arg->src.ds, NULL, arg->transform.option.item);
if (NULL == arg->transform.arg.transform) {
- rterror("rt_raster_gdal_warp: Unable to create GDAL transformation object for output dataset creation");
+ rterror("rt_raster_gdal_warp: Could not create GDAL transformation object for output dataset creation");
_rti_warp_arg_destroy(arg);
return NULL;
}
arg->src.ds, GDALGenImgProjTransform,
arg->transform.arg.transform, _gt, &(_dim[0]), &(_dim[1]), dst_extent, 0);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_warp: Unable to get GDAL suggested warp output for output dataset creation");
+ rterror("rt_raster_gdal_warp: Could not get GDAL suggested warp output for output dataset creation");
_rti_warp_arg_destroy(arg);
return NULL;
}
&(_r[0]), &(_r[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_warp: Unable to compute raster pixel for spatial coordinates");
+ rterror("rt_raster_gdal_warp: Could not compute raster pixel for spatial coordinates");
rt_raster_destroy(rast);
_rti_warp_arg_destroy(arg);
return NULL;
&(_w[0]), &(_w[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_warp: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_warp: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_warp_arg_destroy(arg);
&(_c[0]), &(_c[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_warp: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_warp: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_warp_arg_destroy(arg);
return NULL;
&(_c[0]), &(_c[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_warp: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_warp: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_warp_arg_destroy(arg);
&(_w[0]), &(_w[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_warp: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_warp: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_warp_arg_destroy(arg);
return NULL;
&(_w[0]), &(_w[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_warp: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_warp: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_warp_arg_destroy(arg);
return NULL;
GDALRegister_VRT();
arg->dst.drv = GDALGetDriverByName("VRT");
if (NULL == arg->dst.drv) {
- rterror("rt_raster_gdal_warp: Unable to load the output GDAL VRT driver");
+ rterror("rt_raster_gdal_warp: Could not load the output GDAL VRT driver");
_rti_warp_arg_destroy(arg);
return NULL;
}
/* create dst dataset */
arg->dst.ds = GDALCreate(arg->dst.drv, "", _dim[0], _dim[1], 0, GDT_Byte, dst_options);
if (NULL == arg->dst.ds) {
- rterror("rt_raster_gdal_warp: Unable to create GDAL VRT dataset");
+ rterror("rt_raster_gdal_warp: Could not create GDAL VRT dataset");
_rti_warp_arg_destroy(arg);
return NULL;
}
if (arg->dst.srs != NULL) {
cplerr = GDALSetProjection(arg->dst.ds, arg->dst.srs);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_warp: Unable to set projection");
+ rterror("rt_raster_gdal_warp: Could not set projection");
_rti_warp_arg_destroy(arg);
return NULL;
}
/* set dst geotransform */
cplerr = GDALSetGeoTransform(arg->dst.ds, _gt);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_warp: Unable to set geotransform");
+ rterror("rt_raster_gdal_warp: Could not set geotransform");
_rti_warp_arg_destroy(arg);
return NULL;
}
for (i = 0; i < numBands; i++) {
rtband = rt_raster_get_band(raster, i);
if (NULL == rtband) {
- rterror("rt_raster_gdal_warp: Unable to get band %d for adding to VRT dataset", i);
+ rterror("rt_raster_gdal_warp: Could not get band %d for adding to VRT dataset", i);
_rti_warp_arg_destroy(arg);
return NULL;
}
cplerr = GDALAddBand(arg->dst.ds, gdal_pt, NULL);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_warp: Unable to add band to VRT dataset");
+ rterror("rt_raster_gdal_warp: Could not add band to VRT dataset");
_rti_warp_arg_destroy(arg);
return NULL;
}
arg->transform.option.item
);
if (NULL == arg->transform.arg.transform) {
- rterror("rt_raster_gdal_warp: Unable to create GDAL transformation object");
+ rterror("rt_raster_gdal_warp: Could not create GDAL transformation object");
_rti_warp_arg_destroy(arg);
return NULL;
}
arg->transform.arg.imgproj, max_err
);
if (NULL == arg->transform.arg.transform) {
- rterror("rt_raster_gdal_warp: Unable to create GDAL approximate transformation object");
+ rterror("rt_raster_gdal_warp: Could not create GDAL approximate transformation object");
_rti_warp_arg_destroy(arg);
return NULL;
}
/* warp options */
arg->wopts = GDALCreateWarpOptions();
if (NULL == arg->wopts) {
- rterror("rt_raster_gdal_warp: Unable to create GDAL warp options object");
+ rterror("rt_raster_gdal_warp: Could not create GDAL warp options object");
_rti_warp_arg_destroy(arg);
return NULL;
}
for (i = 0; i < numBands; i++) {
band = rt_raster_get_band(raster, i);
if (!band) {
- rterror("rt_raster_gdal_warp: Unable to process bands for nodata values");
+ rterror("rt_raster_gdal_warp: Could not process bands for nodata values");
_rti_warp_arg_destroy(arg);
return NULL;
}
RASTER_DEBUG(3, "Warping raster");
cplerr = GDALInitializeWarpedVRT(arg->dst.ds, arg->wopts);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_warp: Unable to warp raster");
+ rterror("rt_raster_gdal_warp: Could not warp raster");
_rti_warp_arg_destroy(arg);
return NULL;
}
_rti_warp_arg_destroy(arg);
if (NULL == rast) {
- rterror("rt_raster_gdal_warp: Unable to warp raster");
+ rterror("rt_raster_gdal_warp: Could not warp raster");
return NULL;
}
arg = rtalloc(sizeof(struct _rti_rasterize_arg_t));
if (arg == NULL) {
- rterror("_rti_rasterize_arg_init: Unable to allocate memory for _rti_rasterize_arg");
+ rterror("_rti_rasterize_arg_init: Could not allocate memory for _rti_rasterize_arg");
return NULL;
}
/* internal variables */
arg = _rti_rasterize_arg_init();
if (arg == NULL) {
- rterror("rt_raster_gdal_rasterize: Unable to initialize internal variables");
+ rterror("rt_raster_gdal_rasterize: Could not initialize internal variables");
return NULL;
}
if (NULL != srs && strlen(srs)) {
src_sr = OSRNewSpatialReference(NULL);
if (OSRSetFromUserInput(src_sr, srs) != OGRERR_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to create OSR spatial reference using the provided srs: %s", srs);
+ rterror("rt_raster_gdal_rasterize: Could not create OSR spatial reference using the provided srs: %s", srs);
_rti_rasterize_arg_destroy(arg);
return NULL;
}
/* convert WKB to OGR Geometry */
ogrerr = OGR_G_CreateFromWkb((unsigned char *) wkb, src_sr, &src_geom, wkb_len);
if (ogrerr != OGRERR_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to create OGR Geometry from WKB");
+ rterror("rt_raster_gdal_rasterize: Could not create OGR Geometry from WKB");
_rti_rasterize_arg_destroy(arg);
RASTER_DEBUG(4, "Converting envelope to geometry");
epoly = rt_util_envelope_to_lwpoly(extent);
if (epoly == NULL) {
- rterror("rt_raster_gdal_rasterize: Unable to create envelope's geometry to test if geometry is properly contained by extent");
+ rterror("rt_raster_gdal_rasterize: Could not create envelope's geometry to test if geometry is properly contained by extent");
_rti_rasterize_arg_destroy(arg);
GEOSGeom_destroy(egeom);
if (result == 2) {
- rterror("rt_raster_gdal_rasterize: Unable to test if geometry is properly contained by extent for geometry within extent");
+ rterror("rt_raster_gdal_rasterize: Could not test if geometry is properly contained by extent for geometry within extent");
_rti_rasterize_arg_destroy(arg);
&(_r[0]), &(_r[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to compute raster pixel for spatial coordinates");
+ rterror("rt_raster_gdal_rasterize: Could not compute raster pixel for spatial coordinates");
rt_raster_destroy(rast);
_rti_rasterize_arg_destroy(arg);
&(_w[0]), &(_w[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_rasterize: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_rasterize_arg_destroy(arg);
&(_c[0]), &(_c[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_rasterize: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_rasterize_arg_destroy(arg);
&(_c[0]), &(_c[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_rasterize: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_rasterize_arg_destroy(arg);
&(_w[0]), &(_w[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_rasterize: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_rasterize_arg_destroy(arg);
&(_w[0]), &(_w[1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to compute spatial coordinates for raster pixel");
+ rterror("rt_raster_gdal_rasterize: Could not compute spatial coordinates for raster pixel");
rt_raster_destroy(rast);
_rti_rasterize_arg_destroy(arg);
GDALRegister_MEM();
_drv = GDALGetDriverByName("MEM");
if (NULL == _drv) {
- rterror("rt_raster_gdal_rasterize: Unable to load the MEM GDAL driver");
+ rterror("rt_raster_gdal_rasterize: Could not load the MEM GDAL driver");
_rti_rasterize_arg_destroy(arg);
/* add band */
cplerr = GDALAddBand(_ds, rt_util_pixtype_to_gdal_datatype(arg->pixtype[i]), NULL);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_rasterize: Unable to add band to GDALDataset");
+ rterror("rt_raster_gdal_rasterize: Could not add band to GDALDataset");
err = 1;
break;
}
_band = GDALGetRasterBand(_ds, i + 1);
if (NULL == _band) {
- rterror("rt_raster_gdal_rasterize: Unable to get band %d from GDALDataset", i + 1);
+ rterror("rt_raster_gdal_rasterize: Could not get band %d from GDALDataset", i + 1);
err = 1;
break;
}
RASTER_DEBUGF(4, "Setting NODATA value of band %d to %f", i, arg->nodata[i]);
cplerr = GDALSetRasterNoDataValue(_band, arg->nodata[i]);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_rasterize: Unable to set nodata value");
+ rterror("rt_raster_gdal_rasterize: Could not set nodata value");
err = 1;
break;
}
/* initial value */
cplerr = GDALFillRaster(_band, arg->init[i], 0);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_rasterize: Unable to set initial value");
+ rterror("rt_raster_gdal_rasterize: Could not set initial value");
err = 1;
break;
}
NULL, NULL
);
if (cplerr != CE_None) {
- rterror("rt_raster_gdal_rasterize: Unable to rasterize geometry");
+ rterror("rt_raster_gdal_rasterize: Could not rasterize geometry");
_rti_rasterize_arg_destroy(arg);
GDALClose(_ds);
if (NULL == rast) {
- rterror("rt_raster_gdal_rasterize: Unable to rasterize geometry");
+ rterror("rt_raster_gdal_rasterize: Could not rasterize geometry");
return NULL;
}
oldband = rt_raster_get_band(rast, i);
if (oldband == NULL) {
- rterror("rt_raster_gdal_rasterize: Unable to get band %d of output raster", i);
+ rterror("rt_raster_gdal_rasterize: Could not get band %d of output raster", i);
_rti_rasterize_arg_destroy(arg);
rt_raster_destroy(rast);
return NULL;
data
);
if (band == NULL) {
- rterror("rt_raster_gdal_rasterize: Unable to create band");
+ rterror("rt_raster_gdal_rasterize: Could not create band");
rtdealloc(data);
_rti_rasterize_arg_destroy(arg);
rt_raster_destroy(rast);
for (y = 0; y < _height; y++) {
err = rt_band_get_pixel(oldband, x, y, &val, &nodata);
if (err != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to get pixel value");
+ rterror("rt_raster_gdal_rasterize: Could not get pixel value");
_rti_rasterize_arg_destroy(arg);
rt_raster_destroy(rast);
rt_band_destroy(band);
err = rt_band_set_pixel(band, x, y, val, NULL);
if (err != ES_NONE) {
- rterror("rt_raster_gdal_rasterize: Unable to set pixel value");
+ rterror("rt_raster_gdal_rasterize: Could not set pixel value");
_rti_rasterize_arg_destroy(arg);
rt_raster_destroy(rast);
rt_band_destroy(band);
/* replace band */
oldband = rt_raster_replace_band(rast, band, i);
if (oldband == NULL) {
- rterror("rt_raster_gdal_rasterize: Unable to replace band %d of output raster", i);
+ rterror("rt_raster_gdal_rasterize: Could not replace band %d of output raster", i);
_rti_rasterize_arg_destroy(arg);
rt_raster_destroy(rast);
rt_band_destroy(band);
/* load band of smaller raster */
bandS = rt_raster_get_band(rastS, nbandS);
if (NULL == bandS) {
- rterror("rt_raster_intersects: Unable to get band %d of the first raster", nbandS);
+ rterror("rt_raster_intersects: Could not get band %d of the first raster", nbandS);
*intersects = 0;
return ES_ERROR;
}
/* load band of larger raster */
bandL = rt_raster_get_band(rastL, nbandL);
if (NULL == bandL) {
- rterror("rt_raster_intersects: Unable to get band %d of the first raster", nbandL);
+ rterror("rt_raster_intersects: Could not get band %d of the first raster", nbandL);
*intersects = 0;
return ES_ERROR;
}
/* get LWMPOLY of each band */
if (rt_raster_surface(rast1, nband1, &surface1) != ES_NONE) {
- rterror("rt_raster_geos_spatial_relationship: Unable to get surface of the specified band from the first raster");
+ rterror("rt_raster_geos_spatial_relationship: Could not get surface of the specified band from the first raster");
return ES_ERROR;
}
if (rt_raster_surface(rast2, nband2, &surface2) != ES_NONE) {
- rterror("rt_raster_geos_spatial_relationship: Unable to get surface of the specified band from the second raster");
+ rterror("rt_raster_geos_spatial_relationship: Could not get surface of the specified band from the second raster");
lwmpoly_free(surface1);
return ES_ERROR;
}
geom1 = LWGEOM2GEOS(lwmpoly_as_lwgeom(surface1));
lwmpoly_free(surface1);
if (geom1 == NULL) {
- rterror("rt_raster_geos_spatial_relationship: Unable to convert surface of the specified band from the first raster to a GEOSGeometry");
+ rterror("rt_raster_geos_spatial_relationship: Could not convert surface of the specified band from the first raster to a GEOSGeometry");
lwmpoly_free(surface2);
return ES_ERROR;
}
geom2 = LWGEOM2GEOS(lwmpoly_as_lwgeom(surface2));
lwmpoly_free(surface2);
if (geom2 == NULL) {
- rterror("rt_raster_geos_spatial_relationship: Unable to convert surface of the specified band from the second raster to a GEOSGeometry");
+ rterror("rt_raster_geos_spatial_relationship: Could not convert surface of the specified band from the second raster to a GEOSGeometry");
return ES_ERROR;
}
/* something happened in the spatial relationship test */
if (rtn == 2) {
- rterror("rt_raster_geos_spatial_relationship: Unable to run the appropriate GEOS spatial relationship test");
+ rterror("rt_raster_geos_spatial_relationship: Could not run the appropriate GEOS spatial relationship test");
flag = ES_ERROR;
}
/* spatial relationship test ran fine */
/* get LWMPOLY of each band */
if (rt_raster_surface(rast1, nband1, &surface) != ES_NONE) {
- rterror("rt_raster_distance_within: Unable to get surface of the specified band from the first raster");
+ rterror("rt_raster_distance_within: Could not get surface of the specified band from the first raster");
return ES_ERROR;
}
surface1 = lwmpoly_as_lwgeom(surface);
if (rt_raster_surface(rast2, nband2, &surface) != ES_NONE) {
- rterror("rt_raster_distance_within: Unable to get surface of the specified band from the second raster");
+ rterror("rt_raster_distance_within: Could not get surface of the specified band from the second raster");
lwgeom_free(surface1);
return ES_ERROR;
}
/* get LWMPOLY of each band */
if (rt_raster_surface(rast1, nband1, &surface) != ES_NONE) {
- rterror("rt_raster_fully_within_distance: Unable to get surface of the specified band from the first raster");
+ rterror("rt_raster_fully_within_distance: Could not get surface of the specified band from the first raster");
return ES_ERROR;
}
surface1 = lwmpoly_as_lwgeom(surface);
if (rt_raster_surface(rast2, nband2, &surface) != ES_NONE) {
- rterror("rt_raster_fully_within_distance: Unable to get surface of the specified band from the second raster");
+ rterror("rt_raster_fully_within_distance: Could not get surface of the specified band from the second raster");
lwgeom_free(surface1);
return ES_ERROR;
}
&xr, &yr,
NULL
) != ES_NONE) {
- rterror("rt_raster_same_alignment: Unable to get raster coordinates of second raster from first raster's spatial coordinates");
+ rterror("rt_raster_same_alignment: Could not get raster coordinates of second raster from first raster's spatial coordinates");
*aligned = 0;
return ES_ERROR;
}
&xw, &yw,
NULL
) != ES_NONE) {
- rterror("rt_raster_same_alignment: Unable to get spatial coordinates of second raster from raster coordinates");
+ rterror("rt_raster_same_alignment: Could not get spatial coordinates of second raster from raster coordinates");
*aligned = 0;
return ES_ERROR;
}
/* rasters must be aligned */
if (rt_raster_same_alignment(rast1, rast2, &aligned, NULL) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to test for alignment on the two rasters");
+ rterror("rt_raster_from_two_rasters: Could not test for alignment on the two rasters");
return ES_ERROR;
}
if (!aligned) {
&(_offset[1][0]), &(_offset[1][1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to compute offsets of the second raster relative to the first raster");
+ rterror("rt_raster_from_two_rasters: Could not compute offsets of the second raster relative to the first raster");
return ES_ERROR;
}
_offset[1][0] = -1 * _offset[1][0];
dim[1]
);
if (raster == NULL) {
- rterror("rt_raster_from_two_rasters: Unable to create output raster");
+ rterror("rt_raster_from_two_rasters: Could not create output raster");
return ES_ERROR;
}
rt_raster_set_srid(raster, _rast[i]->srid);
&(gt[0]), &(gt[3]),
NULL
) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to get spatial coordinates of upper-left pixel of output raster");
+ rterror("rt_raster_from_two_rasters: Could not get spatial coordinates of upper-left pixel of output raster");
return ES_ERROR;
}
dim[1]
);
if (raster == NULL) {
- rterror("rt_raster_from_two_rasters: Unable to create output raster");
+ rterror("rt_raster_from_two_rasters: Could not create output raster");
return ES_ERROR;
}
rt_raster_set_srid(raster, _rast[0]->srid);
&(_offset[0][0]), &(_offset[0][1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to get offsets of the FIRST raster relative to the output raster");
+ rterror("rt_raster_from_two_rasters: Could not get offsets of the FIRST raster relative to the output raster");
rt_raster_destroy(raster);
return ES_ERROR;
}
&(_offset[1][0]), &(_offset[1][1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to get offsets of the SECOND raster relative to the output raster");
+ rterror("rt_raster_from_two_rasters: Could not get offsets of the SECOND raster relative to the output raster");
rt_raster_destroy(raster);
return ES_ERROR;
}
raster = rt_raster_new(0, 0);
if (raster == NULL) {
- rterror("rt_raster_from_two_rasters: Unable to create output raster");
+ rterror("rt_raster_from_two_rasters: Could not create output raster");
return ES_ERROR;
}
rt_raster_set_srid(raster, _rast[0]->srid);
dim[1]
);
if (raster == NULL) {
- rterror("rt_raster_from_two_rasters: Unable to create output raster");
+ rterror("rt_raster_from_two_rasters: Could not create output raster");
return ES_ERROR;
}
rt_raster_set_srid(raster, _rast[0]->srid);
&(gt[0]), &(gt[3]),
gt
) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to get spatial coordinates of upper-left pixel of output raster");
+ rterror("rt_raster_from_two_rasters: Could not get spatial coordinates of upper-left pixel of output raster");
rt_raster_destroy(raster);
return ES_ERROR;
}
&(_offset[0][0]), &(_offset[0][1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to get pixel coordinates to compute the offsets of the FIRST raster relative to the output raster");
+ rterror("rt_raster_from_two_rasters: Could not get pixel coordinates to compute the offsets of the FIRST raster relative to the output raster");
rt_raster_destroy(raster);
return ES_ERROR;
}
&(_offset[1][0]), &(_offset[1][1]),
NULL
) != ES_NONE) {
- rterror("rt_raster_from_two_rasters: Unable to get pixel coordinates to compute the offsets of the SECOND raster relative to the output raster");
+ rterror("rt_raster_from_two_rasters: Could not get pixel coordinates to compute the offsets of the SECOND raster relative to the output raster");
rt_raster_destroy(raster);
return ES_ERROR;
}
is the only way to guarentee the memory isn't shared
*/
if (rt_raster_get_convex_hull(raster, &tmp) != ES_NONE) {
- rterror("rt_raster_surface: Unable to get convex hull of raster");
+ rterror("rt_raster_surface: Could not get convex hull of raster");
return ES_ERROR;
}
mpoly = lwgeom_as_multi(tmp);
is the only way to guarentee the memory isn't shared
*/
if (rt_raster_get_convex_hull(raster, &tmp) != ES_NONE) {
- rterror("rt_raster_surface: Unable to get convex hull of raster");
+ rterror("rt_raster_surface: Could not get convex hull of raster");
return ES_ERROR;
}
mpoly = lwgeom_as_multi(tmp);
geomscount = gvcount;
geoms = rtalloc(sizeof(GEOSGeometry *) * geomscount);
if (geoms == NULL) {
- rterror("rt_raster_surface: Unable to allocate memory for pixel polygons as GEOSGeometry");
+ rterror("rt_raster_surface: Could not allocate memory for pixel polygons as GEOSGeometry");
for (i = 0; i < gvcount; i++) lwpoly_free(gv[i].geom);
rtdealloc(gv);
return ES_ERROR;
if (gc == NULL) {
#if POSTGIS_GEOS_VERSION >= 33
- rterror("rt_raster_surface: Unable to create GEOS GEOMETRYCOLLECTION from set of pixel polygons");
+ rterror("rt_raster_surface: Could not create GEOS GEOMETRYCOLLECTION from set of pixel polygons");
#else
- rterror("rt_raster_surface: Unable to create GEOS MULTIPOLYGON from set of pixel polygons");
+ rterror("rt_raster_surface: Could not create GEOS MULTIPOLYGON from set of pixel polygons");
#endif
for (i = 0; i < geomscount; i++)
if (gunion == NULL) {
#if POSTGIS_GEOS_VERSION >= 33
- rterror("rt_raster_surface: Unable to union the pixel polygons using GEOSUnaryUnion()");
+ rterror("rt_raster_surface: Could not union the pixel polygons using GEOSUnaryUnion()");
#else
- rterror("rt_raster_surface: Unable to union the pixel polygons using GEOSUnionCascaded()");
+ rterror("rt_raster_surface: Could not union the pixel polygons using GEOSUnionCascaded()");
#endif
return ES_ERROR;
}
_param = rtalloc(sizeof(struct _rti_iterator_arg_t));
if (_param == NULL) {
- rterror("_rti_iterator_arg_init: Unable to allocate memory for _rti_iterator_arg");
+ rterror("_rti_iterator_arg_init: Could not allocate memory for _rti_iterator_arg");
return NULL;
}
_param->band.nodataval == NULL ||
_param->band.minval == NULL
) {
- rterror("_rti_iterator_arg_populate: Unable to allocate memory for children of _rti_iterator_arg");
+ rterror("_rti_iterator_arg_populate: Could not allocate memory for children of _rti_iterator_arg");
return 0;
}
if (hasband) {
_param->band.rtband[i] = rt_raster_get_band(itrset[i].raster, itrset[i].nband);
if (_param->band.rtband[i] == NULL) {
- rterror("_rti_iterator_arg_populate: Unable to get band %d for raster %d", itrset[i].nband, i);
+ rterror("_rti_iterator_arg_populate: Could not get band %d for raster %d", itrset[i].nband, i);
return 0;
}
/* init offset */
_param->offset[i] = rtalloc(sizeof(double) * 2);
if (_param->offset[i] == NULL) {
- rterror("_rti_iterator_arg_populate: Unable to allocate memory for offsets");
+ rterror("_rti_iterator_arg_populate: Could not allocate memory for offsets");
return 0;
}
}
_param->empty.values = rtalloc(sizeof(double *) * _param->dimension.rows);
_param->empty.nodata = rtalloc(sizeof(int *) * _param->dimension.rows);
if (_param->empty.values == NULL || _param->empty.nodata == NULL) {
- rterror("_rti_iterator_arg_empty_init: Unable to allocate memory for empty values and NODATA");
+ rterror("_rti_iterator_arg_empty_init: Could not allocate memory for empty values and NODATA");
return 0;
}
_param->empty.nodata[y] = rtalloc(sizeof(int) * _param->dimension.columns);
if (_param->empty.values[y] == NULL || _param->empty.nodata[y] == NULL) {
- rterror("_rti_iterator_arg_empty_init: Unable to allocate memory for elements of empty values and NODATA");
+ rterror("_rti_iterator_arg_empty_init: Could not allocate memory for elements of empty values and NODATA");
return 0;
}
_param->arg = rtalloc(sizeof(struct rt_iterator_arg_t));
if (_param->arg == NULL) {
- rterror("_rti_iterator_arg_callback_init: Unable to allocate memory for rt_iterator_arg");
+ rterror("_rti_iterator_arg_callback_init: Could not allocate memory for rt_iterator_arg");
return 0;
}
_param->arg->nodata = rtalloc(sizeof(int **) * _param->count);
_param->arg->src_pixel = rtalloc(sizeof(int *) * _param->count);
if (_param->arg->values == NULL || _param->arg->nodata == NULL || _param->arg->src_pixel == NULL) {
- rterror("_rti_iterator_arg_callback_init: Unable to allocate memory for element of rt_iterator_arg");
+ rterror("_rti_iterator_arg_callback_init: Could not allocate memory for element of rt_iterator_arg");
return 0;
}
memset(_param->arg->values, 0, sizeof(double **) * _param->count);
_param->arg->src_pixel[i] = rtalloc(sizeof(int) * 2);
if (_param->arg->src_pixel[i] == NULL) {
- rterror("_rti_iterator_arg_callback_init: Unable to allocate memory for position elements of rt_iterator_arg");
+ rterror("_rti_iterator_arg_callback_init: Could not allocate memory for position elements of rt_iterator_arg");
return 0;
}
memset(_param->arg->src_pixel[i], 0, sizeof(int) * 2);
/* initialize _param */
if ((_param = _rti_iterator_arg_init()) == NULL) {
- rterror("rt_raster_iterator: Unable to initialize internal variables");
+ rterror("rt_raster_iterator: Could not initialize internal variables");
return ES_ERROR;
}
/* fill _param */
if (!_rti_iterator_arg_populate(_param, itrset, itrcount, distancex, distancey, &allnull, &allempty)) {
- rterror("rt_raster_iterator: Unable to populate for internal variables");
+ rterror("rt_raster_iterator: Could not populate for internal variables");
_rti_iterator_arg_destroy(_param);
return ES_ERROR;
}
rtnrast = rt_raster_new(0, 0);
if (rtnrast == NULL) {
- rterror("rt_raster_iterator: Unable to create empty raster");
+ rterror("rt_raster_iterator: Could not create empty raster");
return ES_ERROR;
}
rt_raster_set_scale(rtnrast, 0, 0);
/* check custom first if set. also skip if rasters are the same */
if (extenttype == ET_CUSTOM && rast != customextent) {
if (rt_raster_same_alignment(rast, customextent, &aligned, NULL) != ES_NONE) {
- rterror("rt_raster_iterator: Unable to test for alignment between reference raster and custom extent");
+ rterror("rt_raster_iterator: Could not test for alignment between reference raster and custom extent");
_rti_iterator_arg_destroy(_param);
continue;
if (rt_raster_same_alignment(rast, _param->raster[i], &aligned, NULL) != ES_NONE) {
- rterror("rt_raster_iterator: Unable to test for alignment between reference raster and raster %d", i);
+ rterror("rt_raster_iterator: Could not test for alignment between reference raster and raster %d", i);
_rti_iterator_arg_destroy(_param);
/* make copy of first "real" raster */
rtnrast = rtalloc(sizeof(struct rt_raster_t));
if (rtnrast == NULL) {
- rterror("rt_raster_iterator: Unable to allocate memory for output raster");
+ rterror("rt_raster_iterator: Could not allocate memory for output raster");
_rti_iterator_arg_destroy(_param);
rtdealloc(rtnrast);
if (rast == NULL || status != ES_NONE) {
- rterror("rt_raster_iterator: Unable to compute %s extent of rasters",
+ rterror("rt_raster_iterator: Could not compute %s extent of rasters",
extenttype == ET_UNION ? "union" : "intersection"
);
rtnrast = rt_raster_new(0, 0);
if (rtnrast == NULL) {
- rterror("rt_raster_iterator: Unable to create empty raster");
+ rterror("rt_raster_iterator: Could not create empty raster");
return ES_ERROR;
}
rt_raster_set_scale(rtnrast, 0, 0);
case ET_CUSTOM:
rtnrast = rtalloc(sizeof(struct rt_raster_t));
if (rtnrast == NULL) {
- rterror("rt_raster_iterator: Unable to allocate memory for output raster");
+ rterror("rt_raster_iterator: Could not allocate memory for output raster");
_rti_iterator_arg_destroy(_param);
/* init values and NODATA for use with empty rasters */
if (!_rti_iterator_arg_empty_init(_param)) {
- rterror("rt_raster_iterator: Unable to initialize empty values and NODATA");
+ rterror("rt_raster_iterator: Could not initialize empty values and NODATA");
_rti_iterator_arg_destroy(_param);
rt_raster_destroy(rtnrast);
hasnodata, nodataval,
0
) < 0) {
- rterror("rt_raster_iterator: Unable to add new band to output raster");
+ rterror("rt_raster_iterator: Could not add new band to output raster");
_rti_iterator_arg_destroy(_param);
rt_raster_destroy(rtnrast);
/* get output band */
rtnband = rt_raster_get_band(rtnrast, 0);
if (rtnband == NULL) {
- rterror("rt_raster_iterator: Unable to get new band from output raster");
+ rterror("rt_raster_iterator: Could not get new band from output raster");
_rti_iterator_arg_destroy(_param);
rt_raster_destroy(rtnrast);
/* initialize argument for callback function */
if (!_rti_iterator_arg_callback_init(_param)) {
- rterror("rt_raster_iterator: Unable to initialize callback function argument");
+ rterror("rt_raster_iterator: Could not initialize callback function argument");
_rti_iterator_arg_destroy(_param);
rt_band_destroy(rtnband);
status = rt_raster_from_two_rasters(rtnrast, _param->raster[i], ET_FIRST, &rast, offset);
rtdealloc(rast);
if (status != ES_NONE) {
- rterror("rt_raster_iterator: Unable to compute raster offsets");
+ rterror("rt_raster_iterator: Could not compute raster offsets");
_rti_iterator_arg_destroy(_param);
rt_band_destroy(rtnband);
&npixels
);
if (status < 0) {
- rterror("rt_raster_iterator: Unable to get pixel neighborhood");
+ rterror("rt_raster_iterator: Could not get pixel neighborhood");
_rti_iterator_arg_destroy(_param);
rt_band_destroy(rtnband);
&value,
&isnodata
) != ES_NONE) {
- rterror("rt_raster_iterator: Unable to get the pixel value of band");
+ rterror("rt_raster_iterator: Could not get the pixel value of band");
_rti_iterator_arg_destroy(_param);
rt_band_destroy(rtnband);
npixels = (rt_pixel) rtalloc(sizeof(struct rt_pixel_t));
if (npixels == NULL) {
- rterror("rt_raster_iterator: Unable to reallocate memory for neighborhood");
+ rterror("rt_raster_iterator: Could not reallocate memory for neighborhood");
_rti_iterator_arg_destroy(_param);
rt_band_destroy(rtnband);
);
rtdealloc(npixels);
if (status != ES_NONE) {
- rterror("rt_raster_iterator: Unable to create 2D array of neighborhood");
+ rterror("rt_raster_iterator: Could not create 2D array of neighborhood");
_rti_iterator_arg_destroy(_param);
rt_band_destroy(rtnband);
RASTER_DEBUGF(4, "NOT burning pixel (%d, %d)", _x, _y);
}
if (status != ES_NONE) {
- rterror("rt_raster_iterator: Unable to set pixel value");
+ rterror("rt_raster_iterator: Could not set pixel value");
_rti_iterator_arg_destroy(_param);
rt_band_destroy(rtnband);
/* every third pixel */
for (x = offset; x < width; x += 3) {
if (rt_band_get_pixel(band, x, y, &value, &nodata) != ES_NONE) {
- rterror("_rti_raster_get_band_perimeter: Unable to get band pixel");
+ rterror("_rti_raster_get_band_perimeter: Could not get band pixel");
return ES_ERROR;
}
/* every third pixel */
for (y = offset; y < height; y += 3) {
if (rt_band_get_pixel(band, x, y, &value, &nodata) != ES_NONE) {
- rterror("_rti_raster_get_band_perimeter: Unable to get band pixel");
+ rterror("_rti_raster_get_band_perimeter: Could not get band pixel");
return ES_ERROR;
}
/* every third pixel */
for (x = offset; x < width; x += 3) {
if (rt_band_get_pixel(band, x, y, &value, &nodata) != ES_NONE) {
- rterror("_rti_raster_get_band_perimeter: Unable to get band pixel");
+ rterror("_rti_raster_get_band_perimeter: Could not get band pixel");
return ES_ERROR;
}
/* every third pixel */
for (y = offset; y < height; y += 3) {
if (rt_band_get_pixel(band, x, y, &value, &nodata) != ES_NONE) {
- rterror("_rti_raster_get_band_perimeter: Unable to get band pixel");
+ rterror("_rti_raster_get_band_perimeter: Could not get band pixel");
return ES_ERROR;
}
_nband = rtalloc(sizeof(uint16_t) * numband);
if (_nband == NULL) {
- rterror("rt_raster_get_boundary: Unable to allocate memory for band indices");
+ rterror("rt_raster_get_boundary: Could not allocate memory for band indices");
return ES_ERROR;
}
for (i = 0; i < numband; i++) {
band = rt_raster_get_band(raster, _nband[i]);
if (band == NULL) {
- rterror("rt_raster_get_boundary: Unable to get band at index %d", _nband[i]);
+ rterror("rt_raster_get_boundary: Could not get band at index %d", _nband[i]);
rtdealloc(_nband);
return ES_ERROR;
}
continue;
if (_rti_raster_get_band_perimeter(band, trim) != ES_NONE) {
- rterror("rt_raster_get_boundary: Unable band perimeter");
+ rterror("rt_raster_get_boundary: Could not get band perimeter");
rtdealloc(_nband);
return ES_ERROR;
}
/* only one ring */
rings = (POINTARRAY **) rtalloc(sizeof (POINTARRAY*));
if (!rings) {
- rterror("rt_raster_get_perimeter: Unable to allocate memory for polygon ring");
+ rterror("rt_raster_get_perimeter: Could not allocate memory for polygon ring");
return ES_ERROR;
}
rings[0] = ptarray_construct(0, 0, 5);
if (!rings[0]) {
- rterror("rt_raster_get_perimeter: Unable to construct point array");
+ rterror("rt_raster_get_perimeter: Could not construct point array");
return ES_ERROR;
}
pts = rings[0];
arg = rtalloc(sizeof(struct _rti_colormap_arg_t));
if (arg == NULL) {
- rterror("_rti_colormap_arg_init: Unable to allocate memory for _rti_color_arg");
+ rterror("_rti_colormap_arg_init: Could not allocate memory for _rti_color_arg");
return NULL;
}
else {
arg->raster = rt_raster_clone(raster, 0);
if (arg->raster == NULL) {
- rterror("_rti_colormap_arg_init: Unable to create output raster");
+ rterror("_rti_colormap_arg_init: Could not create output raster");
return NULL;
}
}
band = rt_raster_get_band(raster, nband);
if (band == NULL) {
- rterror("rt_raster_colormap: Unable to get band at index %d", nband);
+ rterror("rt_raster_colormap: Could not get band at index %d", nband);
return NULL;
}
/* init internal variables */
arg = _rti_colormap_arg_init(raster);
if (arg == NULL) {
- rterror("rt_raster_colormap: Unable to initialize internal variables");
+ rterror("rt_raster_colormap: Could not initialize internal variables");
return NULL;
}
arg->npos = 0;
arg->pos = rtalloc(sizeof(uint16_t) * colormap->nentry);
if (arg->pos == NULL) {
- rterror("rt_raster_colormap: Unable to allocate memory for valid entries");
+ rterror("rt_raster_colormap: Could not allocate memory for valid entries");
_rti_colormap_arg_destroy(arg);
return NULL;
}
arg->nexpr += 1;
arg->expr = rtalloc(sizeof(rt_reclassexpr) * arg->nexpr);
if (arg->expr == NULL) {
- rterror("rt_raster_colormap: Unable to allocate memory for reclass expressions");
+ rterror("rt_raster_colormap: Could not allocate memory for reclass expressions");
_rti_colormap_arg_destroy(arg);
return NULL;
}
for (i = 0; i < arg->nexpr; i++) {
arg->expr[i] = rtalloc(sizeof(struct rt_reclassexpr_t));
if (arg->expr[i] == NULL) {
- rterror("rt_raster_colormap: Unable to allocate memory for reclass expression");
+ rterror("rt_raster_colormap: Could not allocate memory for reclass expression");
_rti_colormap_arg_destroy(arg);
return NULL;
}
/* call rt_band_reclass */
arg->band = rt_band_reclass(band, PT_8BUI, 0, 0, arg->expr, arg->nexpr);
if (arg->band == NULL) {
- rterror("rt_raster_colormap: Unable to reclassify band");
+ rterror("rt_raster_colormap: Could not reclassify band");
_rti_colormap_arg_destroy(arg);
return NULL;
}
/* add reclassified band to raster */
if (rt_raster_add_band(arg->raster, arg->band, rt_raster_get_num_bands(arg->raster)) < 0) {
- rterror("rt_raster_colormap: Unable to add reclassified band to output raster");
+ rterror("rt_raster_colormap: Could not add reclassified band to output raster");
_rti_colormap_arg_destroy(arg);
return NULL;
}
len = sizeof(char) * (strlen("SELECT CASE WHEN (upper(auth_name) = 'EPSG' OR upper(auth_name) = 'EPSGA') AND length(COALESCE(auth_srid::text, '')) > 0 THEN upper(auth_name) || ':' || auth_srid WHEN length(COALESCE(auth_name, '') || COALESCE(auth_srid::text, '')) > 0 THEN COALESCE(auth_name, '') || COALESCE(auth_srid::text, '') ELSE '' END, proj4text, srtext FROM spatial_ref_sys WHERE srid = LIMIT 1") + MAX_INT_CHARLEN + 1);
sql = (char *) palloc(len);
if (NULL == sql) {
- elog(ERROR, "rtpg_getSR: Unable to allocate memory for sql\n");
+ elog(ERROR, "rtpg_getSR: Could not allocate memory for sql\n");
return NULL;
}
len = strlen(tmp) + 1;
srs = SPI_palloc(sizeof(char) * len);
if (NULL == srs) {
- elog(ERROR, "rtpg_getSR: Unable to allocate memory for spatial reference text\n");
+ elog(ERROR, "rtpg_getSR: Could not allocate memory for spatial reference text\n");
pfree(tmp);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
/* unable to get SR info */
if (srs == NULL) {
- elog(ERROR, "rtpg_getSR: Unable to find a viable spatial reference for SRID (%d)", srid);
+ elog(ERROR, "rtpg_getSR: Could not find a viable spatial reference for SRID (%d)", srid);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
return NULL;
arg = palloc(sizeof(struct rtpg_dumpvalues_arg_t));
if (arg == NULL) {
- elog(ERROR, "rtpg_dumpvalues_arg_init: Unable to allocate memory for arguments");
+ elog(ERROR, "rtpg_dumpvalues_arg_init: Could not allocate memory for arguments");
return NULL;
}
/* initialize arg1 */
arg1 = rtpg_dumpvalues_arg_init();
if (arg1 == NULL) {
- elog(ERROR, "RASTER_dumpValues: Unable to initialize argument structure");
+ elog(ERROR, "RASTER_dumpValues: Could not initialize argument structure");
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
MemoryContextSwitchTo(oldcontext);
arg1->nbands = palloc(sizeof(int) * arg1->numbands);
if (arg1->nbands == NULL) {
- elog(ERROR, "RASTER_dumpValues: Unable to allocate memory for band indexes");
+ elog(ERROR, "RASTER_dumpValues: Could not allocate memory for band indexes");
rtpg_dumpvalues_arg_destroy(arg1);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
if (j < arg1->numbands) {
arg1->nbands = repalloc(arg1->nbands, sizeof(int) * j);
if (arg1->nbands == NULL) {
- elog(ERROR, "RASTER_dumpValues: Unable to reallocate memory for band indexes");
+ elog(ERROR, "RASTER_dumpValues: Could not reallocate memory for band indexes");
rtpg_dumpvalues_arg_destroy(arg1);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
arg1->nbands = palloc(sizeof(int) * arg1->numbands);
if (arg1->nbands == NULL) {
- elog(ERROR, "RASTER_dumpValues: Unable to allocate memory for band indexes");
+ elog(ERROR, "RASTER_dumpValues: Could not allocate memory for band indexes");
rtpg_dumpvalues_arg_destroy(arg1);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
arg1->values = palloc(sizeof(Datum *) * arg1->numbands);
arg1->nodata = palloc(sizeof(bool *) * arg1->numbands);
if (arg1->values == NULL || arg1->nodata == NULL) {
- elog(ERROR, "RASTER_dumpValues: Unable to allocate memory for pixel values");
+ elog(ERROR, "RASTER_dumpValues: Could not allocate memory for pixel values");
rtpg_dumpvalues_arg_destroy(arg1);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
for (z = 0; z < arg1->numbands; z++) {
band = rt_raster_get_band(raster, arg1->nbands[z]);
if (!band) {
- elog(ERROR, "RASTER_dumpValues: Unable to get band at index %d", arg1->nbands[z] + 1);
+ elog(ERROR, "RASTER_dumpValues: Could not get band at index %d", arg1->nbands[z] + 1);
rtpg_dumpvalues_arg_destroy(arg1);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
arg1->values[z] = palloc(sizeof(Datum) * arg1->rows * arg1->columns);
arg1->nodata[z] = palloc(sizeof(bool) * arg1->rows * arg1->columns);
if (arg1->values[z] == NULL || arg1->nodata[z] == NULL) {
- elog(ERROR, "RASTER_dumpValues: Unable to allocate memory for pixel values");
+ elog(ERROR, "RASTER_dumpValues: Could not allocate memory for pixel values");
rtpg_dumpvalues_arg_destroy(arg1);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
for (x = 0; x < arg1->columns; x++) {
/* get pixel */
if (rt_band_get_pixel(band, x, y, &val, &isnodata) != ES_NONE) {
- elog(ERROR, "RASTER_dumpValues: Unable to pixel (%d, %d) of band %d", x, y, arg1->nbands[z] + 1);
+ elog(ERROR, "RASTER_dumpValues: Could not pixel (%d, %d) of band %d", x, y, arg1->nbands[z] + 1);
rtpg_dumpvalues_arg_destroy(arg1);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
numpixval = num;
pixval = palloc(sizeof(struct pixelvalue) * numpixval);
if (pixval == NULL) {
- elog(ERROR, "RASTER_setPixelValuesArray: Unable to allocate memory for new pixel values");
+ elog(ERROR, "RASTER_setPixelValuesArray: Could not allocate memory for new pixel values");
pfree(elements);
pfree(nulls);
rt_raster_destroy(raster);
static rtpg_setvaluesgv_arg rtpg_setvaluesgv_arg_init() {
rtpg_setvaluesgv_arg arg = palloc(sizeof(struct rtpg_setvaluesgv_arg_t));
if (arg == NULL) {
- elog(ERROR, "rtpg_setvaluesgv_arg_init: Unable to allocate memory for function arguments");
+ elog(ERROR, "rtpg_setvaluesgv_arg_init: Could not allocate memory for function arguments");
return NULL;
}
/* init arg */
arg = rtpg_setvaluesgv_arg_init();
if (arg == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to intialize argument structure");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not intialize argument structure");
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
arg->gv = palloc(sizeof(struct rtpg_setvaluesgv_geomval_t) * n);
if (arg->gv == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to allocate memory for geomval array");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not allocate memory for geomval array");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
gser = (GSERIALIZED *) PG_DETOAST_DATUM(tupv);
arg->gv[arg->ngv].geom = lwgeom_from_gserialized(gser);
if (arg->gv[arg->ngv].geom == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to deserialize geometry of geomval at index %d", i);
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not deserialize geometry of geomval at index %d", i);
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
}
if (arg->gv[arg->ngv].mask == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to rasterize geometry of geomval at index %d", i);
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not rasterize geometry of geomval at index %d", i);
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
if (arg->ngv < n) {
arg->gv = repalloc(arg->gv, sizeof(struct rtpg_setvaluesgv_geomval_t) * arg->ngv);
if (arg->gv == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to reallocate memory for geomval array");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not reallocate memory for geomval array");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
getPoint2d_p(point->point, 0, &p);
if (rt_raster_geopoint_to_cell(raster, p.x, p.y, &(xy[0]), &(xy[1]), igt) != ES_NONE) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to process coordinates of point");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not process coordinates of point");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
/* get pixel value */
if (rt_band_get_pixel(band, xy[0], xy[1], &value, &isnodata) != ES_NONE) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to get pixel value");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not get pixel value");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
noerr = rt_band_set_pixel(band, xy[0], xy[1], arg->gv[i].pixval.value, NULL);
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to set pixel value");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not set pixel value");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
/* init itrset */
itrset = palloc(sizeof(struct rt_iterator_t) * (arg->ngv + 1));
if (itrset == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to allocate memory for iterator arguments");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not allocate memory for iterator arguments");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
pfree(itrset);
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to run raster iterator function");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not run raster iterator function");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
/* copy band from _raster to raster */
_band = rt_raster_get_band(_raster, 0);
if (_band == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to get band from working raster");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not get band from working raster");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(_raster);
rt_raster_destroy(raster);
_band = rt_raster_replace_band(raster, _band, nband - 1);
if (_band == NULL) {
- elog(ERROR, "RASTER_setPixelValuesGeomval: Unable to replace band in output raster");
+ elog(ERROR, "RASTER_setPixelValuesGeomval: Could not replace band in output raster");
rtpg_setvaluesgv_arg_destroy(arg);
rt_raster_destroy(_raster);
rt_raster_destroy(raster);
if (count < 1) {
/* error */
if (count < 0)
- elog(NOTICE, "Unable to get the pixels of search values for band at index %d", nband);
+ elog(NOTICE, "Could not get the pixels of search values for band at index %d", nband);
/* no nearest pixel */
else
elog(NOTICE, "No pixels of search values found for band at index %d", nband);
&x, &y,
NULL
) != ES_NONE) {
- elog(ERROR, "RASTER_nearestValue: Unable to compute pixel coordinates from spatial coordinates");
+ elog(ERROR, "RASTER_nearestValue: Could not compute pixel coordinates from spatial coordinates");
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
lwgeom_free(lwgeom);
(y >= 0 && y < rt_raster_get_height(raster))
) {
if (rt_band_get_pixel(band, x, y, &value, &isnodata) != ES_NONE) {
- elog(ERROR, "RASTER_nearestValue: Unable to get pixel value for band at index %d", bandindex);
+ elog(ERROR, "RASTER_nearestValue: Could not get pixel value for band at index %d", bandindex);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
lwgeom_free(lwgeom);
if (count < 1) {
/* error */
if (count < 0)
- elog(NOTICE, "Unable to get the nearest value for band at index %d", bandindex);
+ elog(NOTICE, "Could not get the nearest value for band at index %d", bandindex);
/* no nearest pixel */
else
elog(NOTICE, "No nearest value found for band at index %d", bandindex);
/* convex-hull of pixel */
poly = rt_raster_pixel_as_polygon(raster, npixels[i].x, npixels[i].y);
if (!poly) {
- elog(ERROR, "RASTER_nearestValue: Unable to get polygon of neighboring pixel");
+ elog(ERROR, "RASTER_nearestValue: Could not get polygon of neighboring pixel");
lwgeom_free(lwgeom);
PG_FREE_IF_COPY(geom, 2);
rt_raster_destroy(raster);
);
/* error */
if (count < 0) {
- elog(NOTICE, "Unable to get the pixel's neighborhood for band at index %d", bandindex);
+ elog(NOTICE, "Could not get the pixel's neighborhood for band at index %d", bandindex);
rt_band_destroy(band);
rt_raster_destroy(raster);
&pixval,
&isnodata
) != ES_NONE) {
- elog(NOTICE, "Unable to get the pixel of band at index %d. Returning NULL", bandindex);
+ elog(NOTICE, "Could not get the pixel of band at index %d. Returning NULL", bandindex);
rt_band_destroy(band);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
else
npixels = (rt_pixel) palloc(sizeof(struct rt_pixel_t));
if (npixels == NULL) {
- elog(ERROR, "RASTER_neighborhood: Unable to reallocate memory for neighborhood");
+ elog(ERROR, "RASTER_neighborhood: Could not reallocate memory for neighborhood");
rt_band_destroy(band);
rt_raster_destroy(raster);
);
pfree(npixels);
if (count != ES_NONE) {
- elog(NOTICE, "Unable to create 2D array of neighborhood");
+ elog(NOTICE, "Could not create 2D array of neighborhood");
PG_RETURN_NULL();
}
nodata1D = palloc(sizeof(bool) * dim[0] * dim[1]);
if (value1D == NULL || nodata1D == NULL) {
- elog(ERROR, "RASTER_neighborhood: Unable to allocate memory for return 2D array");
+ elog(ERROR, "RASTER_neighborhood: Could not allocate memory for return 2D array");
for (i = 0; i < dim[0]; i++) {
pfree(value2D[i]);
/* allocate addbandarg */
arg = (struct addbandarg *) palloc(sizeof(struct addbandarg) * n);
if (arg == NULL) {
- elog(ERROR, "RASTER_addBand: Unable to allocate memory for addbandarg");
+ elog(ERROR, "RASTER_addBand: Could not allocate memory for addbandarg");
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
srcnband = palloc(sizeof(int) * numsrcnband);
if (srcnband == NULL) {
- elog(ERROR, "RASTER_addBandOutDB: Unable to allocate memory for band indexes");
+ elog(ERROR, "RASTER_addBandOutDB: Could not allocate memory for band indexes");
if (pgraster != NULL) {
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
if (j < numsrcnband) {
srcnband = repalloc(srcnband, sizeof(int) * j);
if (srcnband == NULL) {
- elog(ERROR, "RASTER_addBandOutDB: Unable to reallocate memory for band indexes");
+ elog(ERROR, "RASTER_addBandOutDB: Could not reallocate memory for band indexes");
if (pgraster != NULL) {
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
elog(INFO, "Unknown SRS auth name and code from out-db file. Defaulting SRID of new raster to %d", SRID_UNKNOWN);
}
else
- elog(INFO, "Unable to get SRS auth name and code from out-db file. Defaulting SRID of new raster to %d", SRID_UNKNOWN);
+ elog(INFO, "Could not get SRS auth name and code from out-db file. Defaulting SRID of new raster to %d", SRID_UNKNOWN);
}
/* some raster info */
numsrcnband = numbands;
srcnband = palloc(sizeof(int) * numsrcnband);
if (srcnband == NULL) {
- elog(ERROR, "RASTER_addBandOutDB: Unable to allocate memory for band indexes");
+ elog(ERROR, "RASTER_addBandOutDB: Could not allocate memory for band indexes");
GDALClose(hdsOut);
if (raster != NULL)
rt_raster_destroy(raster);
hbandOut = NULL;
hbandOut = GDALGetRasterBand(hdsOut, srcnband[i]);
if (NULL == hbandOut) {
- elog(ERROR, "RASTER_addBandOutDB: Unable to get band %d from GDAL dataset", srcnband[i]);
+ elog(ERROR, "RASTER_addBandOutDB: Could not get band %d from GDAL dataset", srcnband[i]);
GDALClose(hdsOut);
if (raster != NULL)
rt_raster_destroy(raster);
srcnband[i] - 1, outdbfile
);
if (band == NULL) {
- elog(ERROR, "RASTER_addBandOutDB: Unable to create new out-db band");
+ elog(ERROR, "RASTER_addBandOutDB: Could not create new out-db band");
GDALClose(hdsOut);
if (raster != NULL)
rt_raster_destroy(raster);
}
if (rt_raster_add_band(raster, band, j) < 0) {
- elog(ERROR, "RASTER_addBandOutDB: Unable to add new out-db band to raster");
+ elog(ERROR, "RASTER_addBandOutDB: Could not add new out-db band to raster");
GDALClose(hdsOut);
if (raster != NULL)
rt_raster_destroy(raster);
/* allocate arg1 */
arg1 = palloc(sizeof(struct tile_arg_t));
if (arg1 == NULL) {
- elog(ERROR, "RASTER_tile: Unable to allocate memory for arguments");
+ elog(ERROR, "RASTER_tile: Could not allocate memory for arguments");
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
arg1->nbands = palloc(sizeof(int) * arg1->numbands);
if (arg1->nbands == NULL) {
- elog(ERROR, "RASTER_tile: Unable to allocate memory for band indexes");
+ elog(ERROR, "RASTER_tile: Could not allocate memory for band indexes");
rt_raster_destroy(arg1->raster.raster);
pfree(arg1);
PG_FREE_IF_COPY(pgraster, 0);
if (j < arg1->numbands) {
arg1->nbands = repalloc(arg1->nbands, sizeof(int) * j);
if (arg1->nbands == NULL) {
- elog(ERROR, "RASTER_tile: Unable to reallocate memory for band indexes");
+ elog(ERROR, "RASTER_tile: Could not reallocate memory for band indexes");
rt_raster_destroy(arg1->raster.raster);
pfree(arg1);
PG_FREE_IF_COPY(pgraster, 0);
arg1->nbands = palloc(sizeof(int) * arg1->numbands);
if (arg1->nbands == NULL) {
- elog(ERROR, "RASTER_dumpValues: Unable to allocate memory for pixel values");
+ elog(ERROR, "RASTER_dumpValues: Could not allocate memory for pixel values");
rt_raster_destroy(arg1->raster.raster);
pfree(arg1);
PG_FREE_IF_COPY(pgraster, 0);
/* upper-left of tile in spatial coordinates */
if (rt_raster_cell_to_geopoint(arg2->raster.raster, rx, ry, &ulx, &uly, arg2->raster.gt) != ES_NONE) {
- elog(ERROR, "RASTER_tile: Unable to compute the coordinates of the upper-left corner of the output tile");
+ elog(ERROR, "RASTER_tile: Could not compute the coordinates of the upper-left corner of the output tile");
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
if (arg2->numbands) pfree(arg2->nbands);
_band = rt_raster_get_band(arg2->raster.raster, arg2->nbands[i]);
if (_band == NULL) {
- elog(ERROR, "RASTER_tile: Unable to get band %d from source raster", arg2->nbands[i] + 1);
+ elog(ERROR, "RASTER_tile: Could not get band %d from source raster", arg2->nbands[i] + 1);
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
if (arg2->numbands) pfree(arg2->nbands);
/* inline band */
if (!rt_band_is_offline(_band)) {
if (rt_raster_generate_new_band(tile, pixtype, nodataval, hasnodata, nodataval, i) < 0) {
- elog(ERROR, "RASTER_tile: Unable to add new band to output tile");
+ elog(ERROR, "RASTER_tile: Could not add new band to output tile");
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
pfree(arg2->nbands);
}
band = rt_raster_get_band(tile, i);
if (band == NULL) {
- elog(ERROR, "RASTER_tile: Unable to get newly added band from output tile");
+ elog(ERROR, "RASTER_tile: Could not get newly added band from output tile");
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
if (arg2->numbands) pfree(arg2->nbands);
POSTGIS_RT_DEBUGF(4, "getting pixel line %d, %d for %d pixels", rx, k, len);
if (rt_band_get_pixel_line(_band, rx, k, len, &vals, &nvals) != ES_NONE) {
- elog(ERROR, "RASTER_tile: Unable to get pixel line from source raster");
+ elog(ERROR, "RASTER_tile: Could not get pixel line from source raster");
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
if (arg2->numbands) pfree(arg2->nbands);
}
if (nvals && rt_band_set_pixel_line(band, 0, j, vals, nvals) != ES_NONE) {
- elog(ERROR, "RASTER_tile: Unable to set pixel line of output tile");
+ elog(ERROR, "RASTER_tile: Could not set pixel line of output tile");
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
if (arg2->numbands) pfree(arg2->nbands);
);
if (band == NULL) {
- elog(ERROR, "RASTER_tile: Unable to create new offline band for output tile");
+ elog(ERROR, "RASTER_tile: Could not create new offline band for output tile");
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
if (arg2->numbands) pfree(arg2->nbands);
}
if (rt_raster_add_band(tile, band, i) < 0) {
- elog(ERROR, "RASTER_tile: Unable to add new offline band to output tile");
+ elog(ERROR, "RASTER_tile: Could not add new offline band to output tile");
rt_band_destroy(band);
rt_raster_destroy(tile);
rt_raster_destroy(arg2->raster.raster);
if (initexpr != NULL && strstr(initexpr, "[rast") == NULL) {
ret = SPI_connect();
if (ret != SPI_OK_CONNECT) {
- elog(ERROR, "RASTER_mapAlgebraExpr: Unable to connect to the SPI manager."
+ elog(ERROR, "RASTER_mapAlgebraExpr: Could not connect to the SPI manager."
" Aborting");
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
/* define values */
values = (Datum *) palloc(sizeof(Datum) * argcount);
if (values == NULL) {
- elog(ERROR, "RASTER_mapAlgebraExpr: Unable to allocate memory for value parameters of prepared statement");
+ elog(ERROR, "RASTER_mapAlgebraExpr: Could not allocate memory for value parameters of prepared statement");
SPI_finish();
/* define nulls */
nulls = (char *)palloc(argcount);
if (nulls == NULL) {
- elog(ERROR, "RASTER_mapAlgebraExpr: Unable to allocate memory for null parameters of prepared statement");
+ elog(ERROR, "RASTER_mapAlgebraExpr: Could not allocate memory for null parameters of prepared statement");
SPI_finish();
/* Connect to SPI and prepare the expression */
ret = SPI_connect();
if (ret != SPI_OK_CONNECT) {
- elog(ERROR, "RASTER_mapAlgebraExpr: Unable to connect to the SPI manager."
+ elog(ERROR, "RASTER_mapAlgebraExpr: Could not connect to the SPI manager."
" Aborting");
if (initexpr)
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
if (NULL == stats) {
- elog(NOTICE, "Unable to compute summary statistics for band at index %d. Returning NULL", bandindex);
+ elog(NOTICE, "Could not compute summary statistics for band at index %d. Returning NULL", bandindex);
PG_RETURN_NULL();
}
len = sizeof(char) * (strlen("SELECT \"\" FROM \"\" WHERE \"\" IS NOT NULL") + (strlen(colname) * 2) + strlen(tablename) + 1);
sql = (char *) palloc(len);
if (NULL == sql) {
- elog(ERROR, "RASTER_summaryStatsCoverage: Unable to allocate memory for sql\n");
+ elog(ERROR, "RASTER_summaryStatsCoverage: Could not allocate memory for sql\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
PG_RETURN_NULL();
datum = SPI_getbinval(tuple, tupdesc, 1, &isNull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "RASTER_summaryStatsCoverage: Unable to get raster of coverage\n");
+ elog(ERROR, "RASTER_summaryStatsCoverage: Could not get raster of coverage\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
rt_raster_destroy(raster);
if (NULL == stats) {
- elog(NOTICE, "Unable to compute summary statistics for band at index %d. Returning NULL", bandindex);
+ elog(NOTICE, "Could not compute summary statistics for band at index %d. Returning NULL", bandindex);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
if (NULL == rtn) {
rtn = (rt_bandstats) SPI_palloc(sizeof(struct rt_bandstats_t));
if (NULL == rtn) {
- elog(ERROR, "RASTER_summaryStatsCoverage: Unable to allocate memory for summary stats of coverage\n");
+ elog(ERROR, "RASTER_summaryStatsCoverage: Could not allocate memory for summary stats of coverage\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
SPI_finish();
if (NULL == rtn) {
- elog(ERROR, "RASTER_summaryStatsCoverage: Unable to compute coverage summary stats\n");
+ elog(ERROR, "RASTER_summaryStatsCoverage: Could not compute coverage summary stats\n");
PG_RETURN_NULL();
}
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
if (NULL == stats || NULL == stats->values) {
- elog(NOTICE, "Unable to compute summary statistics for band at index %d", bandindex);
+ elog(NOTICE, "Could not compute summary statistics for band at index %d", bandindex);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
else if (stats->count < 1) {
- elog(NOTICE, "Unable to compute histogram for band at index %d as the band has no values", bandindex);
+ elog(NOTICE, "Could not compute histogram for band at index %d as the band has no values", bandindex);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
if (bin_width_count) pfree(bin_width);
pfree(stats);
if (NULL == hist || !count) {
- elog(NOTICE, "Unable to compute histogram for band at index %d", bandindex);
+ elog(NOTICE, "Could not compute histogram for band at index %d", bandindex);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
len = sizeof(char) * (strlen("SELECT min, max FROM _st_summarystats('','',,::boolean,)") + strlen(tablename) + strlen(colname) + (MAX_INT_CHARLEN * 2) + MAX_DBL_CHARLEN + 1);
sql = (char *) palloc(len);
if (NULL == sql) {
- elog(ERROR, "RASTER_histogramCoverage: Unable to allocate memory for sql\n");
+ elog(ERROR, "RASTER_histogramCoverage: Could not allocate memory for sql\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
len = sizeof(char) * (strlen("SELECT \"\" FROM \"\" WHERE \"\" IS NOT NULL") + (strlen(colname) * 2) + strlen(tablename) + 1);
sql = (char *) palloc(len);
if (NULL == sql) {
- elog(ERROR, "RASTER_histogramCoverage: Unable to allocate memory for sql\n");
+ elog(ERROR, "RASTER_histogramCoverage: Could not allocate memory for sql\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
datum = SPI_getbinval(tuple, tupdesc, 1, &isNull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "RASTER_histogramCoverage: Unable to get raster of coverage\n");
+ elog(ERROR, "RASTER_histogramCoverage: Could not get raster of coverage\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
rt_raster_destroy(raster);
if (NULL == stats) {
- elog(NOTICE, "Unable to compute summary statistics for band at index %d. Returning NULL", bandindex);
+ elog(NOTICE, "Could not compute summary statistics for band at index %d. Returning NULL", bandindex);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
hist = rt_band_get_histogram(stats, bin_count, bin_width, bin_width_count, right, min, max, &count);
pfree(stats);
if (NULL == hist || !count) {
- elog(NOTICE, "Unable to compute histogram for band at index %d", bandindex);
+ elog(NOTICE, "Could not compute histogram for band at index %d", bandindex);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
if (NULL == covhist) {
covhist = (rt_histogram) SPI_palloc(sizeof(struct rt_histogram_t) * count);
if (NULL == covhist) {
- elog(ERROR, "RASTER_histogramCoverage: Unable to allocate memory for histogram of coverage");
+ elog(ERROR, "RASTER_histogramCoverage: Could not allocate memory for histogram of coverage");
pfree(hist);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SRF_RETURN_DONE(funcctx);
}
else if (stats->count < 1) {
- elog(NOTICE, "Unable to compute quantiles for band at index %d as the band has no values", bandindex);
+ elog(NOTICE, "Could not compute quantiles for band at index %d as the band has no values", bandindex);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
if (quantiles_count) pfree(quantiles);
pfree(stats);
if (NULL == quant || !count) {
- elog(NOTICE, "Unable to compute quantiles for band at index %d", bandindex);
+ elog(NOTICE, "Could not compute quantiles for band at index %d", bandindex);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
len = sizeof(char) * (strlen("SELECT count FROM _st_summarystats('','',,::boolean,)") + strlen(tablename) + strlen(colname) + (MAX_INT_CHARLEN * 2) + MAX_DBL_CHARLEN + 1);
sql = (char *) palloc(len);
if (NULL == sql) {
- elog(ERROR, "RASTER_quantileCoverage: Unable to allocate memory for sql\n");
+ elog(ERROR, "RASTER_quantileCoverage: Could not allocate memory for sql\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
len = sizeof(char) * (strlen("SELECT \"\" FROM \"\" WHERE \"\" IS NOT NULL") + (strlen(colname) * 2) + strlen(tablename) + 1);
sql = (char *) palloc(len);
if (NULL == sql) {
- elog(ERROR, "RASTER_quantileCoverage: Unable to allocate memory for sql\n");
+ elog(ERROR, "RASTER_quantileCoverage: Could not allocate memory for sql\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
datum = SPI_getbinval(tuple, tupdesc, 1, &isNull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "RASTER_quantileCoverage: Unable to get raster of coverage\n");
+ elog(ERROR, "RASTER_quantileCoverage: Could not get raster of coverage\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
rt_raster_destroy(raster);
if (NULL == covquant || !count) {
- elog(NOTICE, "Unable to compute quantiles for band at index %d", bandindex);
+ elog(NOTICE, "Could not compute quantiles for band at index %d", bandindex);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
rt_raster_destroy(raster);
PG_FREE_IF_COPY(pgraster, 0);
if (NULL == vcnts || !count) {
- elog(NOTICE, "Unable to count the values for band at index %d", bandindex);
+ elog(NOTICE, "Could not count the values for band at index %d", bandindex);
MemoryContextSwitchTo(oldcontext);
SRF_RETURN_DONE(funcctx);
}
len = sizeof(char) * (strlen("SELECT \"\" FROM \"\" WHERE \"\" IS NOT NULL") + (strlen(colname) * 2) + strlen(tablename) + 1);
sql = (char *) palloc(len);
if (NULL == sql) {
- elog(ERROR, "RASTER_valueCountCoverage: Unable to allocate memory for sql\n");
+ elog(ERROR, "RASTER_valueCountCoverage: Could not allocate memory for sql\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_finish();
datum = SPI_getbinval(tuple, tupdesc, 1, &isNull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "RASTER_valueCountCoverage: Unable to get raster of coverage\n");
+ elog(ERROR, "RASTER_valueCountCoverage: Could not get raster of coverage\n");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
rt_band_destroy(band);
rt_raster_destroy(raster);
if (NULL == vcnts || !count) {
- elog(NOTICE, "Unable to count the values for band at index %d", bandindex);
+ elog(NOTICE, "Could not count the values for band at index %d", bandindex);
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
if (NULL == covvcnts) {
covvcnts = (rt_valuecount) SPI_palloc(sizeof(struct rt_valuecount_t) * count);
if (NULL == covvcnts) {
- elog(ERROR, "RASTER_valueCountCoverage: Unable to allocate memory for value counts of coverage");
+ elog(ERROR, "RASTER_valueCountCoverage: Could not allocate memory for value counts of coverage");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
covcount++;
covvcnts = SPI_repalloc(covvcnts, sizeof(struct rt_valuecount_t) * covcount);
if (NULL == covvcnts) {
- elog(ERROR, "RASTER_valueCountCoverage: Unable to change allocated memory for value counts of coverage");
+ elog(ERROR, "RASTER_valueCountCoverage: Could not change allocated memory for value counts of coverage");
if (SPI_tuptable) SPI_freetuptable(tuptable);
SPI_cursor_close(portal);
arg = palloc(sizeof(struct rtpg_colormap_arg_t));
if (arg == NULL) {
- elog(ERROR, "rtpg_colormap_arg: Unable to allocate memory for function arguments");
+ elog(ERROR, "rtpg_colormap_arg: Could not allocate memory for function arguments");
return NULL;
}
arg->colormap = palloc(sizeof(struct rt_colormap_t));
if (arg->colormap == NULL) {
- elog(ERROR, "rtpg_colormap_arg: Unable to allocate memory for function arguments");
+ elog(ERROR, "rtpg_colormap_arg: Could not allocate memory for function arguments");
return NULL;
}
arg->colormap->nentry = 0;
/* init arg */
arg = rtpg_colormap_arg_init();
if (arg == NULL) {
- elog(ERROR, "RASTER_colorMap: Unable to initialize argument structure");
+ elog(ERROR, "RASTER_colorMap: Could not initialize argument structure");
PG_RETURN_NULL();
}
raster = rt_raster_clone(arg->raster, 0);
if (raster == NULL) {
- elog(ERROR, "RASTER_colorMap: Unable to create empty raster");
+ elog(ERROR, "RASTER_colorMap: Could not create empty raster");
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
/* get band */
arg->band = rt_raster_get_band(arg->raster, arg->nband - 1);
if (arg->band == NULL) {
- elog(ERROR, "RASTER_colorMap: Unable to get band at index %d", arg->nband);
+ elog(ERROR, "RASTER_colorMap: Could not get band at index %d", arg->nband);
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
arg->entry = rtpg_strsplit(colormap, "\n", &(arg->nentry));
pfree(colormap);
if (arg->nentry < 1) {
- elog(ERROR, "RASTER_colorMap: Unable to process the value provided for colormap");
+ elog(ERROR, "RASTER_colorMap: Could not process the value provided for colormap");
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
/* allocate the max # of colormap entries */
arg->colormap->entry = palloc(sizeof(struct rt_colormap_entry_t) * arg->nentry);
if (arg->colormap->entry == NULL) {
- elog(ERROR, "RASTER_colorMap: Unable to allocate memory for colormap entries");
+ elog(ERROR, "RASTER_colorMap: Could not allocate memory for colormap entries");
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
arg->element = rtpg_strsplit(_entry, " ", &(arg->nelement));
pfree(_entry);
if (arg->nelement < 2) {
- elog(ERROR, "RASTER_colorMap: Unable to process colormap entry %d", i + 1);
+ elog(ERROR, "RASTER_colorMap: Could not process colormap entry %d", i + 1);
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
arg->bandstats = rt_band_get_summary_stats(arg->band, 1, 1, 0, NULL, NULL, NULL);
if (arg->bandstats == NULL) {
- elog(ERROR, "RASTER_colorMap: Unable to get band's summary stats to process percentages");
+ elog(ERROR, "RASTER_colorMap: Could not get band's summary stats to process percentages");
pfree(_element);
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
/* get the string before the percent char */
tmp = palloc(sizeof(char) * (percent - _element + 1));
if (tmp == NULL) {
- elog(ERROR, "RASTER_colorMap: Unable to allocate memory for value of percentage");
+ elog(ERROR, "RASTER_colorMap: Could not allocate memory for value of percentage");
pfree(_element);
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
value = strtod(tmp, NULL);
pfree(tmp);
if (errno != 0 || _element == junk) {
- elog(ERROR, "RASTER_colorMap: Unable to process percent string to value");
+ elog(ERROR, "RASTER_colorMap: Could not process percent string to value");
pfree(_element);
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
errno = 0;
arg->colormap->entry[arg->colormap->nentry].value = strtod(_element, &junk);
if (errno != 0 || _element == junk) {
- elog(ERROR, "RASTER_colorMap: Unable to process string to value");
+ elog(ERROR, "RASTER_colorMap: Could not process string to value");
pfree(_element);
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
errno = 0;
value = (int) strtod(_element, &junk);
if (errno != 0 || _element == junk) {
- elog(ERROR, "RASTER_colorMap: Unable to process string to value");
+ elog(ERROR, "RASTER_colorMap: Could not process string to value");
pfree(_element);
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
/* call colormap */
raster = rt_raster_colormap(arg->raster, arg->nband - 1, arg->colormap);
if (raster == NULL) {
- elog(ERROR, "RASTER_colorMap: Unable to create new raster with applied colormap");
+ elog(ERROR, "RASTER_colorMap: Could not create new raster with applied colormap");
rtpg_colormap_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_intersects: Unable to test for intersection on the two rasters");
+ elog(ERROR, "RASTER_intersects: Could not test for intersection on the two rasters");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_overlaps: Unable to test for overlap on the two rasters");
+ elog(ERROR, "RASTER_overlaps: Could not test for overlap on the two rasters");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_touches: Unable to test for touch on the two rasters");
+ elog(ERROR, "RASTER_touches: Could not test for touch on the two rasters");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_contains: Unable to test that the first raster contains the second raster");
+ elog(ERROR, "RASTER_contains: Could not test that the first raster contains the second raster");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_containsProperly: Unable to test that the first raster contains properly the second raster");
+ elog(ERROR, "RASTER_containsProperly: Could not test that the first raster contains properly the second raster");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_covers: Unable to test that the first raster covers the second raster");
+ elog(ERROR, "RASTER_covers: Could not test that the first raster covers the second raster");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_coveredby: Unable to test that the first raster is covered by the second raster");
+ elog(ERROR, "RASTER_coveredby: Could not test that the first raster is covered by the second raster");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_dwithin: Unable to test that the two rasters are within the specified distance of each other");
+ elog(ERROR, "RASTER_dwithin: Could not test that the two rasters are within the specified distance of each other");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_dfullywithin: Unable to test that the two rasters are fully within the specified distance of each other");
+ elog(ERROR, "RASTER_dfullywithin: Could not test that the two rasters are fully within the specified distance of each other");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_sameAlignment: Unable to test for alignment on the two rasters");
+ elog(ERROR, "RASTER_sameAlignment: Could not test for alignment on the two rasters");
PG_RETURN_NULL();
}
}
if (rtn != ES_NONE) {
- elog(ERROR, "RASTER_notSameAlignmentReason: Unable to test for alignment on the two rasters");
+ elog(ERROR, "RASTER_notSameAlignmentReason: Could not test for alignment on the two rasters");
PG_RETURN_NULL();
}
raster = rt_raster_new(0, 0);
if (raster == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to create empty raster");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not create empty raster");
for (k = 0; k < set_count; k++) {
if (rast[k] != NULL)
rt_raster_destroy(rast[k]);
_dim[j][1]
);
if (_rast[i] == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to create nodata raster");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not create nodata raster");
rt_raster_destroy(_rast[j]);
for (k = 0; k < set_count; k++) {
if (pgrastpos[k] != -1)
/* same alignment */
if (rt_raster_same_alignment(_rast[0], _rast[1], &aligned, NULL) != ES_NONE) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to test for alignment on the two rasters");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not test for alignment on the two rasters");
for (k = 0; k < set_count; k++) {
if (_rast[k] != NULL)
rt_raster_destroy(_rast[k]);
&raster, _offset
);
if (err != ES_NONE) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to get output raster of correct extent");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not get output raster of correct extent");
for (k = 0; k < set_count; k++) {
if (_rast[k] != NULL)
rt_raster_destroy(_rast[k]);
raster = rt_raster_new(0, 0);
if (raster == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to create no band raster");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not create no band raster");
for (k = 0; k < set_count; k++) {
if (_rast[k] != NULL)
rt_raster_destroy(_rast[k]);
_band[i] = rt_raster_get_band(_rast[i], bandindex[i] - 1);
if (_band[i] == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to get band %d of the %s raster",
+ elog(ERROR, "RASTER_mapAlgebra2: Could not get band %d of the %s raster",
bandindex[i],
(i < 1 ? "FIRST" : "SECOND")
);
1, nodataval,
0
) < 0) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to add new band to output raster");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not add new band to output raster");
for (k = 0; k < set_count; k++) {
if (_rast[k] != NULL)
rt_raster_destroy(_rast[k]);
/* get output band */
band = rt_raster_get_band(raster, 0);
if (band == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to get newly added band of output raster");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not get newly added band of output raster");
for (k = 0; k < set_count; k++) {
if (_rast[k] != NULL)
rt_raster_destroy(_rast[k]);
/* connect SPI */
if (SPI_connect() != SPI_OK_CONNECT) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to connect to the SPI manager");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not connect to the SPI manager");
for (k = 0; k < set_count; k++) {
if (_rast[k] != NULL)
rt_raster_destroy(_rast[k]);
len = strlen("SELECT (") + strlen(expr) + strlen(")::double precision");
sql = (char *) palloc(len + 1);
if (sql == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to allocate memory for expression parameter %d", spi_exprpos[i]);
+ elog(ERROR, "RASTER_mapAlgebra2: Could not allocate memory for expression parameter %d", spi_exprpos[i]);
for (k = 0; k < spi_count; k++) SPI_freeplan(spi_plan[k]);
SPI_finish();
if (spi_argcount[i]) {
argtype = (Oid *) palloc(spi_argcount[i] * sizeof(Oid));
if (argtype == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to allocate memory for prepared plan argtypes of expression parameter %d", spi_exprpos[i]);
+ elog(ERROR, "RASTER_mapAlgebra2: Could not allocate memory for prepared plan argtypes of expression parameter %d", spi_exprpos[i]);
pfree(sql);
for (k = 0; k < spi_count; k++) SPI_freeplan(spi_plan[k]);
pfree(argtype);
if (spi_plan[i] == NULL) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to create prepared plan of expression parameter %d", spi_exprpos[i]);
+ elog(ERROR, "RASTER_mapAlgebra2: Could not create prepared plan of expression parameter %d", spi_exprpos[i]);
pfree(sql);
for (k = 0; k < spi_count; k++) SPI_freeplan(spi_plan[k]);
else {
err = SPI_execute(sql, TRUE, 0);
if (err != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to evaluate expression parameter %d", spi_exprpos[i]);
+ elog(ERROR, "RASTER_mapAlgebra2: Could not evaluate expression parameter %d", spi_exprpos[i]);
pfree(sql);
for (k = 0; k < spi_count; k++) SPI_freeplan(spi_plan[k]);
datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to get result of expression parameter %d", spi_exprpos[i]);
+ elog(ERROR, "RASTER_mapAlgebra2: Could not get result of expression parameter %d", spi_exprpos[i]);
pfree(sql);
if (SPI_tuptable) SPI_freetuptable(tuptable);
) {
err = rt_band_get_pixel(_band[i], _x, _y, &(_pixel[i]), &isnodata);
if (err != ES_NONE) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to get pixel of %s raster", (i < 1 ? "FIRST" : "SECOND"));
+ elog(ERROR, "RASTER_mapAlgebra2: Could not get pixel of %s raster", (i < 1 ? "FIRST" : "SECOND"));
if (calltype == TEXTOID) {
for (k = 0; k < spi_count; k++) SPI_freeplan(spi_plan[k]);
datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to get result of prepared statement %d", i);
+ elog(ERROR, "RASTER_mapAlgebra2: Could not get result of prepared statement %d", i);
if (SPI_tuptable) SPI_freetuptable(tuptable);
for (k = 0; k < spi_count; k++) SPI_freeplan(spi_plan[k]);
/* burn pixel if haspixel != 0 */
if (haspixel) {
if (rt_band_set_pixel(band, x, y, pixel, NULL) != ES_NONE) {
- elog(ERROR, "RASTER_mapAlgebra2: Unable to set pixel value of output raster");
+ elog(ERROR, "RASTER_mapAlgebra2: Could not set pixel value of output raster");
if (calltype == TEXTOID) {
for (k = 0; k < spi_count; k++) SPI_freeplan(spi_plan[k]);
arg = palloc(sizeof(struct rtpg_nmapalgebra_arg_t));
if (arg == NULL) {
- elog(ERROR, "rtpg_nmapalgebra_arg_init: Unable to allocate memory for arguments");
+ elog(ERROR, "rtpg_nmapalgebra_arg_init: Could not allocate memory for arguments");
return 0;
}
arg->nband == NULL ||
arg->hasband == NULL
) {
- elog(ERROR, "rtpg_nmapalgebra_rastbandarg_process: Unable to allocate memory for processing rastbandarg");
+ elog(ERROR, "rtpg_nmapalgebra_rastbandarg_process: Could not allocate memory for processing rastbandarg");
return 0;
}
arg->nband == NULL ||
arg->hasband == NULL
) {
- elog(ERROR, "rtpg_nmapalgebra_rastbandarg_process: Unable to reallocate memory for processed rastbandarg");
+ elog(ERROR, "rtpg_nmapalgebra_rastbandarg_process: Could not reallocate memory for processed rastbandarg");
return 0;
}
}
_values = palloc(sizeof(Datum) * arg->rasters * arg->rows * arg->columns);
_nodata = palloc(sizeof(bool) * arg->rasters * arg->rows * arg->columns);
if (_values == NULL || _nodata == NULL) {
- elog(ERROR, "rtpg_nmapalgebra_callback: Unable to allocate memory for values array");
+ elog(ERROR, "rtpg_nmapalgebra_callback: Could not allocate memory for values array");
return 0;
}
_pos = palloc(sizeof(Datum) * (arg->rasters + 1) * 2);
_null = palloc(sizeof(bool) * (arg->rasters + 1) * 2);
if (_pos == NULL || _null == NULL) {
- elog(ERROR, "rtpg_nmapalgebra_callback: Unable to allocate memory for position array");
+ elog(ERROR, "rtpg_nmapalgebra_callback: Could not allocate memory for position array");
pfree(mdValues);
return 0;
}
/* init argument struct */
arg = rtpg_nmapalgebra_arg_init();
if (arg == NULL) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to initialize argument structure");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not initialize argument structure");
PG_RETURN_NULL();
}
/* let helper function process rastbandarg (0) */
if (!rtpg_nmapalgebra_rastbandarg_process(arg, PG_GETARG_ARRAYTYPE_P(0), &allnull, &allempty, &noband)) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to process rastbandarg");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not process rastbandarg");
rtpg_nmapalgebra_arg_destroy(arg);
PG_RETURN_NULL();
}
raster = rt_raster_new(0, 0);
if (raster == NULL) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to create empty raster");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not create empty raster");
PG_RETURN_NULL();
}
raster = rt_raster_new(0, 0);
if (raster == NULL) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to create empty raster");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not create empty raster");
PG_RETURN_NULL();
}
/* init itrset */
itrset = palloc(sizeof(struct rt_iterator_t) * arg->numraster);
if (itrset == NULL) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to allocate memory for iterator arguments");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not allocate memory for iterator arguments");
rtpg_nmapalgebra_arg_destroy(arg);
PG_RETURN_NULL();
}
rtpg_nmapalgebra_arg_destroy(arg);
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to run raster iterator function");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not run raster iterator function");
PG_RETURN_NULL();
}
else if (raster == NULL)
arg = palloc(sizeof(struct rtpg_nmapalgebraexpr_arg_t));
if (arg == NULL) {
- elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Unable to allocate memory for arguments");
+ elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arguments");
return NULL;
}
arg->bandarg = rtpg_nmapalgebra_arg_init();
if (arg->bandarg == NULL) {
- elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Unable to allocate memory for arg->bandarg");
+ elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arg->bandarg");
return NULL;
}
arg->callback.expr[i].spi_argcount = 0;
arg->callback.expr[i].spi_argpos = palloc(cnt * sizeof(uint8_t));
if (arg->callback.expr[i].spi_argpos == NULL) {
- elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Unable to allocate memory for spi_argpos");
+ elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for spi_argpos");
return NULL;
}
memset(arg->callback.expr[i].spi_argpos, 0, sizeof(uint8_t) * cnt);
datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "rtpg_nmapalgebraexpr_callback: Unable to get result of prepared statement %d", id);
+ elog(ERROR, "rtpg_nmapalgebraexpr_callback: Could not get result of prepared statement %d", id);
if (SPI_tuptable) SPI_freetuptable(tuptable);
return 0;
}
/* init argument struct */
arg = rtpg_nmapalgebraexpr_arg_init(argkwcount, argkw);
if (arg == NULL) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to initialize argument structure");
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not initialize argument structure");
PG_RETURN_NULL();
}
/* let helper function process rastbandarg (0) */
if (!rtpg_nmapalgebra_rastbandarg_process(arg->bandarg, PG_GETARG_ARRAYTYPE_P(0), &allnull, &allempty, &noband)) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to process rastbandarg");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not process rastbandarg");
rtpg_nmapalgebraexpr_arg_destroy(arg);
PG_RETURN_NULL();
}
raster = rt_raster_new(0, 0);
if (raster == NULL) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to create empty raster");
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not create empty raster");
PG_RETURN_NULL();
}
/* connect SPI */
if (SPI_connect() != SPI_OK_CONNECT) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to connect to the SPI manager");
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not connect to the SPI manager");
rtpg_nmapalgebraexpr_arg_destroy(arg);
PG_RETURN_NULL();
}
len = strlen("SELECT (") + strlen(expr) + strlen(")::double precision");
sql = (char *) palloc(len + 1);
if (sql == NULL) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to allocate memory for expression parameter %d", exprpos[i]);
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not allocate memory for expression parameter %d", exprpos[i]);
rtpg_nmapalgebraexpr_arg_destroy(arg);
SPI_finish();
PG_RETURN_NULL();
Oid *argtype = (Oid *) palloc(arg->callback.expr[i].spi_argcount * sizeof(Oid));
POSTGIS_RT_DEBUGF(3, "expression parameter %d is a prepared plan", exprpos[i]);
if (argtype == NULL) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to allocate memory for prepared plan argtypes of expression parameter %d", exprpos[i]);
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not allocate memory for prepared plan argtypes of expression parameter %d", exprpos[i]);
pfree(sql);
rtpg_nmapalgebraexpr_arg_destroy(arg);
SPI_finish();
pfree(sql);
if (arg->callback.expr[i].spi_plan == NULL) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to create prepared plan of expression parameter %d", exprpos[i]);
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not create prepared plan of expression parameter %d", exprpos[i]);
rtpg_nmapalgebraexpr_arg_destroy(arg);
SPI_finish();
PG_RETURN_NULL();
pfree(sql);
if (err != SPI_OK_SELECT || SPI_tuptable == NULL || SPI_processed != 1) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to evaluate expression parameter %d", exprpos[i]);
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not evaluate expression parameter %d", exprpos[i]);
rtpg_nmapalgebraexpr_arg_destroy(arg);
SPI_finish();
PG_RETURN_NULL();
datum = SPI_getbinval(tuple, tupdesc, 1, &isnull);
if (SPI_result == SPI_ERROR_NOATTRIBUTE) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to get result of expression parameter %d", exprpos[i]);
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not get result of expression parameter %d", exprpos[i]);
if (SPI_tuptable) SPI_freetuptable(tuptable);
rtpg_nmapalgebraexpr_arg_destroy(arg);
SPI_finish();
/* init itrset */
itrset = palloc(sizeof(struct rt_iterator_t) * numraster);
if (itrset == NULL) {
- elog(ERROR, "RASTER_nMapAlgebra: Unable to allocate memory for iterator arguments");
+ elog(ERROR, "RASTER_nMapAlgebra: Could not allocate memory for iterator arguments");
rtpg_nmapalgebraexpr_arg_destroy(arg);
SPI_finish();
PG_RETURN_NULL();
rtpg_nmapalgebraexpr_arg_destroy(arg);
if (err != ES_NONE) {
- elog(ERROR, "RASTER_nMapAlgebraExpr: Unable to run raster iterator function");
+ elog(ERROR, "RASTER_nMapAlgebraExpr: Could not run raster iterator function");
SPI_finish();
PG_RETURN_NULL();
}
arg->numband = n;
arg->bandarg = palloc(sizeof(struct rtpg_union_band_arg_t) * arg->numband);
if (arg->bandarg == NULL) {
- elog(ERROR, "rtpg_union_unionarg_process: Unable to allocate memory for band information");
+ elog(ERROR, "rtpg_union_unionarg_process: Could not allocate memory for band information");
return 0;
}
if (arg->numband < n) {
arg->bandarg = repalloc(arg->bandarg, sizeof(struct rtpg_union_band_arg_t) * arg->numband);
if (arg->bandarg == NULL) {
- elog(ERROR, "rtpg_union_unionarg_process: Unable to reallocate memory for band information");
+ elog(ERROR, "rtpg_union_unionarg_process: Could not reallocate memory for band information");
return 0;
}
}
else
arg->bandarg = palloc(sizeof(struct rtpg_union_band_arg_t) * numbands);
if (arg->bandarg == NULL) {
- elog(ERROR, "rtpg_union_noarg: Unable to reallocate memory for band information");
+ elog(ERROR, "rtpg_union_noarg: Could not reallocate memory for band information");
return 0;
}
arg->bandarg[i].raster = (rt_raster *) palloc(sizeof(rt_raster) * arg->bandarg[i].numraster);
if (arg->bandarg[i].raster == NULL) {
- elog(ERROR, "rtpg_union_noarg: Unable to allocate memory for working rasters");
+ elog(ERROR, "rtpg_union_noarg: Could not allocate memory for working rasters");
return 0;
}
memset(arg->bandarg[i].raster, 0, sizeof(rt_raster) * arg->bandarg[i].numraster);
if (!rt_raster_is_empty(arg->bandarg[0].raster[0])) {
arg->bandarg[i].raster[0] = rt_raster_clone(arg->bandarg[0].raster[0], 0); /* shallow clone */
if (arg->bandarg[i].raster[0] == NULL) {
- elog(ERROR, "rtpg_union_noarg: Unable to create working raster");
+ elog(ERROR, "rtpg_union_noarg: Could not create working raster");
return 0;
}
}
/* allocate container in aggcontext */
iwr = palloc(sizeof(struct rtpg_union_arg_t));
if (iwr == NULL) {
- elog(ERROR, "RASTER_union_transfn: Unable to allocate memory for state variable");
+ elog(ERROR, "RASTER_union_transfn: Could not allocate memory for state variable");
MemoryContextSwitchTo(oldcontext);
PG_RETURN_NULL();
}
iwr->bandarg = palloc(sizeof(struct rtpg_union_band_arg_t) * iwr->numband);
}
if (iwr->bandarg == NULL) {
- elog(ERROR, "RASTER_union_transfn: Unable to allocate memory for band information");
+ elog(ERROR, "RASTER_union_transfn: Could not allocate memory for band information");
rtpg_union_arg_destroy(iwr);
if (raster != NULL) {
iwr->numband = 1;
iwr->bandarg = palloc(sizeof(struct rtpg_union_band_arg_t) * iwr->numband);
if (iwr->bandarg == NULL) {
- elog(ERROR, "RASTER_union_transfn: Unable to allocate memory for band information");
+ elog(ERROR, "RASTER_union_transfn: Could not allocate memory for band information");
rtpg_union_arg_destroy(iwr);
if (raster != NULL) {
POSTGIS_RT_DEBUG(4, "Processing arg 3 as unionarg");
if (!rtpg_union_unionarg_process(iwr, PG_GETARG_ARRAYTYPE_P(2))) {
- elog(ERROR, "RASTER_union_transfn: Unable to process unionarg");
+ elog(ERROR, "RASTER_union_transfn: Could not process unionarg");
rtpg_union_arg_destroy(iwr);
if (raster != NULL) {
iwr->bandarg[i].raster = (rt_raster *) palloc(sizeof(rt_raster) * iwr->bandarg[i].numraster);
if (iwr->bandarg[i].raster == NULL) {
- elog(ERROR, "RASTER_union_transfn: Unable to allocate memory for working raster(s)");
+ elog(ERROR, "RASTER_union_transfn: Could not allocate memory for working raster(s)");
rtpg_union_arg_destroy(iwr);
if (raster != NULL) {
for (j = 0; j < iwr->bandarg[i].numraster; j++) {
iwr->bandarg[i].raster[j] = rt_raster_clone(iwr->bandarg[0].raster[0], 0); /* shallow clone */
if (iwr->bandarg[i].raster[j] == NULL) {
- elog(ERROR, "RASTER_union_transfn: Unable to create working raster");
+ elog(ERROR, "RASTER_union_transfn: Could not create working raster");
rtpg_union_arg_destroy(iwr);
if (raster != NULL) {
POSTGIS_RT_DEBUG(4, "no additional args, checking input raster");
nbnodata = 1;
if (!rtpg_union_noarg(iwr, raster)) {
- elog(ERROR, "RASTER_union_transfn: Unable to check and balance number of bands");
+ elog(ERROR, "RASTER_union_transfn: Could not check and balance number of bands");
rtpg_union_arg_destroy(iwr);
if (raster != NULL) {
/* init itrset */
itrset = palloc(sizeof(struct rt_iterator_t) * 2);
if (itrset == NULL) {
- elog(ERROR, "RASTER_union_transfn: Unable to allocate memory for iterator arguments");
+ elog(ERROR, "RASTER_union_transfn: Could not allocate memory for iterator arguments");
rtpg_union_arg_destroy(iwr);
if (raster != NULL) {
ET_UNION,
&iraster, _offset
) != ES_NONE) {
- elog(ERROR, "RASTER_union_transfn: Unable to create internal raster");
+ elog(ERROR, "RASTER_union_transfn: Could not create internal raster");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
hasnodata, nodataval,
0
) == -1) {
- elog(ERROR, "RASTER_union_transfn: Unable to add new band to internal raster");
+ elog(ERROR, "RASTER_union_transfn: Could not add new band to internal raster");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
_dim[0],
&vals, &nvals
) != ES_NONE) {
- elog(ERROR, "RASTER_union_transfn: Unable to get pixel line from band of working raster");
+ elog(ERROR, "RASTER_union_transfn: Could not get pixel line from band of working raster");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
(int) _offset[0], (int) _offset[1] + y,
vals, nvals
) != ES_NONE) {
- elog(ERROR, "RASTER_union_transfn: Unable to set pixel line to band of internal raster");
+ elog(ERROR, "RASTER_union_transfn: Could not set pixel line to band of internal raster");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
&_raster
);
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_union_transfn: Unable to run raster iterator function");
+ elog(ERROR, "RASTER_union_transfn: Could not run raster iterator function");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
_dim[0],
&vals, &nvals
) != ES_NONE) {
- elog(ERROR, "RASTER_union_transfn: Unable to get pixel line from band of working raster");
+ elog(ERROR, "RASTER_union_transfn: Could not get pixel line from band of working raster");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
(int) _offset[2], (int) _offset[3] + y,
vals, nvals
) != ES_NONE) {
- elog(ERROR, "RASTER_union_transfn: Unable to set pixel line to band of internal raster");
+ elog(ERROR, "RASTER_union_transfn: Could not set pixel line to band of internal raster");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
);
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_union_transfn: Unable to run raster iterator function");
+ elog(ERROR, "RASTER_union_transfn: Could not run raster iterator function");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
/* init itrset */
itrset = palloc(sizeof(struct rt_iterator_t) * 2);
if (itrset == NULL) {
- elog(ERROR, "RASTER_union_finalfn: Unable to allocate memory for iterator arguments");
+ elog(ERROR, "RASTER_union_finalfn: Could not allocate memory for iterator arguments");
rtpg_union_arg_destroy(iwr);
PG_RETURN_NULL();
}
}
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_union_finalfn: Unable to run raster iterator function");
+ elog(ERROR, "RASTER_union_finalfn: Could not run raster iterator function");
pfree(itrset);
rtpg_union_arg_destroy(iwr);
if (_rtn != NULL)
}
if (status < 0) {
- elog(ERROR, "RASTER_union_finalfn: Unable to add band to final raster");
+ elog(ERROR, "RASTER_union_finalfn: Could not add band to final raster");
rtpg_union_arg_destroy(iwr);
rt_raster_destroy(_rtn);
PG_RETURN_NULL();
arg = palloc(sizeof(struct rtpg_clip_arg_t));
if (arg == NULL) {
- elog(ERROR, "rtpg_clip_arg_init: Unable to allocate memory for function arguments");
+ elog(ERROR, "rtpg_clip_arg_init: Could not allocate memory for function arguments");
return NULL;
}
/* init arg */
arg = rtpg_clip_arg_init();
if (arg == NULL) {
- elog(ERROR, "RASTER_clip: Unable to initialize argument structure");
+ elog(ERROR, "RASTER_clip: Could not initialize argument structure");
PG_RETURN_NULL();
}
rtn = rt_raster_new(0, 0);
if (rtn == NULL) {
- elog(ERROR, "RASTER_clip: Unable to create empty raster");
+ elog(ERROR, "RASTER_clip: Could not create empty raster");
PG_RETURN_NULL();
}
/* get intersection geometry of input raster and input geometry */
if (rt_raster_get_convex_hull(arg->raster, &rastgeom) != ES_NONE) {
- elog(ERROR, "RASTER_clip: Unable to get convex hull of raster");
+ elog(ERROR, "RASTER_clip: Could not get convex hull of raster");
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
rtn = rt_raster_new(0, 0);
if (rtn == NULL) {
- elog(ERROR, "RASTER_clip: Unable to create empty raster");
+ elog(ERROR, "RASTER_clip: Could not create empty raster");
PG_RETURN_NULL();
}
arg->band = palloc(sizeof(struct rtpg_clip_band_t) * arg->numbands);
if (arg->band == NULL) {
- elog(ERROR, "RASTER_clip: Unable to allocate memory for band arguments");
+ elog(ERROR, "RASTER_clip: Could not allocate memory for band arguments");
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
lwgeom_free(geom);
if (j < arg->numbands) {
arg->band = repalloc(arg->band, sizeof(struct rtpg_clip_band_t) * j);
if (arg->band == NULL) {
- elog(ERROR, "RASTER_clip: Unable to reallocate memory for band arguments");
+ elog(ERROR, "RASTER_clip: Could not reallocate memory for band arguments");
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
lwgeom_free(geom);
if (arg->numbands) {
arg->band = palloc(sizeof(struct rtpg_clip_band_t) * arg->numbands);
if (arg->band == NULL) {
- elog(ERROR, "RASTER_clip: Unable to allocate memory for band arguments");
+ elog(ERROR, "RASTER_clip: Could not allocate memory for band arguments");
rtpg_clip_arg_destroy(arg);
pfree(wkb);
if (arg->mask == NULL) {
- elog(ERROR, "RASTER_clip: Unable to rasterize intersection geometry");
+ elog(ERROR, "RASTER_clip: Could not rasterize intersection geometry");
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
/* init itrset */
itrset = palloc(sizeof(struct rt_iterator_t) * 2);
if (itrset == NULL) {
- elog(ERROR, "RASTER_clip: Unable to allocate memory for iterator arguments");
+ elog(ERROR, "RASTER_clip: Could not allocate memory for iterator arguments");
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
if (rtn == NULL) {
noerr = rt_raster_from_two_rasters(arg->raster, arg->mask, arg->extenttype, &rtn, NULL);
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_clip: Unable to create output raster");
+ elog(ERROR, "RASTER_clip: Could not create output raster");
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
PG_RETURN_NULL();
/* create NODATA band */
if (rt_raster_generate_new_band(rtn, pixtype, nodataval, hasnodata, nodataval, i) < 0) {
- elog(ERROR, "RASTER_clip: Unable to add NODATA band to output raster");
+ elog(ERROR, "RASTER_clip: Could not add NODATA band to output raster");
rt_raster_destroy(rtn);
rtpg_clip_arg_destroy(arg);
PG_FREE_IF_COPY(pgraster, 0);
);
if (noerr != ES_NONE) {
- elog(ERROR, "RASTER_clip: Unable to run raster iterator function");
+ elog(ERROR, "RASTER_clip: Could not run raster iterator function");
pfree(itrset);
rtpg_clip_arg_destroy(arg);
if (rtn != NULL) rt_raster_destroy(rtn);
else {
band = rt_raster_get_band(_raster, 0);
if (band == NULL) {
- elog(ERROR, "RASTER_clip: Unable to get band from working raster");
+ elog(ERROR, "RASTER_clip: Could not get band from working raster");
pfree(itrset);
rtpg_clip_arg_destroy(arg);
rt_raster_destroy(_raster);
}
if (rt_raster_add_band(rtn, band, i) < 0) {
- elog(ERROR, "RASTER_clip: Unable to add new band to output raster");
+ elog(ERROR, "RASTER_clip: Could not add new band to output raster");
pfree(itrset);
rtpg_clip_arg_destroy(arg);
rt_raster_destroy(_raster);