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

◆ lwline_make_geos_friendly()

LWGEOM * lwline_make_geos_friendly ( LWLINE line)

Definition at line 258 of file liblwgeom/lwgeom_geos_clean.c.

259{
260 LWGEOM* ret;
261
262 if (line->points->npoints == 1) /* 0 is fine, 2 is fine */
263 {
264#if 1
265 /* Duplicate point */
266 line->points = ptarray_addPoint(line->points,
267 getPoint_internal(line->points, 0),
268 FLAGS_NDIMS(line->points->flags),
269 line->points->npoints);
270 ret = (LWGEOM*)line;
271#else
272 /* Turn into a point */
273 ret = (LWGEOM*)lwpoint_construct(line->srid, 0, line->points);
274#endif
275 return ret;
276 }
277 else
278 {
279 return (LWGEOM*)line;
280 /* return lwline_clone(line); */
281 }
282}
LWPOINT * lwpoint_construct(int32_t srid, GBOX *bbox, POINTARRAY *point)
Definition lwpoint.c:129
#define FLAGS_NDIMS(flags)
Definition liblwgeom.h:193
POINTARRAY * ptarray_addPoint(const POINTARRAY *pa, uint8_t *p, size_t pdims, uint32_t where)
Add a point in a pointarray.
Definition ptarray.c:509
static uint8_t * getPoint_internal(const POINTARRAY *pa, uint32_t n)
Definition lwinline.h:67
POINTARRAY * points
Definition liblwgeom.h:469
int32_t srid
Definition liblwgeom.h:470
lwflags_t flags
Definition liblwgeom.h:417
uint32_t npoints
Definition liblwgeom.h:413

References POINTARRAY::flags, FLAGS_NDIMS, getPoint_internal(), lwpoint_construct(), POINTARRAY::npoints, LWLINE::points, ptarray_addPoint(), and LWLINE::srid.

Referenced by lwgeom_make_geos_friendly().

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