PostGIS  2.1.10dev-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 596 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(), lwerror(), lwgeom_from_wkb_state(), wkb_parse_state::lwtype, POLYHEDRALSURFACETYPE, and wkb_parse_state::srid.

Referenced by lwgeom_from_wkb_state().

597 {
598  uint32_t ngeoms = integer_from_wkb_state(s);
600  LWGEOM *geom = NULL;
601  int i;
602 
603  /* Empty collection? */
604  if ( ngeoms == 0 )
605  return col;
606 
607  /* Be strict in polyhedral surface closures */
608  if ( s->lwtype == POLYHEDRALSURFACETYPE )
610 
611  for ( i = 0; i < ngeoms; i++ )
612  {
613  geom = lwgeom_from_wkb_state(s);
614  if ( lwcollection_add_lwgeom(col, geom) == NULL )
615  {
616  lwerror("Unable to add geometry (%p) to collection (%p)", geom, col);
617  return NULL;
618  }
619  }
620 
621  return col;
622 }
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:250
uint32_t lwtype
Definition: lwin_wkb.c:24
#define POLYHEDRALSURFACETYPE
Definition: liblwgeom.h:72
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
#define LW_PARSER_CHECK_ZCLOSURE
Definition: liblwgeom.h:1704
LWGEOM * geom
LWGEOM * lwgeom_from_wkb_state(wkb_parse_state *s)
Internal function declarations.
Definition: lwin_wkb.c:632
uint32_t srid
Definition: lwin_wkb.c:25
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:81
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:174

Here is the call graph for this function:

Here is the caller graph for this function: