33 uint32_t p, i, n_out_points=0, p1_set=0, p2_set=0;
37 double deltaval, quarter_delta, val1, val2;
39 int new_npoints = inpts->
npoints * 2;
42 dlist = (
double*)(
opts->serialized_pointlist);
54 memcpy(&p2, &p1,
sizeof(
POINT4D));
61 val1 = ((
double*) &(p1))[i];
62 val2 = ((
double*) &(p2))[i];
63 deltaval = val1 - val2;
64 quarter_delta = deltaval * 0.25;
65 if(!preserve_endpoint || p > 1)
67 dlist[n_out_points * ndims + i] = val2 + quarter_delta;
70 if(!preserve_endpoint || p < inpts->npoints - 1)
72 dlist[(n_out_points + p1_set) * ndims + i] = val1 - quarter_delta;
76 n_out_points+=(p1_set + p2_set);
83 opts->npoints = n_out_points;
88 if(isclosed && !preserve_endpoint)
90 opts->npoints = n_out_points;
95 opts->npoints = n_out_points;
POINT4D getPoint4d(const POINTARRAY *pa, uint32_t n)
#define FLAGS_GET_Z(flags)
Macros for manipulating the 'flags' byte.
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
#define FLAGS_GET_M(flags)
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.
int ptarray_has_z(const POINTARRAY *pa)
int ptarray_has_m(const POINTARRAY *pa)