937 double azimuth = 0.0;
943 if ( PG_NARGS() < 2 || PG_ARGISNULL(0) || PG_ARGISNULL(1) )
947 g = PG_GETARG_GSERIALIZED_P(0);
953 elog(ERROR,
"ST_Project(geography) is only valid for point inputs");
964 elog(ERROR,
"ST_Project(geography) cannot project from an empty start point");
968 if ( PG_NARGS() > 2 && ! PG_ARGISNULL(2) )
969 azimuth = PG_GETARG_FLOAT8(2);
977 PG_RETURN_POINTER(g);
984 if ( lwp_projected == NULL )
986 elog(ERROR,
"lwgeom_project_spheroid returned null");
995 PG_FREE_IF_COPY(g, 0);
996 PG_RETURN_POINTER(g_out);
int32_t gserialized_get_srid(const GSERIALIZED *s)
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.
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
LWPOINT * lwgeom_project_spheroid(const LWPOINT *r, const SPHEROID *spheroid, double distance, double azimuth)
Calculate the location of a point on a spheroid, give a start point, bearing and distance.
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
Datum distance(PG_FUNCTION_ARGS)