PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwmpoint_construct()

LWMPOINT* lwmpoint_construct ( int  srid,
const POINTARRAY pa 
)

Definition at line 52 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().

53 {
54  int i;
55  int hasz = ptarray_has_z(pa);
56  int hasm = ptarray_has_m(pa);
58 
59  for ( i = 0; i < pa->npoints; i++ )
60  {
61  LWPOINT *lwp;
62  POINT4D p;
63  getPoint4d_p(pa, i, &p);
64  lwp = lwpoint_make(srid, hasz, hasm, &p);
65  lwmpoint_add_lwpoint(ret, lwp);
66  }
67 
68  return ret;
69 }
int npoints
Definition: liblwgeom.h:371
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
LWPOINT * lwpoint_make(int srid, int hasz, int hasm, const POINT4D *p)
Definition: lwpoint.c:206
int ptarray_has_m(const POINTARRAY *pa)
Definition: ptarray.c:43
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
Definition: lwmpoint.c:45
int ptarray_has_z(const POINTARRAY *pa)
Definition: ptarray.c:36
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)
Definition: lwgeom_api.c:122
Here is the call graph for this function:
Here is the caller graph for this function: