[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月 9日 (月) 14:51:31 JST


HAYASHI Kentaro	2012-07-09 14:51:31 +0900 (Mon, 09 Jul 2012)

  New Revision: b88443807df103ae729211e8e3463d9d9594e5e8
  https://github.com/groonga/groonga/commit/b88443807df103ae729211e8e3463d9d9594e5e8

  Log:
    geo: return the value of correct distance according to quadrant type
    
    Support to calculate the value of distance across the date line in
    south hemisphere.
    
    refs #1420

  Modified files:
    lib/geo.c

  Modified: lib/geo.c (+2 -1)
===================================================================
--- lib/geo.c    2012-07-09 13:57:21 +0900 (b4dbe4c)
+++ lib/geo.c    2012-07-09 14:51:31 +0900 (a6ee216)
@@ -1981,7 +1981,8 @@ grn_geo_distance_rectangle_raw(grn_ctx *ctx,
                                                            M_PI,
                                                            intercept_edge);
         distance = (east_distance + west_distance) * GRN_GEO_RADIUS;
-      } else if (quad_type == QUADRANT_2ND_TO_1ST) {
+      } else if (quad_type == QUADRANT_2ND_TO_1ST || 
+                 quad_type == QUADRANT_3RD_TO_4TH) {
         longitude_delta = lng1 + M_2PI - lng2;
         latitude_delta = lat1 - lat2;
         slope = latitude_delta / longitude_delta;
-------------- next part --------------
HTML$B$NE:IU%U%!%$%k$rJ]4I$7$^$7$?(B...
下载 



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