PostGIS  2.1.10dev-r@@SVN_REVISION@@
static LWMPOINT* lwmpoint_locate_along ( const LWMPOINT lwin,
double  m,
double  offset 
)
static

Definition at line 173 of file lwlinearreferencing.c.

References FP_EQUALS, LWMPOINT::geoms, lwgeom_get_srid(), lwgeom_has_m(), lwgeom_has_z(), lwmpoint_add_lwpoint(), lwmpoint_as_lwgeom(), lwmpoint_construct_empty(), lwpoint_clone(), lwpoint_get_m(), and LWMPOINT::ngeoms.

Referenced by lwgeom_locate_along().

174 {
175  LWGEOM *lwg = lwmpoint_as_lwgeom(lwin);
176  LWMPOINT *lwout = NULL;
177  int i;
178 
179  /* Construct return */
181 
182  for ( i = 0; i < lwin->ngeoms; i++ )
183  {
184  double point_m = lwpoint_get_m(lwin->geoms[i]);
185  if ( FP_EQUALS(m, point_m) )
186  {
187  lwmpoint_add_lwpoint(lwout, lwpoint_clone(lwin->geoms[i]));
188  }
189  }
190 
191  return lwout;
192 }
int32_t lwgeom_get_srid(const LWGEOM *geom)
Return SRID number.
Definition: lwgeom.c:778
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition: lwgeom.c:792
LWPOINT * lwpoint_clone(const LWPOINT *lwgeom)
Definition: lwpoint.c:206
LWPOINT ** geoms
Definition: liblwgeom.h:426
LWMPOINT * lwmpoint_construct_empty(int srid, char hasz, char hasm)
Definition: lwmpoint.c:26
double lwpoint_get_m(const LWPOINT *point)
Definition: lwpoint.c:80
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
Definition: lwmpoint.c:32
#define FP_EQUALS(A, B)
int ngeoms
Definition: liblwgeom.h:424
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
Definition: lwgeom.c:799
LWGEOM * lwmpoint_as_lwgeom(const LWMPOINT *obj)
Definition: lwgeom.c:214

Here is the call graph for this function:

Here is the caller graph for this function: