|
@@ -56,7 +56,9 @@ long calc_solar_position(double longitude, double latitude, double timezone,
|
|
|
long retval; /* to capture S_solpos return codes */
|
|
|
struct Key_Value *in_proj_info, *in_unit_info; /* projection information of input map */
|
|
|
struct pj_info iproj; /* input map proj parameters */
|
|
|
+#ifndef HAVE_PROJ_H
|
|
|
struct pj_info oproj; /* output map proj parameters */
|
|
|
+#endif
|
|
|
extern struct Cell_head window;
|
|
|
int inside;
|
|
|
|
|
@@ -113,17 +115,21 @@ long calc_solar_position(double longitude, double latitude, double timezone,
|
|
|
G_debug(1, "IN coord: longitude: %f, latitude: %f", longitude,
|
|
|
latitude);
|
|
|
/* see src/include/projects.h, struct PJconsts */
|
|
|
-
|
|
|
+#ifndef HAVE_PROJ_H
|
|
|
/* set output projection to lat/long for solpos */
|
|
|
oproj.zone = 0;
|
|
|
oproj.meters = 1.;
|
|
|
sprintf(oproj.proj, "ll");
|
|
|
if ((oproj.pj = pj_latlong_from_proj(iproj.pj)) == NULL)
|
|
|
G_fatal_error("Unable to set up lat/long projection parameters");
|
|
|
-
|
|
|
+#endif
|
|
|
/* XX do the transform
|
|
|
* outx outy in_info out_info */
|
|
|
+#ifdef HAVE_PROJ_H
|
|
|
+ if (GPJ_do_proj_ll(&longitude, &latitude, &iproj, PJ_INV) < 0) {
|
|
|
+#else
|
|
|
if (pj_do_proj(&longitude, &latitude, &iproj, &oproj) < 0) {
|
|
|
+#endif
|
|
|
G_fatal_error(_("Error in pj_do_proj (projection of input coordinate pair)"));
|
|
|
}
|
|
|
|