PostGIS  3.3.9dev-r@@SVN_REVISION@@

◆ lwcollection_offsetcurve()

static LWGEOM* lwcollection_offsetcurve ( const LWCOLLECTION col,
double  size,
int  quadsegs,
int  joinStyle,
double  mitreLimit 
)
static

Definition at line 1566 of file liblwgeom/lwgeom_geos.c.

1567 {
1568  const LWGEOM *geom = lwcollection_as_lwgeom(col);
1569  int32_t srid = RESULT_SRID(geom);
1570  uint8_t is3d = FLAGS_GET_Z(col->flags);
1572  LWGEOM *tmp;
1573  uint32_t i;
1574  if (srid == SRID_INVALID) return NULL;
1575 
1577 
1578  for (i = 0; i < col->ngeoms; i++)
1579  {
1580  tmp = lwgeom_offsetcurve(col->geoms[i], size, quadsegs, joinStyle, mitreLimit);
1581 
1582  if (!tmp)
1583  {
1585  return NULL;
1586  }
1587 
1588  if (!lwgeom_is_empty(tmp))
1589  {
1590  if (lwgeom_is_collection(tmp))
1592  else
1594 
1595  if (!result)
1596  {
1597  lwgeom_free(tmp);
1598  return NULL;
1599  }
1600  }
1601  }
1602 
1603  if (result->ngeoms == 1)
1604  {
1605  tmp = result->geoms[0];
1607  return tmp;
1608  }
1609  else
1611 }
char result[OUT_DOUBLE_BUFFER_SIZE]
Definition: cu_print.c:267
LWGEOM * lwgeom_offsetcurve(const LWGEOM *geom, double size, int quadsegs, int joinStyle, double mitreLimit)
#define RESULT_SRID(...)
#define LW_FALSE
Definition: liblwgeom.h:109
LWGEOM * lwcollection_as_lwgeom(const LWCOLLECTION *obj)
Definition: lwgeom.c:309
#define SRID_INVALID
Definition: liblwgeom.h:234
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1155
#define MULTILINETYPE
Definition: liblwgeom.h:121
#define FLAGS_GET_Z(flags)
Definition: liblwgeom.h:180
int lwgeom_is_collection(const LWGEOM *lwgeom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1097
void lwcollection_release(LWCOLLECTION *lwcollection)
Definition: lwcollection.c:36
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int32_t srid, char hasz, char hasm)
Definition: lwcollection.c:92
void lwcollection_free(LWCOLLECTION *col)
Definition: lwcollection.c:357
LWCOLLECTION * lwcollection_concat_in_place(LWCOLLECTION *col1, const LWCOLLECTION *col2)
Appends all geometries from col2 to col1 in place.
Definition: lwcollection.c:241
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:188
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:233
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Definition: lwinline.h:203
lwflags_t flags
Definition: liblwgeom.h:592
uint32_t ngeoms
Definition: liblwgeom.h:595
LWGEOM ** geoms
Definition: liblwgeom.h:590

References LWCOLLECTION::flags, FLAGS_GET_Z, LWCOLLECTION::geoms, LW_FALSE, lwcollection_add_lwgeom(), lwcollection_as_lwgeom(), lwcollection_concat_in_place(), lwcollection_construct_empty(), lwcollection_free(), lwcollection_release(), lwgeom_as_lwcollection(), lwgeom_free(), lwgeom_is_collection(), lwgeom_is_empty(), lwgeom_offsetcurve(), MULTILINETYPE, LWCOLLECTION::ngeoms, result, RESULT_SRID, and SRID_INVALID.

Referenced by lwgeom_offsetcurve().

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