1033{
1034 LWGEOM *lwgeom1, *lwgeom2;
1039
1040
1041 g1 = PG_GETARG_GSERIALIZED_P(0);
1042 g2 = PG_GETARG_GSERIALIZED_P(1);
1043
1046 {
1047 elog(ERROR, "ST_Project(geography) is only valid for point inputs");
1048 PG_RETURN_NULL();
1049 }
1050
1052
1053
1055 {
1056 PG_RETURN_POINTER(g2);
1057 }
1058
1061
1062
1064 {
1067 elog(ERROR, "ST_Project(geography) cannot project from an empty point");
1068 PG_RETURN_NULL();
1069 }
1070
1071
1073
1074
1078
1079
1080 if ( lwp3 == NULL )
1081 {
1082 elog(ERROR, "lwgeom_project_spheroid_lwpoint returned null");
1083 PG_RETURN_NULL();
1084 }
1085
1086
1091
1092 PG_FREE_IF_COPY(g1, 0);
1093 PG_FREE_IF_COPY(g2, 1);
1094 PG_RETURN_POINTER(g3);
1095}
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,...
LWGEOM * lwpoint_as_lwgeom(const LWPOINT *obj)
int32_t lwgeom_get_srid(const LWGEOM *geom)
Return SRID number.
void lwpoint_free(LWPOINT *pt)
void lwgeom_free(LWGEOM *geom)
LWPOINT * lwgeom_project_spheroid_lwpoint(const LWPOINT *from, const LWPOINT *to, const SPHEROID *spheroid, double distance)
Calculate the location of a point on a spheroid, give a start point, end point and distance.
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
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)
static double distance(double x1, double y1, double x2, double y2)