PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwcollection_grid()

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

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

583 {
584  uint32_t i;
585  LWCOLLECTION *newcoll;
586 
587  newcoll = lwcollection_construct_empty(coll->type, coll->srid, lwgeom_has_z((LWGEOM*)coll), lwgeom_has_m((LWGEOM*)coll));
588 
589  for (i=0; i<coll->ngeoms; i++)
590  {
591  LWGEOM *g = lwgeom_grid(coll->geoms[i], grid);
592  if ( g )
593  lwcollection_add_lwgeom(newcoll, g);
594  }
595 
596  return newcoll;
597 }
LWGEOM * lwgeom_grid(const LWGEOM *lwgeom, const gridspec *grid)
Definition: lwgeom.c:1881
uint8_t type
Definition: liblwgeom.h:502
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition: lwgeom.c:849
LWCOLLECTION * lwcollection_construct_empty(uint8_t type, int srid, char hasz, char hasm)
Definition: lwcollection.c:94
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:505
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
Definition: lwgeom.c:856
Here is the call graph for this function:
Here is the caller graph for this function: