PostGIS  2.1.10dev-r@@SVN_REVISION@@
static const POINT2D* lw_curvering_getfirstpoint2d_cp ( LWGEOM geom)
static

Definition at line 909 of file measures.c.

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

Referenced by lw_dist2d_curvepoly_curvepoly().

910 {
911  switch( geom->type )
912  {
913  case LINETYPE:
914  return getPoint2d_cp(((LWLINE*)geom)->points, 0);
915  case CIRCSTRINGTYPE:
916  return getPoint2d_cp(((LWCIRCSTRING*)geom)->points, 0);
917  case COMPOUNDTYPE:
918  {
919  LWCOMPOUND *comp = (LWCOMPOUND*)geom;
920  LWLINE *line = (LWLINE*)(comp->geoms[0]);
921  return getPoint2d_cp(line->points, 0);
922  }
923  default:
924  lwerror("lw_curvering_getfirstpoint2d_cp: unknown type");
925  }
926  return NULL;
927 }
#define LINETYPE
Definition: liblwgeom.h:61
#define COMPOUNDTYPE
Definition: liblwgeom.h:68
LWGEOM ** geoms
Definition: liblwgeom.h:478
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
Definition: lwutil.c:67
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:458
uint8_t type
Definition: liblwgeom.h:352
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:67
POINTARRAY * points
Definition: liblwgeom.h:378

Here is the call graph for this function:

Here is the caller graph for this function: