PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lwgeom_set_srid()

void lwgeom_set_srid ( LWGEOM geom,
int32_t  srid 
)

Definition at line 1583 of file lwgeom.c.

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

Referenced by lwgeom_subdivide().

1584 {
1585  int i;
1586 
1587  LWDEBUGF(4,"entered with srid=%d",srid);
1588 
1589  geom->srid = srid;
1590 
1591  if ( lwgeom_is_collection(geom) )
1592  {
1593  /* All the children are set to the same SRID value */
1594  LWCOLLECTION *col = lwgeom_as_lwcollection(geom);
1595  for ( i = 0; i < col->ngeoms; i++ )
1596  {
1597  lwgeom_set_srid(col->geoms[i], srid);
1598  }
1599  }
1600 }
int32_t srid
Definition: liblwgeom.h:399
LWGEOM ** geoms
Definition: liblwgeom.h:509
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:192
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1040
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Definition: lwgeom.c:1583
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
Here is the call graph for this function:
Here is the caller graph for this function: