158 double total_area = 0;
159 double total_val = 0;
169 CU_ASSERT_DOUBLE_EQUAL(nPols, 4, FLT_EPSILON);
170 total_area = 0; total_val = 0;
171 for (i = 0; i < nPols; i++) {
172 total_val += gv[i].
val;
173 gobserved = (
LWGEOM *) gv[i].geom;
177 printf(
"total area, total val, nPols = %f, %f, %i\n", total_area, total_val, nPols);
178 CU_ASSERT_DOUBLE_EQUAL(total_val, 1.8 + 0.0 + 2.8 + 0, FLT_EPSILON);
179 CU_ASSERT_DOUBLE_EQUAL(total_area, 81, FLT_EPSILON);
192 CU_ASSERT_DOUBLE_EQUAL(nPols, 4, FLT_EPSILON);
193 total_area = 0; total_val = 0;
194 for (i = 0; i < nPols; i++) {
195 total_val += gv[i].
val;
196 gobserved = (
LWGEOM *) gv[i].geom;
200 printf(
"total area, total_val, polys = %f, %f, %i\n", total_area, total_val, nPols);
201 CU_ASSERT_DOUBLE_EQUAL(total_val, 4.6, FLT_EPSILON);
202 CU_ASSERT_DOUBLE_EQUAL(total_area, 81, FLT_EPSILON);
216 CU_ASSERT_DOUBLE_EQUAL(nPols, 4, FLT_EPSILON);
217 total_area = 0; total_val = 0;
218 for (i = 0; i < nPols; i++) {
219 total_val += gv[i].
val;
220 gobserved = (
LWGEOM *) gv[i].geom;
225 printf(
"total area, total_val, polys = %f, %f, %i\n", total_area, total_val, nPols);
226 CU_ASSERT_DOUBLE_EQUAL(total_val, 4.6, FLT_EPSILON);
227 CU_ASSERT_DOUBLE_EQUAL(total_area, 81, FLT_EPSILON);
240 CU_ASSERT_DOUBLE_EQUAL(nPols, 2, FLT_EPSILON);
241 total_area = 0; total_val = 0;
242 for (i = 0; i < nPols; i++) {
243 total_val += gv[i].
val;
244 gobserved = (
LWGEOM *) gv[i].geom;
249 printf(
"total area, total_val, polys = %f, %f, %i\n", total_area, total_val, nPols);
250 CU_ASSERT_DOUBLE_EQUAL(total_val, 4.6, FLT_EPSILON);
251 CU_ASSERT_DOUBLE_EQUAL(total_area, 28, FLT_EPSILON);
264 CU_ASSERT_DOUBLE_EQUAL(nPols, 4, FLT_EPSILON);
265 total_area = 0; total_val = 0;
266 for (i = 0; i < nPols; i++) {
267 total_val += gv[i].
val;
268 gobserved = (
LWGEOM *) gv[i].geom;
273 printf(
"total area, total_val, polys = %f, %f, %i\n", total_area, total_val, nPols);
274 CU_ASSERT_DOUBLE_EQUAL(total_val, 1.8 + 0.0 + 2.8 + 0.0, FLT_EPSILON);
275 CU_ASSERT_DOUBLE_EQUAL(total_area, 81, FLT_EPSILON);
static rt_raster fillRasterToPolygonize(int hasnodata, double nodataval)
void lwgeom_free(LWGEOM *geom)
double lwgeom_area(const LWGEOM *geom)
int rt_raster_has_band(rt_raster raster, int nband)
Return TRUE if the raster has a band of this number.
rt_geomval rt_raster_gdal_polygonize(rt_raster raster, int nband, int exclude_nodata_value, int *pnElements)
Returns a set of "geomval" value, one for each group of pixel sharing the same value for the provided...
void rtdealloc(void *mem)
void cu_free_raster(rt_raster raster)