1287{
1289 double distance_fraction = PG_GETARG_FLOAT8(1);
1290
1291 bool use_spheroid = PG_GETARG_BOOL(2);
1292
1293 bool repeat = (PG_NARGS() > 3) && PG_GETARG_BOOL(3);
1298
1299
1301 {
1302 PG_FREE_IF_COPY(gs, 0);
1303 PG_RETURN_NULL();
1304 }
1305
1306 if ( distance_fraction < 0 || distance_fraction > 1 )
1307 {
1308 elog(ERROR,"%s: second arg is not within [0,1]", __func__);
1309 PG_FREE_IF_COPY(gs, 0);
1310 PG_RETURN_NULL();
1311 }
1312
1314 if ( !lwline )
1315 {
1316 elog(ERROR,"%s: first arg is not a line", __func__);
1317 PG_FREE_IF_COPY(gs, 0);
1318 PG_RETURN_NULL();
1319 }
1320
1321
1323
1324
1325 if ( ! use_spheroid )
1326 s.a =
s.b =
s.radius;
1327
1329
1331 PG_FREE_IF_COPY(gs, 0);
1332
1334 result = geography_serialize(lwresult);
1336
1337 PG_RETURN_POINTER(
result);
1338}
char result[OUT_DOUBLE_BUFFER_SIZE]
int32_t gserialized_get_srid(const GSERIALIZED *g)
Extract the SRID from the serialized form (it is packed into three bytes so this is a handy function)...
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
int gserialized_is_empty(const GSERIALIZED *g)
Check if a GSERIALIZED is empty without deserializing first.
void lwgeom_set_geodetic(LWGEOM *geom, int value)
Set the FLAGS geodetic bit on geometry an all sub-geometries and pointlists.
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwline_as_lwgeom(const LWLINE *obj)
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
LWGEOM * geography_interpolate_points(const LWLINE *line, double length_fraction, const SPHEROID *s, char repeat)
Interpolate a point along a geographic line.