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

◆ lwcompound_get_endpoint()

LWPOINT * lwcompound_get_endpoint ( const LWCOMPOUND lwcmp)
extern

Definition at line 254 of file lwcompound.c.

255{
256 LWLINE *lwline;
257 if ( lwcmp->ngeoms < 1 )
258 {
259 return NULL;
260 }
261
262 lwline = (LWLINE*)(lwcmp->geoms[lwcmp->ngeoms-1]);
263
264 if ( (!lwline) || (!lwline->points) || (lwline->points->npoints < 1) )
265 {
266 return NULL;
267 }
268
269 return lwline_get_lwpoint(lwline, lwline->points->npoints-1);
270}
LWPOINT * lwline_get_lwpoint(const LWLINE *line, uint32_t where)
Returns freshly allocated LWPOINT that corresponds to the index where.
Definition lwline.c:309
uint32_t ngeoms
Definition liblwgeom.h:580
LWGEOM ** geoms
Definition liblwgeom.h:575
POINTARRAY * points
Definition liblwgeom.h:469
uint32_t npoints
Definition liblwgeom.h:413

References LWCOMPOUND::geoms, lwline_get_lwpoint(), LWCOMPOUND::ngeoms, POINTARRAY::npoints, and LWLINE::points.

Referenced by LWGEOM_endpoint_linestring().

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