PostGIS  2.3.7dev-r@@SVN_REVISION@@
void lwgeom_set_geodetic ( LWGEOM geom,
int  value 
)

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

Definition at line 871 of file lwgeom.c.

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

Referenced by geography_from_geometry(), geography_point_outside(), geography_segmentize(), geometry_distance_spheroid(), geometry_from_geography(), gserialized_geography_from_lwgeom(), and lwgeom_project_spheroid().

872 {
873  LWPOINT *pt;
874  LWLINE *ln;
875  LWPOLY *ply;
876  LWCOLLECTION *col;
877  int i;
878 
880  if ( geom->bbox )
882 
883  switch(geom->type)
884  {
885  case POINTTYPE:
886  pt = (LWPOINT*)geom;
887  if ( pt->point )
889  break;
890  case LINETYPE:
891  ln = (LWLINE*)geom;
892  if ( ln->points )
894  break;
895  case POLYGONTYPE:
896  ply = (LWPOLY*)geom;
897  for ( i = 0; i < ply->nrings; i++ )
898  FLAGS_SET_GEODETIC(ply->rings[i]->flags, value);
899  break;
900  case MULTIPOINTTYPE:
901  case MULTILINETYPE:
902  case MULTIPOLYGONTYPE:
903  case COLLECTIONTYPE:
904  col = (LWCOLLECTION*)geom;
905  for ( i = 0; i < col->ngeoms; i++ )
906  lwgeom_set_geodetic(col->geoms[i], value);
907  break;
908  default:
909  lwerror("lwgeom_set_geodetic: unsupported geom type: %s", lwtype_name(geom->type));
910  return;
911  }
912 }
#define LINETYPE
Definition: liblwgeom.h:85
GBOX * bbox
Definition: liblwgeom.h:397
#define POLYGONTYPE
Definition: liblwgeom.h:86
uint8_t flags
Definition: liblwgeom.h:396
#define MULTIPOINTTYPE
Definition: liblwgeom.h:87
#define FLAGS_SET_GEODETIC(flags, value)
Definition: liblwgeom.h:148
POINTARRAY * point
Definition: liblwgeom.h:410
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
uint8_t flags
Definition: liblwgeom.h:368
LWGEOM ** geoms
Definition: liblwgeom.h:508
POINTARRAY ** rings
Definition: liblwgeom.h:456
int nrings
Definition: liblwgeom.h:454
uint8_t flags
Definition: liblwgeom.h:290
void lwgeom_set_geodetic(LWGEOM *geom, int value)
Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.
Definition: lwgeom.c:871
#define MULTIPOLYGONTYPE
Definition: liblwgeom.h:89
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
Definition: liblwgeom.h:84
uint8_t type
Definition: liblwgeom.h:395
#define MULTILINETYPE
Definition: liblwgeom.h:88
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:102
#define COLLECTIONTYPE
Definition: liblwgeom.h:90
POINTARRAY * points
Definition: liblwgeom.h:421

Here is the call graph for this function:

Here is the caller graph for this function: