PostGIS  3.4.0dev-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 1547 of file lwgeom.c.

1548 {
1549  uint32_t i;
1550 
1551  LWDEBUGF(4,"entered with srid=%d",srid);
1552 
1553  geom->srid = srid;
1554 
1555  if ( lwgeom_is_collection(geom) )
1556  {
1557  /* All the children are set to the same SRID value */
1558  LWCOLLECTION *col = lwgeom_as_lwcollection(geom);
1559  for ( i = 0; i < col->ngeoms; i++ )
1560  {
1561  lwgeom_set_srid(col->geoms[i], srid);
1562  }
1563  }
1564 }
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM can contain sub-geometries or not.
Definition: lwgeom.c:1097
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:1547
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition: lwgeom.c:233
#define LWDEBUGF(level, msg,...)
Definition: lwgeom_log.h:88
uint32_t ngeoms
Definition: liblwgeom.h:580
LWGEOM ** geoms
Definition: liblwgeom.h:575
int32_t srid
Definition: liblwgeom.h:460

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_text(), LWGEOM_in(), lwgeom_node(), lwgeom_set_srid(), lwgeom_subdivide_prec(), lwgeom_voronoi_diagram(), LWGEOMFromEWKB(), lwline_split_by_line(), lwpoly_construct_envelope(), rt_raster_gdal_contour(), 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: