PostGIS  3.6.1dev-r@@SVN_REVISION@@

◆ lw_curvering_getfirstpoint2d_cp()

static const POINT2D* lw_curvering_getfirstpoint2d_cp ( LWGEOM geom)
static

Definition at line 883 of file measures.c.

884 {
885  switch (geom->type)
886  {
887  case LINETYPE:
888  return getPoint2d_cp(((LWLINE *)geom)->points, 0);
889  case CIRCSTRINGTYPE:
890  return getPoint2d_cp(((LWCIRCSTRING *)geom)->points, 0);
891  case COMPOUNDTYPE:
892  {
893  LWCOMPOUND *comp = (LWCOMPOUND *)geom;
894  LWLINE *line = (LWLINE *)(comp->geoms[0]);
895  return getPoint2d_cp(line->points, 0);
896  }
897  default:
898  lwerror("lw_curvering_getfirstpoint2d_cp: unknown type");
899  }
900  return NULL;
901 }
#define COMPOUNDTYPE
Definition: liblwgeom.h:110
#define LINETYPE
Definition: liblwgeom.h:103
#define CIRCSTRINGTYPE
Definition: liblwgeom.h:109
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
static const POINT2D * getPoint2d_cp(const POINTARRAY *pa, uint32_t n)
Returns a POINT2D pointer into the POINTARRAY serialized_ptlist, suitable for reading from.
Definition: lwinline.h:97
LWGEOM ** geoms
Definition: liblwgeom.h:589
uint8_t type
Definition: liblwgeom.h:462
POINTARRAY * points
Definition: liblwgeom.h:483

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

Referenced by lw_dist2d_curvepoly_curvepoly(), lw_dist2d_tri_circstring(), and lw_dist2d_tri_curvepoly().

Here is the call graph for this function:
Here is the caller graph for this function: