[Groonga-commit] groonga/groonga [master] geo: return the value of correct distance according to quadrant type

Back to archive index

null+****@clear***** null+****@clear*****
2012年 7月 5日 (木) 18:39:12 JST


HAYASHI Kentaro	2012-07-05 18:39:12 +0900 (Thu, 05 Jul 2012)

  New Revision: 63e799b177ec1fd2c25bf227fe8a8bbefa5640eb
  https://github.com/groonga/groonga/commit/63e799b177ec1fd2c25bf227fe8a8bbefa5640eb

  Log:
    geo: return the value of correct distance according to quadrant type
    
    Add missing support for calculating distance between 4th quadrant and
    3rd one across meridian.
    
    refs #1419

  Modified files:
    lib/geo.c

  Modified: lib/geo.c (+3 -0)
===================================================================
--- lib/geo.c    2012-07-05 18:32:58 +0900 (a227aa6)
+++ lib/geo.c    2012-07-05 18:39:12 +0900 (b4dbe4c)
@@ -1899,6 +1899,9 @@ geo_quadrant_type(grn_geo_point *point1, grn_geo_point *point2)
     } else if (point1->longitude < 0 && point2->longitude > 0 &&
                point1->latitude <= 0 && point2->latitude <= 0) {
       return QUADRANT_3RD_TO_4TH;
+    } else if (point1->longitude > 0 && point2->longitude < 0 &&
+               point1->latitude <= 0 && point2->latitude <= 0) {
+      return QUADRANT_4TH_TO_3RD;
     } else {
       /* FIXME */
       return QUADRANT_1ST;
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
Descargar 



Groonga-commit メーリングリストの案内
Back to archive index