1105{
1110 double azimuth;
1112 uint32_t type1, type2;
1113
1114
1118 {
1119 elog(ERROR, "ST_Azimuth(geography, geography) is only valid for point inputs");
1120 PG_RETURN_NULL();
1121 }
1122
1125
1126
1128 {
1131 elog(ERROR, "ST_Azimuth(geography, geography) cannot work with empty points");
1132 PG_RETURN_NULL();
1133 }
1134
1135
1137
1138
1140
1141
1144
1145 PG_FREE_IF_COPY(g1, 0);
1146 PG_FREE_IF_COPY(g2, 1);
1147
1148
1149 if( !isfinite(azimuth) )
1150 {
1151 PG_RETURN_NULL();
1152 }
1153
1154 PG_RETURN_FLOAT8(azimuth);
1155}
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,...
void lwgeom_free(LWGEOM *geom)
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
double lwgeom_azumith_spheroid(const LWPOINT *r, const LWPOINT *s, const SPHEROID *spheroid)
Calculate the bearing between two points on a spheroid.
static LWPOINT * lwgeom_as_lwpoint(const LWGEOM *lwgeom)
static int lwgeom_is_empty(const LWGEOM *geom)
Return true or false depending on whether a geometry is an "empty" geometry (no vertices members)