442{
445 double ovp1, ovp2;
447 int8_t p1out, p2out;
448 uint32_t i;
451
452 assert(from <= to);
453
455
456
458
459
462
463 p1out = (ovp1 < from) ? -1 : ((ovp1 > to) ? 1 : 0);
464
465 if (from <= ovp1 && ovp1 <= to)
467
468
469 for (i = 1; i < ipa->
npoints; i++)
470 {
473 p2out = (ovp2 < from) ? -1 : ((ovp2 > to) ? 1 : 0);
474
475 if (p1out == 0 && p2out == 0)
476 {
478 }
479 else if (p1out == p2out && p1out != 0)
480 {
481
482 }
483 else if (p1out == -1 && p2out == 0)
484 {
488 }
489 else if (p1out == -1 && p2out == 1)
490 {
495 }
496 else if (p1out == 0 && p2out == -1)
497 {
500 }
501 else if (p1out == 0 && p2out == 1)
502 {
505 }
506 else if (p1out == 1 && p2out == -1)
507 {
512 }
513 else if (p1out == 1 && p2out == 0)
514 {
518 }
519
520 p1 = p2;
521 p1out = p2out;
523 }
524
525 if (is_closed && opa->
npoints > 2)
526 {
529 }
531
532 return opa;
533}
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...