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

◆ lwgeom_set_geodetic()

void lwgeom_set_geodetic ( LWGEOM geom,
int  value 
)

Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.

Definition at line 964 of file lwgeom.c.

965{
966 LWPOINT *pt;
967 LWLINE *ln;
968 LWPOLY *ply;
969 LWCOLLECTION *col;
970 uint32_t i;
971
972 FLAGS_SET_GEODETIC(geom->flags, value);
973 if ( geom->bbox )
974 FLAGS_SET_GEODETIC(geom->bbox->flags, value);
975
976 switch(geom->type)
977 {
978 case POINTTYPE:
979 pt = (LWPOINT*)geom;
980 if ( pt->point )
981 FLAGS_SET_GEODETIC(pt->point->flags, value);
982 break;
983 case LINETYPE:
984 ln = (LWLINE*)geom;
985 if ( ln->points )
986 FLAGS_SET_GEODETIC(ln->points->flags, value);
987 break;
988 case POLYGONTYPE:
989 ply = (LWPOLY*)geom;
990 for ( i = 0; i < ply->nrings; i++ )
991 FLAGS_SET_GEODETIC(ply->rings[i]->flags, value);
992 break;
993 case MULTIPOINTTYPE:
994 case MULTILINETYPE:
995 case MULTIPOLYGONTYPE:
996 case COLLECTIONTYPE:
997 col = (LWCOLLECTION*)geom;
998 for ( i = 0; i < col->ngeoms; i++ )
999 lwgeom_set_geodetic(col->geoms[i], value);
1000 break;
1001 default:
1002 lwerror("lwgeom_set_geodetic: unsupported geom type: %s", lwtype_name(geom->type));
1003 return;
1004 }
1005}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition lwutil.c:216
#define COLLECTIONTYPE
Definition liblwgeom.h:108
#define MULTILINETYPE
Definition liblwgeom.h:106
#define LINETYPE
Definition liblwgeom.h:103
#define MULTIPOINTTYPE
Definition liblwgeom.h:105
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition liblwgeom.h:102
#define MULTIPOLYGONTYPE
Definition liblwgeom.h:107
#define POLYGONTYPE
Definition liblwgeom.h:104
#define FLAGS_SET_GEODETIC(flags, value)
Definition liblwgeom.h:175
void lwgeom_set_geodetic(LWGEOM *geom, int value)
Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.
Definition lwgeom.c:964
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
lwflags_t flags
Definition liblwgeom.h:353
uint32_t ngeoms
Definition liblwgeom.h:580
LWGEOM ** geoms
Definition liblwgeom.h:575
uint8_t type
Definition liblwgeom.h:462
GBOX * bbox
Definition liblwgeom.h:458
lwflags_t flags
Definition liblwgeom.h:461
POINTARRAY * points
Definition liblwgeom.h:483
POINTARRAY * point
Definition liblwgeom.h:471
POINTARRAY ** rings
Definition liblwgeom.h:519
uint32_t nrings
Definition liblwgeom.h:524
lwflags_t flags
Definition liblwgeom.h:431

References LWGEOM::bbox, COLLECTIONTYPE, GBOX::flags, POINTARRAY::flags, LWGEOM::flags, FLAGS_SET_GEODETIC, LWCOLLECTION::geoms, LINETYPE, lwerror(), lwgeom_set_geodetic(), lwtype_name(), MULTILINETYPE, MULTIPOINTTYPE, MULTIPOLYGONTYPE, LWCOLLECTION::ngeoms, LWPOLY::nrings, LWPOINT::point, LWLINE::points, POINTTYPE, POLYGONTYPE, LWPOLY::rings, and LWGEOM::type.

Referenced by geography_centroid_from_mline(), geography_centroid_from_mpoly(), geography_from_geometry(), geography_line_interpolate_point(), geography_line_substring(), geography_segmentize(), geometry_distance_spheroid(), geometry_from_geography(), gserialized_geography_from_lwgeom(), lwgeom_project_spheroid(), and lwgeom_set_geodetic().

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