912 uint32_t type1, type2;
915 g1 = (
GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
916 g2 = (
GSERIALIZED*)PG_DETOAST_DATUM(PG_GETARG_DATUM(1));
923 elog(ERROR,
"ST_Azimuth(geography, geography) is only valid for point inputs");
935 elog(ERROR,
"ST_Azimuth(geography, geography) cannot work with empty points");
949 PG_FREE_IF_COPY(g1, 0);
950 PG_FREE_IF_COPY(g2, 1);
958 PG_RETURN_FLOAT8(azimuth);
uint32_t gserialized_get_type(const GSERIALIZED *s)
Extract the geometry type from the serialized form (it hides in the anonymous data area...
double lwgeom_azumith_spheroid(const LWPOINT *r, const LWPOINT *s, const SPHEROID *spheroid)
Calculate the bearing between two points on a spheroid.
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members) ...
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)...