985 double azimuth = 0.0;
991 if ( PG_NARGS() < 2 || PG_ARGISNULL(0) || PG_ARGISNULL(1) )
995 g = PG_GETARG_GSERIALIZED_P(0);
1001 elog(ERROR,
"ST_Project(geography) is only valid for point inputs");
1012 elog(ERROR,
"ST_Project(geography) cannot project from an empty start point");
1016 if ( PG_NARGS() > 2 && ! PG_ARGISNULL(2) )
1017 azimuth = PG_GETARG_FLOAT8(2);
1025 PG_RETURN_POINTER(g);
1032 if ( lwp_projected == NULL )
1034 elog(ERROR,
"lwgeom_project_spheroid returned null");
1043 PG_FREE_IF_COPY(g, 0);
1044 PG_RETURN_POINTER(g_out);
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.
uint32_t gserialized_get_type(const GSERIALIZED *g)
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.
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
static double distance(double x1, double y1, double x2, double y2)