PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ ST_LocateAlong()

Datum ST_LocateAlong ( PG_FUNCTION_ARGS  )

Definition at line 69 of file lwgeom_functions_lrs.c.

References geometry_serialize(), lwgeom_free(), lwgeom_from_gserialized(), lwgeom_locate_along(), PG_FUNCTION_INFO_V1(), and ST_LocateBetween().

Referenced by ST_AddMeasure(), and ST_LocateBetween().

70 {
71  GSERIALIZED *gin = PG_GETARG_GSERIALIZED_P(0);
72  GSERIALIZED *gout;
73  LWGEOM *lwin = NULL, *lwout = NULL;
74  double measure = PG_GETARG_FLOAT8(1);
75  double offset = PG_GETARG_FLOAT8(2);;
76 
77  lwin = lwgeom_from_gserialized(gin);
78  lwout = lwgeom_locate_along(lwin, measure, offset);
79  lwgeom_free(lwin);
80  PG_FREE_IF_COPY(gin, 0);
81 
82  if ( ! lwout )
83  PG_RETURN_NULL();
84 
85  gout = geometry_serialize(lwout);
86  lwgeom_free(lwout);
87 
88  PG_RETURN_POINTER(gout);
89 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1050
LWGEOM * lwgeom_locate_along(const LWGEOM *lwin, double m, double offset)
Determine the location(s) along a measured line where m occurs and return as a multipoint.
GSERIALIZED * geometry_serialize(LWGEOM *lwgeom)
Here is the call graph for this function:
Here is the caller graph for this function: