PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwcollection_grid()

LWCOLLECTION* lwcollection_grid ( const LWCOLLECTION coll,
const gridspec grid 
)

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

590 {
591  uint32_t i;
592  LWCOLLECTION *newcoll;
593 
594  newcoll = lwcollection_construct_empty(coll->type, coll->srid, lwgeom_has_z((LWGEOM*)coll), lwgeom_has_m((LWGEOM*)coll));
595 
596  for (i=0; i<coll->ngeoms; i++)
597  {
598  LWGEOM *g = lwgeom_grid(coll->geoms[i], grid);
599  if ( g )
600  lwcollection_add_lwgeom(newcoll, g);
601  }
602 
603  return newcoll;
604 }
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:1912
uint8_t type
Definition: liblwgeom.h:503
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition: lwgeom.c:885
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
unsigned int uint32_t
Definition: uthash.h:78
LWCOLLECTION * lwcollection_add_lwgeom(LWCOLLECTION *col, const LWGEOM *geom)
Appends geom to the collection managed by col.
Definition: lwcollection.c:187
int32_t srid
Definition: liblwgeom.h:506
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
Definition: lwgeom.c:892
Here is the call graph for this function:
Here is the caller graph for this function: