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

◆ lwpoly_segmentize2d()

LWPOLY * lwpoly_segmentize2d ( const LWPOLY poly,
double  dist 
)

Definition at line 311 of file lwpoly.c.

312{
313 POINTARRAY **newrings;
314 uint32_t i;
315
316 newrings = lwalloc(sizeof(POINTARRAY *)*poly->nrings);
317 for (i=0; i<poly->nrings; i++)
318 {
319 newrings[i] = ptarray_segmentize2d(poly->rings[i], dist);
320 if ( ! newrings[i] )
321 {
322 uint32_t j = 0;
323 for (j = 0; j < i; j++)
324 ptarray_free(newrings[j]);
325 lwfree(newrings);
326 return NULL;
327 }
328 }
329 return lwpoly_construct(poly->srid, NULL,
330 poly->nrings, newrings);
331}
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
POINTARRAY ** rings
Definition liblwgeom.h:519
uint32_t nrings
Definition liblwgeom.h:524
int32_t srid
Definition liblwgeom.h:520

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: