Extend the ends of a line.
678 bool forward =
false, backward =
false;
680 if (distance_forward < 0 || distance_backward < 0)
681 lwerror(
"%s: distances must be non-negative", __func__);
685 lwerror(
"%s: line must have at least two points", __func__);
689 if (distance_backward > 0.0)
699 lwerror(
"%s: line must have at least two distinct points", __func__);
708 if (distance_forward > 0.0)
718 lwerror(
"%s: line must have at least two distinct points", __func__);
int ptarray_append_ptarray(POINTARRAY *pa1, POINTARRAY *pa2, double gap_tolerance)
Append a POINTARRAY, pa2 to the end of an existing POINTARRAY, pa1.
POINTARRAY * ptarray_construct_empty(char hasz, char hasm, uint32_t maxpoints)
Create a new POINTARRAY with no points.
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,...
int p4d_same(const POINT4D *p1, const POINT4D *p2)
int lwline_is_empty(const LWLINE *line)
int ptarray_has_z(const POINTARRAY *pa)
int project_pt_pt(const POINT4D *A, const POINT4D *B, double distance, POINT4D *R)
Azimuth is angle in radians from vertical axis.
int ptarray_has_m(const POINTARRAY *pa)
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
uint32_t lwline_count_vertices(const LWLINE *line)
LWLINE * lwline_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)