PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwmpoint_construct()

LWMPOINT* lwmpoint_construct ( int  srid,
const POINTARRAY pa 
)

Definition at line 52 of file lwmpoint.c.

53 {
54  uint32_t 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 }
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
Definition: lwgeom_api.c:123
LWPOINT * lwpoint_make(int srid, int hasz, int hasm, const POINT4D *p)
Definition: lwpoint.c:206
int ptarray_has_z(const POINTARRAY *pa)
Definition: ptarray.c:36
int ptarray_has_m(const POINTARRAY *pa)
Definition: ptarray.c:43
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
Definition: lwmpoint.c:45
uint32_t npoints
Definition: liblwgeom.h:374
unsigned int uint32_t
Definition: uthash.h:78

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

Referenced by LWGEOM_line_interpolate_point(), and lwline_locate_along().

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