238 double distance = PG_GETARG_FLOAT8(1);
243 if (distance < 0 || distance > 1)
245 elog(ERROR,
"line_interpolate_point: 2nd arg isn't within [0,1]");
251 elog(ERROR,
"line_interpolate_point: 1st arg isn't a line");
261 PG_FREE_IF_COPY(gser, 0);
266 PG_RETURN_POINTER(
result);
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,...
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWPOINT * lwline_interpolate_point_3d(const LWLINE *line, double distance)
Interpolate one point along a line in 3D.
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
static double distance(double x1, double y1, double x2, double y2)