PostGIS  3.0.6dev-r@@SVN_REVISION@@

◆ lwgeom_set_srid()

void lwgeom_set_srid ( LWGEOM geom,
int32_t  srid 
)

Set the SRID on an LWGEOM For collections, only the parent gets an SRID, all the children get SRID_UNKNOWN.

Definition at line 1530 of file lwgeom.c.

1531 {
1532  uint32_t i;
1533 
1534  LWDEBUGF(4,"entered with srid=%d",srid);
1535 
1536  geom->srid = srid;
1537 
1538  if ( lwgeom_is_collection(geom) )
1539  {
1540  /* All the children are set to the same SRID value */
1541  LWCOLLECTION *col = lwgeom_as_lwcollection(geom);
1542  for ( i = 0; i < col->ngeoms; i++ )
1543  {
1544  lwgeom_set_srid(col->geoms[i], srid);
1545  }
1546  }
1547 }
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1079
void lwgeom_set_srid(LWGEOM *geom, int32_t srid)
Set the SRID on an LWGEOM For collections, only the parent gets an SRID, all the children get SRID_UN...
Definition: lwgeom.c:1530
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:215
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
uint32_t ngeoms
Definition: liblwgeom.h:566
LWGEOM ** geoms
Definition: liblwgeom.h:561
int32_t srid
Definition: liblwgeom.h:446

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

Referenced by geom_from_geojson(), line_from_encoded_polyline(), lwgeom_delaunay_triangulation(), LWGEOM_expand(), lwgeom_from_gserialized1(), lwgeom_from_gserialized2(), LWGEOM_from_text(), LWGEOM_in(), lwgeom_node(), lwgeom_set_srid(), lwgeom_subdivide(), lwgeom_voronoi_diagram(), LWGEOMFromEWKB(), lwline_split_by_line(), lwpoly_construct_envelope(), rt_raster_gdal_polygonize(), rt_raster_surface(), and wkt_parser_geometry_new().

Here is the call graph for this function:
Here is the caller graph for this function: