This is a recursive function delivering every possible combination of subgeometries.
Definition at line 299 of file measures.c.
300{
301 int i, j;
302 int n1 = 1;
303 int n2 = 1;
308
309 LWDEBUGF(2,
"lw_dist2d_comp is called with type1=%d, type2=%d", lwg1->
type, lwg2->
type);
310
312 {
313 LWDEBUG(3,
"First geometry is collection");
316 }
318 {
319 LWDEBUG(3,
"Second geometry is collection");
322 }
323
324 for (i = 0; i < n1; i++)
325 {
326
329 else
331
332 if (!g1) continue;
333
335 continue;
336
338 {
339 LWDEBUG(3,
"Found collection inside first geometry collection, recursing");
342 continue;
343 }
344 for (j = 0; j < n2; j++)
345 {
348 else
350
351 if (!g2) continue;
352
354 {
355 LWDEBUG(3,
"Found collection inside second geometry collection, recursing");
358 continue;
359 }
360
363
366
367
369 continue;
370
374 {
377 }
378 else
379 {
385 LWDEBUG(2,
"Not below tolerance yet");
386 }
387 }
388 }
390}
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
#define LW_TRUE
Return types for functions with status returns.
void lwgeom_add_bbox(LWGEOM *lwgeom)
Compute a bbox if not already computed.
#define LWDEBUG(level, msg)
#define LWDEBUGF(level, msg,...)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static int lw_dist2d_check_overlap(const LWGEOM *lwg1, const LWGEOM *lwg2)
int lw_dist2d_recursive(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS *dl)
This is a recursive function delivering every possible combination of subgeometries.
static int lw_dist2d_is_collection(const LWGEOM *g)
int lw_dist2d_distribute_bruteforce(const LWGEOM *lwg1, const LWGEOM *lwg2, DISTPTS *dl)
int lw_dist2d_distribute_fast(LWGEOM *lwg1, LWGEOM *lwg2, DISTPTS *dl)
Geometries are distributed for the new faster distance-calculations.
References LWGEOM::bbox, DIST_MAX, DIST_MIN, DISTPTS::distance, LWCOLLECTION::geoms, LINETYPE, lw_dist2d_check_overlap(), lw_dist2d_distribute_bruteforce(), lw_dist2d_distribute_fast(), lw_dist2d_is_collection(), lw_dist2d_recursive(), LW_FALSE, LW_TRUE, LWDEBUG, LWDEBUGF, lwgeom_add_bbox(), lwgeom_as_lwcollection(), lwgeom_is_empty(), DISTPTS::mode, LWCOLLECTION::ngeoms, POLYGONTYPE, DISTPTS::tolerance, TRIANGLETYPE, and LWGEOM::type.
Referenced by lw_dist2d_comp(), lw_dist2d_curvepoly_curvepoly(), lw_dist2d_line_curvepoly(), lw_dist2d_point_curvepoly(), lw_dist2d_recursive(), and lw_dist2d_tri_curvepoly().