255 {
258 const int maxX = 5;
259 const int maxY = 5;
262 int err;
263 LWGEOM *gexpected, *gobserved;
264
266 CU_ASSERT(rast != NULL);
267
270
272 CU_ASSERT(band != NULL);
273
274 for (y = 0;
y < maxY;
y++) {
275 for (x = 0;
x < maxX;
x++) {
277 }
278 }
279
282 CU_ASSERT(mpoly != NULL);
283
288 mpoly = NULL;
289
290
292
295 CU_ASSERT(mpoly != NULL);
300 mpoly = NULL;
301
302
304
307 CU_ASSERT(mpoly != NULL);
309 gexpected =
lwgeom_from_wkt(
"MULTIPOLYGON(((1 0,1 -1,0 -1,0 -5,4 -5,5 -5,5 0,1 0),(1 -1,1 -2,2 -2,2 -1,1 -1)))",
313 mpoly = NULL;
314
315
317
320 CU_ASSERT(mpoly != NULL);
323 "MULTIPOLYGON(((1 -1,1 0,5 0,5 -5,4 -5,0 -5,0 -1,1 -1),(1 -1,1 -2,2 -2,2 -1,1 -1),(2 -2,2 -3,3 -3,3 -2,2 -2)))",
327 mpoly = NULL;
328
329
331
334 CU_ASSERT(mpoly != NULL);
337 "MULTIPOLYGON(((1 -1,1 0,5 0,5 -5,4 -5,0 -5,0 -1,1 -1),(1 -1,1 -2,2 -2,2 -1,1 -1),(2 -2,2 -3,3 -3,3 -2,2 -2),(3 -3,3 -4,4 -4,4 -3,3 -3)))",
341 mpoly = NULL;
342
343
345
348 CU_ASSERT(mpoly != NULL);
351 "MULTIPOLYGON(((4 -4,4 -5,0 -5,0 -1,1 -1,1 -2,2 -2,2 -3,3 -3,3 -4,4 -4)),((1 -1,1 0,5 0,5 -4,4 -4,4 -3,3 -3,3 -2,2 -2,2 -1,1 -1)))",
355 mpoly = NULL;
356
357
362
365 CU_ASSERT(mpoly != NULL);
368 "MULTIPOLYGON(((1 -4,2 -4,2 -3,3 -3,3 -4,4 -4,4 -5,3 -5,1 -5,1 -4)),((1 -4,0 -4,0 -1,1 -1,1 -2,2 -2,2 -3,1 -3,1 -4)),((3 -2,4 -2,4 -1,5 -1,5 -4,4 -4,4 -3,3 -3,3 -2)),((3 -2,2 -2,2 -1,1 -1,1 0,4 0,4 -1,3 -1,3 -2)))",
372 mpoly = NULL;
373
375}
#define LW_PARSER_CHECK_NONE
void lwmpoly_free(LWMPOLY *mpoly)
double lwgeom_area(const LWGEOM *geom)
double lwgeom_perimeter(const LWGEOM *geom)
LWGEOM * lwmpoly_as_lwgeom(const LWMPOLY *obj)
LWGEOM * lwgeom_from_wkt(const char *wkt, const char check)
void rt_raster_set_scale(rt_raster raster, double scaleX, double scaleY)
Set scale in projection units.
rt_errorstate rt_raster_surface(rt_raster raster, int nband, LWMPOLY **surface)
Get a raster as a surface (multipolygon).
rt_raster rt_raster_new(uint32_t width, uint32_t height)
Construct a raster with given dimensions.
rt_errorstate rt_band_set_pixel(rt_band band, int x, int y, double val, int *converted)
Set single pixel's value.
void rt_raster_set_offsets(rt_raster raster, double x, double y)
Set insertion points in projection units.
rt_band cu_add_band(rt_raster raster, rt_pixtype pixtype, int hasnodata, double nodataval)
void cu_free_raster(rt_raster raster)