PostGIS  3.1.6dev-r@@SVN_REVISION@@

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

948 {
949  LWPOINT *pt;
950  LWLINE *ln;
951  LWPOLY *ply;
952  LWCOLLECTION *col;
953  uint32_t i;
954 
956  if ( geom->bbox )
958 
959  switch(geom->type)
960  {
961  case POINTTYPE:
962  pt = (LWPOINT*)geom;
963  if ( pt->point )
965  break;
966  case LINETYPE:
967  ln = (LWLINE*)geom;
968  if ( ln->points )
970  break;
971  case POLYGONTYPE:
972  ply = (LWPOLY*)geom;
973  for ( i = 0; i < ply->nrings; i++ )
974  FLAGS_SET_GEODETIC(ply->rings[i]->flags, value);
975  break;
976  case MULTIPOINTTYPE:
977  case MULTILINETYPE:
978  case MULTIPOLYGONTYPE:
979  case COLLECTIONTYPE:
980  col = (LWCOLLECTION*)geom;
981  for ( i = 0; i < col->ngeoms; i++ )
982  lwgeom_set_geodetic(col->geoms[i], value);
983  break;
984  default:
985  lwerror("lwgeom_set_geodetic: unsupported geom type: %s", lwtype_name(geom->type));
986  return;
987  }
988 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:122
#define MULTILINETYPE
Definition: liblwgeom.h:120
#define LINETYPE
Definition: liblwgeom.h:117
#define MULTIPOINTTYPE
Definition: liblwgeom.h:119
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:116
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:121
#define POLYGONTYPE
Definition: liblwgeom.h:118
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
#define FLAGS_SET_GEODETIC(flags, value)
Definition: liblwgeom.h:189
void lwgeom_set_geodetic(LWGEOM *geom, int value)
Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.
Definition: lwgeom.c:947
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
int value
Definition: genraster.py:62
lwflags_t flags
Definition: liblwgeom.h:367
uint32_t ngeoms
Definition: liblwgeom.h:594
LWGEOM ** geoms
Definition: liblwgeom.h:589
uint8_t type
Definition: liblwgeom.h:476
GBOX * bbox
Definition: liblwgeom.h:472
lwflags_t flags
Definition: liblwgeom.h:475
POINTARRAY * points
Definition: liblwgeom.h:497
POINTARRAY * point
Definition: liblwgeom.h:485
POINTARRAY ** rings
Definition: liblwgeom.h:533
uint32_t nrings
Definition: liblwgeom.h:538
lwflags_t flags
Definition: liblwgeom.h:445

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, LWGEOM::type, and genraster::value.

Referenced by geography_centroid_from_mline(), geography_centroid_from_mpoly(), geography_from_geometry(), 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: