PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lwgeom_set_srid()

void lwgeom_set_srid ( LWGEOM geom,
int32_t  srid 
)

Definition at line 1539 of file lwgeom.c.

References LWCOLLECTION::geoms, LWDEBUGF, lwgeom_as_lwcollection(), lwgeom_is_collection(), LWCOLLECTION::ngeoms, and LWGEOM::srid.

Referenced by lwgeom_subdivide().

1540 {
1541  int i;
1542 
1543  LWDEBUGF(4,"entered with srid=%d",srid);
1544 
1545  geom->srid = srid;
1546 
1547  if ( lwgeom_is_collection(geom) )
1548  {
1549  /* All the children are set to the same SRID value */
1550  LWCOLLECTION *col = lwgeom_as_lwcollection(geom);
1551  for ( i = 0; i < col->ngeoms; i++ )
1552  {
1553  lwgeom_set_srid(col->geoms[i], srid);
1554  }
1555  }
1556 }
int32_t srid
Definition: liblwgeom.h:383
LWGEOM ** geoms
Definition: liblwgeom.h:493
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:143
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:991
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Definition: lwgeom.c:1539
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:55
Here is the call graph for this function:
Here is the caller graph for this function: