PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lwgeom_set_srid()

void lwgeom_set_srid ( LWGEOM geom,
int32_t  srid 
)

Definition at line 1579 of file lwgeom.c.

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

Referenced by lwgeom_subdivide().

1580 {
1581  uint32_t i;
1582 
1583  LWDEBUGF(4,"entered with srid=%d",srid);
1584 
1585  geom->srid = srid;
1586 
1587  if ( lwgeom_is_collection(geom) )
1588  {
1589  /* All the children are set to the same SRID value */
1590  LWCOLLECTION *col = lwgeom_as_lwcollection(geom);
1591  for ( i = 0; i < col->ngeoms; i++ )
1592  {
1593  lwgeom_set_srid(col->geoms[i], srid);
1594  }
1595  }
1596 }
uint32_t ngeoms
Definition: liblwgeom.h:509
int32_t srid
Definition: liblwgeom.h:401
unsigned int uint32_t
Definition: uthash.h:78
LWGEOM ** geoms
Definition: liblwgeom.h:511
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:224
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1085
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Definition: lwgeom.c:1579
#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: