128 bool minhull =
FALSE;
142 pgraster = (
rt_pgraster *) PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
147 PG_FREE_IF_COPY(pgraster, 0);
148 elog(ERROR,
"RASTER_convex_hull: Could not deserialize raster");
158 if (!PG_ARGISNULL(1)) {
159 nband = PG_GETARG_INT32(1);
161 elog(NOTICE,
"Invalid band index (must use 1-based). Returning NULL");
163 PG_FREE_IF_COPY(pgraster, 0);
173 PG_FREE_IF_COPY(pgraster, 0);
176 elog(ERROR,
"RASTER_convex_hull: Could not get raster's convex hull");
179 else if (geom == NULL) {
180 elog(NOTICE,
"Raster's convex hull is NULL");
187 SET_VARSIZE(gser, gser_size);
188 PG_RETURN_POINTER(gser);
raster
Be careful!! Zeros function's input parameter can be a (height x width) array, not (width x height): ...
void lwgeom_free(LWGEOM *geom)
rt_errorstate rt_raster_get_convex_hull(rt_raster raster, LWGEOM **hull)
Get raster's convex hull.
int rt_raster_has_band(rt_raster raster, int nband)
Return TRUE if the raster has a band of this number.
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
rt_errorstate rt_raster_get_perimeter(rt_raster raster, int nband, LWGEOM **perimeter)
Get raster perimeter.
GSERIALIZED * gserialized_from_lwgeom(LWGEOM *geom, size_t *size)
Allocate a new GSERIALIZED from an LWGEOM.
rt_raster rt_raster_deserialize(void *serialized, int header_only)
Return a raster from a serialized form.