430{
433 double ovp1, ovp2;
435 int8_t p1out, p2out;
436 uint32_t i;
439
440 assert(from <= to);
441
443
444
446
447
450
451 p1out = (ovp1 < from) ? -1 : ((ovp1 > to) ? 1 : 0);
452
453 if (from <= ovp1 && ovp1 <= to)
455
456
457 for (i = 1; i < ipa->
npoints; i++)
458 {
461 p2out = (ovp2 < from) ? -1 : ((ovp2 > to) ? 1 : 0);
462
463 if (p1out == 0 && p2out == 0)
464 {
466 }
467 else if (p1out == p2out && p1out != 0)
468 {
469
470 }
471 else if (p1out == -1 && p2out == 0)
472 {
476 }
477 else if (p1out == -1 && p2out == 1)
478 {
483 }
484 else if (p1out == 0 && p2out == -1)
485 {
488 }
489 else if (p1out == 0 && p2out == 1)
490 {
493 }
494 else if (p1out == 1 && p2out == -1)
495 {
500 }
501 else if (p1out == 1 && p2out == 0)
502 {
506 }
507
508 p1 = p2;
509 p1out = p2out;
511 }
512
513 if (is_closed && opa->
npoints > 2)
514 {
517 }
519
520 return opa;
521}
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)
void ptarray_free(POINTARRAY *pa)
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_ON_INTERRUPT(x)
double lwpoint_get_ordinate(const POINT4D *p, char ordinate)
Given a POINT4D and an ordinate number, return the value of the ordinate.
int point_interpolate(const POINT4D *p1, const POINT4D *p2, POINT4D *p, int hasz, int hasm, char ordinate, double interpolation_value)
Given two points, a dimensionality, an ordinate, and an interpolation value generate a new point that...