PostGIS  2.5.2dev-r@@SVN_REVISION@@

◆ linestring_from_pa()

static LWGEOM* linestring_from_pa ( const POINTARRAY pa,
int  srid,
int  start,
int  end 

Definition at line 835 of file lwstroke.c.

References getPoint4d_p(), LWDEBUGF, lwline_as_lwgeom(), lwline_construct(), ptarray_construct(), ptarray_has_m(), ptarray_has_z(), and ptarray_set_point4d().

Referenced by geom_from_pa().

836 {
837  int i = 0, j = 0;
838  POINT4D p;
839  POINTARRAY *pao = ptarray_construct(ptarray_has_z(pa), ptarray_has_m(pa), end-start+2);
840  LWDEBUGF(4, "srid=%d, start=%d, end=%d", srid, start, end);
841  for( i = start; i < end + 2; i++ )
842  {
843  getPoint4d_p(pa, i, &p);
844  ptarray_set_point4d(pao, j++, &p);
845  }
846  return lwline_as_lwgeom(lwline_construct(srid, NULL, pao));
847 }
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:62
void ptarray_set_point4d(POINTARRAY *pa, uint32_t n, const POINT4D *p4d)
Definition: lwgeom_api.c:435
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
Definition: lwgeom.c:330
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
Definition: lwline.c:42
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition: lwgeom_api.c:123
int ptarray_has_m(const POINTARRAY *pa)
Definition: ptarray.c:43
int ptarray_has_z(const POINTARRAY *pa)
Definition: ptarray.c:36
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
Here is the call graph for this function:
Here is the caller graph for this function: