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

Definition at line 196 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().

197 {
198  LWGEOM *lwg = lwmpoint_as_lwgeom(lwin);
199  LWMPOINT *lwout = NULL;
200  int i;
201 
202  /* Construct return */
204 
205  for ( i = 0; i < lwin->ngeoms; i++ )
206  {
207  double point_m = lwpoint_get_m(lwin->geoms[i]);
208  if ( FP_EQUALS(m, point_m) )
209  {
210  lwmpoint_add_lwpoint(lwout, lwpoint_clone(lwin->geoms[i]));
211  }
212  }
213 
214  return lwout;
215 }
int32_t lwgeom_get_srid(const LWGEOM *geom)
Return SRID number.
Definition: lwgeom.c:835
int lwgeom_has_z(const LWGEOM *geom)
Return LW_TRUE if geometry has Z ordinates.
Definition: lwgeom.c:849
LWPOINT * lwpoint_clone(const LWPOINT *lwgeom)
Definition: lwpoint.c:221
LWPOINT ** geoms
Definition: liblwgeom.h:469
LWMPOINT * lwmpoint_construct_empty(int srid, char hasz, char hasm)
Definition: lwmpoint.c:39
double lwpoint_get_m(const LWPOINT *point)
Definition: lwpoint.c:95
LWMPOINT * lwmpoint_add_lwpoint(LWMPOINT *mobj, const LWPOINT *obj)
Definition: lwmpoint.c:45
#define FP_EQUALS(A, B)
int ngeoms
Definition: liblwgeom.h:467
int lwgeom_has_m(const LWGEOM *geom)
Return LW_TRUE if geometry has M ordinates.
Definition: lwgeom.c:856
LWGEOM * lwmpoint_as_lwgeom(const LWMPOINT *obj)
Definition: lwgeom.c:227

Here is the call graph for this function:

Here is the caller graph for this function: