PostGIS  3.4.0dev-r@@SVN_REVISION@@

◆ circstring_from_pa()

static LWGEOM* circstring_from_pa ( const POINTARRAY pa,
int32_t  srid,
int  start,
int  end 
)
static

Definition at line 961 of file lwstroke.c.

962 {
963 
964  POINT4D p0, p1, p2;
966  LWDEBUGF(4, "srid=%d, start=%d, end=%d", srid, start, end);
967  getPoint4d_p(pa, start, &p0);
968  ptarray_set_point4d(pao, 0, &p0);
969  getPoint4d_p(pa, (start+end+1)/2, &p1);
970  ptarray_set_point4d(pao, 1, &p1);
971  getPoint4d_p(pa, end+1, &p2);
972  ptarray_set_point4d(pao, 2, &p2);
973  return lwcircstring_as_lwgeom(lwcircstring_construct(srid, NULL, pao));
974 }
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
Definition: ptarray.c:51
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition: lwgeom_api.c:125
LWGEOM * lwcircstring_as_lwgeom(const LWCIRCSTRING *obj)
Definition: lwgeom.c:314
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
Definition: lwgeom_api.c:369
LWCIRCSTRING * lwcircstring_construct(int32_t srid, GBOX *bbox, POINTARRAY *points)
Definition: lwcircstring.c:50
int ptarray_has_z(const POINTARRAY *pa)
Definition: ptarray.c:37
int ptarray_has_m(const POINTARRAY *pa)
Definition: ptarray.c:44
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88

References getPoint4d_p(), lwcircstring_as_lwgeom(), lwcircstring_construct(), LWDEBUGF, ptarray_construct(), ptarray_has_m(), ptarray_has_z(), and ptarray_set_point4d().

Referenced by geom_from_pa().

Here is the call graph for this function:
Here is the caller graph for this function: