437{
440 uint32_t i;
441
443
444
445
446
447
448
449
450
452
453 POSTGIS_DEBUGF(2, "ptarray_locate...: called for pointarray %p, m0:%g, m1:%g",
454 ipa, m0, m1);
455
456
458 {
460 int clipval;
461
464
465 POSTGIS_DEBUGF(3, " segment %d-%d [ %g %g %g %g - %g %g %g %g ]",
466 i-1, i,
467 p1.
x, p1.
y, p1.
z, p1.
m,
468 p2.
x, p2.
y, p2.
z, p2.
m);
469
471
472
473 if (! clipval ) continue;
474
475 POSTGIS_DEBUGF(3,
" clipped to: [ %g %g %g %g - %g %g %g %g ] clipval: %d", p1.
x, p1.
y, p1.
z, p1.
m,
476 p2.
x, p2.
y, p2.
z, p2.
m, clipval);
477
478
479
480 if (dpa == NULL)
481 {
482 POSTGIS_DEBUGF(3,
" 1 creating new POINTARRAY with first point %g,%g,%g,%g", p1.
x, p1.
y, p1.
z, p1.
m);
483
486 }
487
488
489 if (dpa)
491
492
493
494
495 if ( clipval & 0x0100 || i == ipa->
npoints-1 )
496 {
497 POSTGIS_DEBUGF(3,
" closing pointarray %p with %d points", dpa, dpa->
npoints);
498
500 dpa = NULL;
501 }
502 }
503
504
505
506
507
508 if ( dpa != NULL ) lwpgerror("Something wrong with algorithm");
509
510 return ret;
511}
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
#define FLAGS_GET_Z(flags)
void * lwalloc(size_t size)
#define FLAGS_GET_M(flags)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
#define LW_TRUE
Return types for functions with status returns.
static int clip_seg_by_m_range(POINT4D *p1, POINT4D *p2, double m0, double m1)