PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ unroll_collection()

static void unroll_collection ( LWPOINTITERATOR s)
static

Remove an LWCOLLECTION from the iterator stack, and add the components of the LWCOLLECTIONs to the stack.

Definition at line 120 of file lwiterator.c.

References add_lwgeom_to_stack(), LWPOINTITERATOR::geoms, LISTNODE::item, lwcollection_getsubgeom(), LWCOLLECTION::ngeoms, and pop_node().

Referenced by unroll_collections().

121 {
122  int i;
123  LWCOLLECTION* c;
124 
125  if (!s->geoms)
126  {
127  return;
128  }
129 
130  c = (LWCOLLECTION*) s->geoms->item;
131  s->geoms = pop_node(s->geoms);
132 
133  for (i = c->ngeoms - 1; i >= 0; i--)
134  {
135  LWGEOM* g = lwcollection_getsubgeom(c, i);
136 
137  add_lwgeom_to_stack(s, g);
138  }
139 }
LWGEOM * lwcollection_getsubgeom(LWCOLLECTION *col, int gnum)
Definition: lwcollection.c:113
LISTNODE * geoms
Definition: lwiterator.c:46
static LISTNODE * pop_node(LISTNODE *i)
Definition: lwiterator.c:63
static int add_lwgeom_to_stack(LWPOINTITERATOR *s, LWGEOM *g)
Definition: lwiterator.c:71
void * item
Definition: lwiterator.c:32
Here is the call graph for this function:
Here is the caller graph for this function: