PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ 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 1638 of file lwgeom.c.

1639{
1640 uint32_t i;
1641
1642 LWDEBUGF(4,"entered with srid=%d",srid);
1643
1644 geom->srid = srid;
1645
1646 if ( lwgeom_is_collection(geom) )
1647 {
1648 /* All the children are set to the same SRID value */
1650 for ( i = 0; i < col->ngeoms; i++ )
1651 {
1652 lwgeom_set_srid(col->geoms[i], srid);
1653 }
1654 }
1655}
int lwgeom_is_collection(const LWGEOM *geom)
Determine whether a LWGEOM contains sub-geometries or not This basically just checks that the struct ...
Definition lwgeom.c:1125
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:1638
LWCOLLECTION * lwgeom_as_lwcollection(const LWGEOM *lwgeom)
Definition lwgeom.c:261
#define LWDEBUGF(level, msg,...)
Definition lwgeom_log.h:106
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: