1347{
1350 bool use_spheroid = PG_GETARG_BOOL(2);
1357 double ret;
1358
1360
1361
1363 {
1364 PG_FREE_IF_COPY(gs1, 0);
1365 PG_FREE_IF_COPY(gs2, 1);
1366 PG_RETURN_NULL();
1367 }
1368
1370 {
1371 elog(ERROR,"%s: 1st arg is not a line", __func__);
1372 PG_RETURN_NULL();
1373 }
1375 {
1376 elog(ERROR,"%s: 2nd arg is not a point", __func__);
1377 PG_RETURN_NULL();
1378 }
1379
1380
1381 if ( ! use_spheroid ) {
1382 s.a =
s.b =
s.radius;
1383 }
1384 else {
1385
1387 }
1388
1391
1394
1396
1397 PG_RETURN_FLOAT8(ret);
1398}
void gserialized_error_if_srid_mismatch(const GSERIALIZED *g1, const GSERIALIZED *g2, const char *funcname)
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.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
int lwpoint_getPoint4d_p(const LWPOINT *point, POINT4D *out)
double ptarray_locate_point_spheroid(const POINTARRAY *pa, const POINT4D *p4d, const SPHEROID *s, double tolerance, double *mindistout, POINT4D *proj4d)
Locate a point along the point array defining a geographic line.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
LWLINE * lwgeom_as_lwline(const LWGEOM *lwgeom)
#define FP_TOLERANCE
Floating point comparators.
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)