PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ ST_LocateAlong()

Datum ST_LocateAlong ( PG_FUNCTION_ARGS  )

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

83 {
84  GSERIALIZED *gin = PG_GETARG_GSERIALIZED_P(0);
85  GSERIALIZED *gout;
86  LWGEOM *lwin = NULL, *lwout = NULL;
87  double measure = PG_GETARG_FLOAT8(1);
88  double offset = PG_GETARG_FLOAT8(2);;
89 
90  lwin = lwgeom_from_gserialized(gin);
91  lwout = lwgeom_locate_along(lwin, measure, offset);
92  lwgeom_free(lwin);
93  PG_FREE_IF_COPY(gin, 0);
94 
95  if ( ! lwout )
96  PG_RETURN_NULL();
97 
98  gout = geometry_serialize(lwout);
99  lwgeom_free(lwout);
100 
101  PG_RETURN_POINTER(gout);
102 }
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
Definition: lwgeom.c:1099
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: