PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ lwgeom_set_srid()

void lwgeom_set_srid ( LWGEOM geom,
int32_t  srid 
)

Definition at line 1552 of file lwgeom.c.

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

Referenced by lwgeom_subdivide().

1553 {
1554  int i;
1555 
1556  LWDEBUGF(4,"entered with srid=%d",srid);
1557 
1558  geom->srid = srid;
1559 
1560  if ( lwgeom_is_collection(geom) )
1561  {
1562  /* All the children are set to the same SRID value */
1563  LWCOLLECTION *col = lwgeom_as_lwcollection(geom);
1564  for ( i = 0; i < col->ngeoms; i++ )
1565  {
1566  lwgeom_set_srid(col->geoms[i], srid);
1567  }
1568  }
1569 }
int32_t srid
Definition: liblwgeom.h:398
LWGEOM ** geoms
Definition: liblwgeom.h:508
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:156
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1004
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Definition: lwgeom.c:1552
#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: