229{
232 double distance = PG_GETARG_FLOAT8(1);
236
237 if (distance < 0 || distance > 1)
238 {
239 elog(ERROR, "line_interpolate_point: 2nd arg isn't within [0,1]");
240 PG_RETURN_NULL();
241 }
242
244 {
245 elog(ERROR, "line_interpolate_point: 1st arg isn't a line");
246 PG_RETURN_NULL();
247 }
248
251
253
255 PG_FREE_IF_COPY(gser, 0);
256
259
260 PG_RETURN_POINTER(
result);
261}
char result[OUT_DOUBLE_BUFFER_SIZE]
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
LWPOINT * lwline_interpolate_point_3d(const LWLINE *line, double distance)
Interpolate one point along a line in 3D.
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
static double distance(double x1, double y1, double x2, double y2)