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

◆ lwpoly_segmentize2d()

LWPOLY * lwpoly_segmentize2d ( const LWPOLY line,
double  dist 
)
extern

Definition at line 312 of file lwpoly.c.

313{
314 POINTARRAY **newrings;
315 uint32_t i;
316
317 newrings = lwalloc(sizeof(POINTARRAY *)*poly->nrings);
318 for (i=0; i<poly->nrings; i++)
319 {
320 newrings[i] = ptarray_segmentize2d(poly->rings[i], dist);
321 if ( ! newrings[i] )
322 {
323 uint32_t j = 0;
324 for (j = 0; j < i; j++)
325 ptarray_free(newrings[j]);
326 lwfree(newrings);
327 return NULL;
328 }
329 }
330 return lwpoly_construct(poly->srid, NULL,
331 poly->nrings, newrings);
332}
void * lwalloc(size_t size)
Definition lwutil.c:227
void lwfree(void *mem)
Definition lwutil.c:248
POINTARRAY * ptarray_segmentize2d(const POINTARRAY *ipa, double dist)
Returns a modified POINTARRAY so that no segment is longer than the given distance (computed using 2d...
Definition ptarray.c:413
void ptarray_free(POINTARRAY *pa)
Definition ptarray.c:327
LWPOLY * lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
Definition lwpoly.c:43

References lwalloc(), lwfree(), lwpoly_construct(), LWPOLY::nrings, ptarray_free(), ptarray_segmentize2d(), LWPOLY::rings, and LWPOLY::srid.

Referenced by lwgeom_segmentize2d().

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