PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwcurvepoly_from_wkb_state()

static LWCURVEPOLY* lwcurvepoly_from_wkb_state ( wkb_parse_state s)
static

CURVEPOLYTYPE.

Definition at line 601 of file lwin_wkb.c.

References wkb_parse_state::has_m, wkb_parse_state::has_z, integer_from_wkb_state(), LW_FAILURE, lwcurvepoly_add_ring(), lwcurvepoly_construct_empty(), lwerror(), lwgeom_from_wkb_state(), and wkb_parse_state::srid.

Referenced by lwgeom_from_wkb_state().

602 {
603  uint32_t ngeoms = integer_from_wkb_state(s);
605  LWGEOM *geom = NULL;
606  int i;
607 
608  /* Empty collection? */
609  if ( ngeoms == 0 )
610  return cp;
611 
612  for ( i = 0; i < ngeoms; i++ )
613  {
614  geom = lwgeom_from_wkb_state(s);
615  if ( lwcurvepoly_add_ring(cp, geom) == LW_FAILURE )
616  lwerror("Unable to add geometry (%p) to curvepoly (%p)", geom, cp);
617  }
618 
619  return cp;
620 }
static uint32_t integer_from_wkb_state(wkb_parse_state *s)
Int32 Read 4-byte integer and advance the parse state forward.
Definition: lwin_wkb.c:267
#define LW_FAILURE
Definition: liblwgeom.h:78
LWCURVEPOLY * lwcurvepoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwcurvepoly.c:36
LWGEOM * lwgeom_from_wkb_state(wkb_parse_state *s)
Internal function declarations.
Definition: lwin_wkb.c:669
uint32_t srid
Definition: lwin_wkb.c:42
int lwcurvepoly_add_ring(LWCURVEPOLY *poly, LWGEOM *ring)
Add a ring, allocating extra space if necessary.
Definition: lwcurvepoly.c:72
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
Here is the call graph for this function:
Here is the caller graph for this function: