PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ lw_curvering_getfirstpoint2d_cp()

static const POINT2D* lw_curvering_getfirstpoint2d_cp ( LWGEOM geom)
static

Definition at line 935 of file measures.c.

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

Referenced by lw_dist2d_curvepoly_curvepoly().

936 {
937  switch( geom->type )
938  {
939  case LINETYPE:
940  return getPoint2d_cp(((LWLINE*)geom)->points, 0);
941  case CIRCSTRINGTYPE:
942  return getPoint2d_cp(((LWCIRCSTRING*)geom)->points, 0);
943  case COMPOUNDTYPE:
944  {
945  LWCOMPOUND *comp = (LWCOMPOUND*)geom;
946  LWLINE *line = (LWLINE*)(comp->geoms[0]);
947  return getPoint2d_cp(line->points, 0);
948  }
949  default:
950  lwerror("lw_curvering_getfirstpoint2d_cp: unknown type");
951  }
952  return NULL;
953 }
#define LINETYPE
Definition: liblwgeom.h:71
#define COMPOUNDTYPE
Definition: liblwgeom.h:78
LWGEOM ** geoms
Definition: liblwgeom.h:506
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:472
uint8_t type
Definition: liblwgeom.h:380
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:77
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:74
POINTARRAY * points
Definition: liblwgeom.h:406
Here is the call graph for this function:
Here is the caller graph for this function: