PostGIS  2.5.7dev-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 952 of file lwgeom.c.

953 {
954  LWPOINT *pt;
955  LWLINE *ln;
956  LWPOLY *ply;
957  LWCOLLECTION *col;
958  uint32_t i;
959 
961  if ( geom->bbox )
963 
964  switch(geom->type)
965  {
966  case POINTTYPE:
967  pt = (LWPOINT*)geom;
968  if ( pt->point )
970  break;
971  case LINETYPE:
972  ln = (LWLINE*)geom;
973  if ( ln->points )
975  break;
976  case POLYGONTYPE:
977  ply = (LWPOLY*)geom;
978  for ( i = 0; i < ply->nrings; i++ )
979  FLAGS_SET_GEODETIC(ply->rings[i]->flags, value);
980  break;
981  case MULTIPOINTTYPE:
982  case MULTILINETYPE:
983  case MULTIPOLYGONTYPE:
984  case COLLECTIONTYPE:
985  col = (LWCOLLECTION*)geom;
986  for ( i = 0; i < col->ngeoms; i++ )
987  lwgeom_set_geodetic(col->geoms[i], value);
988  break;
989  default:
990  lwerror("lwgeom_set_geodetic: unsupported geom type: %s", lwtype_name(geom->type));
991  return;
992  }
993 }
#define COLLECTIONTYPE
Definition: liblwgeom.h:91
#define MULTILINETYPE
Definition: liblwgeom.h:89
#define LINETYPE
Definition: liblwgeom.h:86
#define MULTIPOINTTYPE
Definition: liblwgeom.h:88
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:85
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:90
#define POLYGONTYPE
Definition: liblwgeom.h:87
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define FLAGS_SET_GEODETIC(flags, value)
Definition: liblwgeom.h:149
void lwgeom_set_geodetic(LWGEOM *geom, int value)
Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.
Definition: lwgeom.c:952
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
int value
Definition: genraster.py:61
uint8_t flags
Definition: liblwgeom.h:294
uint32_t ngeoms
Definition: liblwgeom.h:510
LWGEOM ** geoms
Definition: liblwgeom.h:512
uint8_t type
Definition: liblwgeom.h:399
GBOX * bbox
Definition: liblwgeom.h:401
uint8_t flags
Definition: liblwgeom.h:400
POINTARRAY * points
Definition: liblwgeom.h:425
POINTARRAY * point
Definition: liblwgeom.h:414
POINTARRAY ** rings
Definition: liblwgeom.h:460
uint32_t nrings
Definition: liblwgeom.h:458
uint8_t flags
Definition: liblwgeom.h:372
unsigned int uint32_t
Definition: uthash.h:78

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