[GRASS-SVN] r72431 - grass/trunk/raster/r.sun
svn_grass at osgeo.org
svn_grass at osgeo.org
Tue Mar 20 11:51:07 PDT 2018
Author: mmetz
Date: 2018-03-20 11:51:07 -0700 (Tue, 20 Mar 2018)
New Revision: 72431
Modified:
grass/trunk/raster/r.sun/main.c
Log:
r.sun: use new PROJ 5+ API if available
Modified: grass/trunk/raster/r.sun/main.c
===================================================================
--- grass/trunk/raster/r.sun/main.c 2018-03-20 18:50:29 UTC (rev 72430)
+++ grass/trunk/raster/r.sun/main.c 2018-03-20 18:51:07 UTC (rev 72431)
@@ -110,7 +110,9 @@
struct Cell_head cellhd;
struct pj_info iproj;
+#ifndef HAVE_PROJ_H
struct pj_info oproj;
+#endif
struct History hist;
@@ -789,7 +791,7 @@
G_free_key_value(in_proj_info);
G_free_key_value(in_unit_info);
-
+#ifndef HAVE_PROJ_H
/* Set output projection to latlong w/ same ellipsoid */
oproj.zone = 0;
oproj.meters = 1.;
@@ -796,6 +798,7 @@
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
}
if ((latin != NULL || longin != NULL) && (G_projection() == PROJECTION_LL))
@@ -1693,7 +1696,7 @@
double dayRad;
double latid_l, cos_u, cos_v, sin_u, sin_v;
double sin_phi_l, tan_lam_l;
- double zmax;
+ double zmax = 0;
double longitTime = 0.;
double locTimeOffset;
double latitude, longitude;
@@ -1891,7 +1894,11 @@
longitude = gridGeom.xp;
latitude = gridGeom.yp;
+#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");
}
More information about the grass-commit
mailing list