PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwcollection_grid()

LWCOLLECTION* lwcollection_grid ( const LWCOLLECTION coll,
const gridspec grid 

Definition at line 569 of file lwcollection.c.

References lwcollection_add_lwgeom(), lwcollection_construct_empty(), lwgeom_grid(), lwgeom_has_m(), lwgeom_has_z(), LWCOLLECTION::srid, and LWCOLLECTION::type.

Referenced by lwgeom_grid().

570 {
571  uint32_t i;
572  LWCOLLECTION *newcoll;
574  newcoll = lwcollection_construct_empty(coll->type, coll->srid, lwgeom_has_z((LWGEOM*)coll), lwgeom_has_m((LWGEOM*)coll));
576  for (i=0; i<coll->ngeoms; i++)
577  {
578  LWGEOM *g = lwgeom_grid(coll->geoms[i], grid);
579  if ( g )
580  lwcollection_add_lwgeom(newcoll, g);
581  }
583  return newcoll;
584 }
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:1868
uint8_t type
Definition: liblwgeom.h:487
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition: lwgeom.c:836
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
int32_t srid
Definition: liblwgeom.h:490
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
Definition: lwgeom.c:843
Here is the call graph for this function:
Here is the caller graph for this function: