• R/O
  • SSH
  • HTTPS

autocoast: Commit


Commit MetaInfo

Revision164 (tree)
Time2004-12-04 00:02:11
Authortmurakam

Log Message

bug fix for west hemisphere.

Change Summary

Incremental Difference

--- src/trunk/lib/cell.cpp (revision 163)
+++ src/trunk/lib/cell.cpp (revision 164)
@@ -52,7 +52,10 @@
5252 // Convert coordinates
5353 double Cell::x2lon(int u)
5454 {
55- return u * 360.0 / 768.0 - 180.0;
55+ double lon = u * 360.0 / 768.0 - 180.0;
56+ if (lon < 0) lon += 360.0; // 0 to 360
57+
58+ return lon;
5659 }
5760
5861 int Cell::lon2x(double lon)
@@ -78,6 +81,7 @@
7881
7982 bbox.xmin = x2lon(x);
8083 bbox.xmax = x2lon(x+1);
84+ if (bbox.xmax == 0.0) bbox.xmax = 360.0;
8185
8286 bbox.ymax = y2lat(y);
8387 bbox.ymin = y2lat(y+1);
Show on old repository browser