Retrieves a collection of line segments given the root and crossing value.
The collection is a multilinestring consisting of two point lines representing the segments of the ring that may be crossed by the horizontal projection line at the given y value.
451{
454
455 POSTGIS_DEBUGF(2, "RTreeFindLineSegments called for tree %p and value %8.3f", root, value);
456
457 result = NULL;
458
460 {
461 POSTGIS_DEBUGF(3, "RTreeFindLineSegments %p: not contained.", root);
462
463 return NULL;
464 }
465
466
468 {
469 POSTGIS_DEBUGF(3,
"RTreeFindLineSegments %p: adding segment %p %d.", root, root->
segment, root->
segment->
type);
470
473
475
477 }
478
479
481 {
482 POSTGIS_DEBUGF(3, "RTreeFindLineSegments %p: recursing left.", root);
483
485 if (tmp)
486 {
488
489 if (result)
491 else
492 result = tmp;
493 }
494 }
495
496
498 {
499 POSTGIS_DEBUGF(3, "RTreeFindLineSegments %p: recursing right.", root);
500
502 if (tmp)
503 {
505
506 if (result)
508 else
509 result = tmp;
510 }
511 }
512
513 return result;
514}
LWCOLLECTION * lwcollection_construct(uint8_t type, int32_t srid, GBOX *bbox, uint32_t ngeoms, LWGEOM **geoms)
int lwgeom_ndims(const LWGEOM *geom)
Return the number of dimensions (2, 3, 4) in a geometry.
void * lwalloc(size_t size)
#define SRID_UNKNOWN
Unknown SRID value.
LWMLINE * RTreeFindLineSegments(RTREE_NODE *root, double value)
Retrieves a collection of line segments given the root and crossing value.
static LWMLINE * RTreeMergeMultiLines(LWMLINE *line1, LWMLINE *line2)
Merges two multilinestrings into a single multilinestring.
static uint32 IntervalIsContained(RTREE_INTERVAL *interval, double value)
Returns 1 if min < value <= max, 0 otherwise.
struct rtree_node * leftNode
struct rtree_node * rightNode
RTREE_INTERVAL * interval