PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ lwmpoint_from_lwgeom()

LWMPOINT * lwmpoint_from_lwgeom ( const LWGEOM g)
extern

Definition at line 93 of file lwmpoint.c.

94{
96 int has_z = lwgeom_has_z(g);
97 int has_m = lwgeom_has_m(g);
98 LWMPOINT* result = lwmpoint_construct_empty(g->srid, has_z, has_m);
99 POINT4D p;
100
101 while(lwpointiterator_next(it, &p)) {
102 LWPOINT* lwp = lwpoint_make(g->srid, has_z, has_m, &p);
104 }
105
107 return result;
108}
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition cu_print.c:267
LWPOINTITERATOR * lwpointiterator_create(const LWGEOM *g)
Create a new LWPOINTITERATOR over supplied LWGEOM*.
Definition lwiterator.c:243
int lwpointiterator_next(LWPOINTITERATOR *s, POINT4D *p)
Attempts to assign the next point in the iterator to p, and advances the iterator to the next point.
Definition lwiterator.c:210
void lwpointiterator_destroy(LWPOINTITERATOR *s)
Free all memory associated with the iterator.
Definition lwiterator.c:268
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition lwgeom.c:962
LWPOINT * lwpoint_make(int32_t srid, int hasz, int hasm, const POINT4D *p)
Definition lwpoint.c:206
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
Definition lwgeom.c:969
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
Definition lwmpoint.c:45
LWMPOINT * lwmpoint_construct_empty(int32_t srid, char hasz, char hasm)
Definition lwmpoint.c:39
int32_t srid
Definition liblwgeom.h:460

References lwgeom_has_m(), lwgeom_has_z(), lwmpoint_add_lwpoint(), lwmpoint_construct_empty(), lwpoint_make(), lwpointiterator_create(), lwpointiterator_destroy(), lwpointiterator_next(), result, and LWGEOM::srid.

Referenced by ST_Points(), and test_lwmpoint_from_lwgeom().

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