PostGIS  2.5.0beta2dev-r@@SVN_REVISION@@

◆ lw_curvering_getfirstpoint2d_cp()

static const POINT2D* lw_curvering_getfirstpoint2d_cp ( LWGEOM geom)
static

Definition at line 953 of file measures.c.

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

Referenced by lw_dist2d_curvepoly_curvepoly().

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