PostGIS  2.5.0dev-r@@SVN_REVISION@@
static LWCOLLECTION* lwcollection_from_wkb_state ( wkb_parse_state s)
static

POLYHEDRALSURFACETYPE.

COLLECTION, MULTIPOINTTYPE, MULTILINETYPE, MULTIPOLYGONTYPE, COMPOUNDTYPE, MULTICURVETYPE, MULTISURFACETYPE, TINTYPE

Definition at line 636 of file lwin_wkb.c.

References wkb_parse_state::check, wkb_parse_state::has_m, wkb_parse_state::has_z, integer_from_wkb_state(), LW_PARSER_CHECK_ZCLOSURE, lwcollection_add_lwgeom(), lwcollection_construct_empty(), LWDEBUGF, lwerror(), lwgeom_from_wkb_state(), wkb_parse_state::lwtype, POLYHEDRALSURFACETYPE, and wkb_parse_state::srid.

Referenced by lwgeom_from_wkb_state().

637 {
638  uint32_t ngeoms = integer_from_wkb_state(s);
640  LWGEOM *geom = NULL;
641  uint32_t i;
642 
643  LWDEBUGF(4,"Collection has %d components", ngeoms);
644 
645  /* Empty collection? */
646  if ( ngeoms == 0 )
647  return col;
648 
649  /* Be strict in polyhedral surface closures */
650  if ( s->lwtype == POLYHEDRALSURFACETYPE )
652 
653  for ( i = 0; i < ngeoms; i++ )
654  {
655  geom = lwgeom_from_wkb_state(s);
656  if ( lwcollection_add_lwgeom(col, geom) == NULL )
657  {
658  lwerror("Unable to add geometry (%p) to collection (%p)", geom, col);
659  return NULL;
660  }
661  }
662 
663  return col;
664 }
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:271
uint32_t lwtype
Definition: lwin_wkb.c:42
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:96
unsigned int uint32_t
Definition: uthash.h:78
#define LW_PARSER_CHECK_ZCLOSURE
Definition: liblwgeom.h:1996
LWGEOM * lwgeom_from_wkb_state(wkb_parse_state *s)
Internal function declarations.
Definition: lwin_wkb.c:674
uint32_t srid
Definition: lwin_wkb.c:43
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:187
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190

Here is the call graph for this function:

Here is the caller graph for this function: