PostGIS  2.1.10dev-r@@SVN_REVISION@@
LWMPOINT* lwmpoint_construct ( int  srid,
const POINTARRAY pa 
)

Definition at line 39 of file lwmpoint.c.

References getPoint4d_p(), lwcollection_construct_empty(), lwmpoint_add_lwpoint(), lwpoint_make(), MULTIPOINTTYPE, POINTARRAY::npoints, ptarray_has_m(), and ptarray_has_z().

Referenced by lwline_locate_along().

40 {
41  int i;
42  int hasz = ptarray_has_z(pa);
43  int hasm = ptarray_has_m(pa);
45 
46  for ( i = 0; i < pa->npoints; i++ )
47  {
48  LWPOINT *lwp;
49  POINT4D p;
50  getPoint4d_p(pa, i, &p);
51  lwp = lwpoint_make(srid, hasz, hasm, &p);
52  lwmpoint_add_lwpoint(ret, lwp);
53  }
54 
55  return ret;
56 }
int npoints
Definition: liblwgeom.h:327
#define MULTIPOINTTYPE
Definition: liblwgeom.h:63
LWPOINT * lwpoint_make(int srid, int hasz, int hasm, const POINT4D *p)
Definition: lwpoint.c:173
int ptarray_has_m(const POINTARRAY *pa)
Definition: ptarray.c:30
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
Definition: lwmpoint.c:32
int ptarray_has_z(const POINTARRAY *pa)
Definition: ptarray.c:23
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:81
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:217

Here is the call graph for this function:

Here is the caller graph for this function: