PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ lw_curvering_getfirstpoint2d_cp()

static const POINT2D* lw_curvering_getfirstpoint2d_cp ( LWGEOM geom)
static

Definition at line 949 of file measures.c.

References CIRCSTRINGTYPE, COMPOUNDTYPE, LWCOMPOUND::geoms, getPoint2d_cp(), LINETYPE, lwerror(), LWLINE::points, and LWGEOM::type.

Referenced by lw_dist2d_curvepoly_curvepoly().

950 {
951  switch( geom->type )
952  {
953  case LINETYPE:
954  return getPoint2d_cp(((LWLINE*)geom)->points, 0);
955  case CIRCSTRINGTYPE:
956  return getPoint2d_cp(((LWCIRCSTRING*)geom)->points, 0);
957  case COMPOUNDTYPE:
958  {
959  LWCOMPOUND *comp = (LWCOMPOUND*)geom;
960  LWLINE *line = (LWLINE*)(comp->geoms[0]);
961  return getPoint2d_cp(line->points, 0);
962  }
963  default:
964  lwerror("lw_curvering_getfirstpoint2d_cp: unknown type");
965  }
966  return NULL;
967 }
#define LINETYPE
Definition: liblwgeom.h:86
#define COMPOUNDTYPE
Definition: liblwgeom.h:93
LWGEOM ** geoms
Definition: liblwgeom.h:522
const POINT2D * getPoint2d_cp(const POINTARRAY *pa, int n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from...
Definition: lwgeom_api.c:373
uint8_t type
Definition: liblwgeom.h:396
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:92
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:190
POINTARRAY * points
Definition: liblwgeom.h:422
Here is the call graph for this function:
Here is the caller graph for this function: