Skip to content

Commit

Permalink
geo: return the value of correct distance according to quadrant type
Browse files Browse the repository at this point in the history
Add missing support for calculating distance between 3rd quadrant and
4th one across meridian.

refs #1418
  • Loading branch information
kenhys committed Jul 3, 2012
1 parent 39f532f commit b046ec7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/geo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1896,6 +1896,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_2ND_TO_1ST;
} else if (point1->longitude < 0 && point2->longitude > 0 &&
point1->latitude <= 0 && point2->latitude <= 0) {
return QUADRANT_3RD_TO_4TH;
} else {
/* FIXME */
return QUADRANT_1ST;
Expand Down

0 comments on commit b046ec7

Please sign in to comment.