PostGIS  2.2.7dev-r@@SVN_REVISION@@
static LWCURVEPOLY* lwcurvepoly_from_wkb_state ( wkb_parse_state s)
static

CURVEPOLYTYPE.

Definition at line 590 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().

591 {
592  uint32_t ngeoms = integer_from_wkb_state(s);
594  LWGEOM *geom = NULL;
595  int i;
596 
597  /* Empty collection? */
598  if ( ngeoms == 0 )
599  return cp;
600 
601  for ( i = 0; i < ngeoms; i++ )
602  {
603  geom = lwgeom_from_wkb_state(s);
604  if ( lwcurvepoly_add_ring(cp, geom) == LW_FAILURE )
605  lwerror("Unable to add geometry (%p) to curvepoly (%p)", geom, cp);
606  }
607 
608  return cp;
609 }
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:253
#define LW_FAILURE
Definition: liblwgeom.h:64
LWCURVEPOLY * lwcurvepoly_construct_empty(int srid, char hasz, char hasm)
Definition: lwcurvepoly.c:23
LWGEOM * lwgeom_from_wkb_state(wkb_parse_state *s)
Internal function declarations.
Definition: lwin_wkb.c:658
uint32_t srid
Definition: lwin_wkb.c:28
int lwcurvepoly_add_ring(LWCURVEPOLY *poly, LWGEOM *ring)
Add a ring, allocating extra space if necessary.
Definition: lwcurvepoly.c:59
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74

Here is the call graph for this function:

Here is the caller graph for this function: