[Groonga-commit] groonga/groonga at 7d4db6f [master] geo: don't accept +180/-180 longitude because it is same as 0 longitude

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Dec 8 19:31:01 JST 2013


Kouhei Sutou	2013-12-08 19:31:01 +0900 (Sun, 08 Dec 2013)

  New Revision: 7d4db6fb2562542712abe656bbcf5b0e4ceb2841
  https://github.com/groonga/groonga/commit/7d4db6fb2562542712abe656bbcf5b0e4ceb2841

  Message:
    geo: don't accept +180/-180 longitude because it is same as 0 longitude
    
    It is an incompatible change but it will be not a problem. Because
    +180/-180 can be replaced with 0 systematically.

  Modified files:
    lib/geo.h
    test/command/suite/load/geo_point/scalar/max_longitude.expected
    test/command/suite/load/geo_point/scalar/max_longitude.test
    test/command/suite/load/geo_point/scalar/min_longitude.expected
    test/command/suite/load/geo_point/scalar/min_longitude.test
    test/command/suite/load/invalid/geo_point/too_large_longitude.expected
    test/command/suite/load/invalid/geo_point/too_large_longitude.test
    test/command/suite/load/invalid/geo_point/too_small_longitude.expected
    test/command/suite/load/invalid/geo_point/too_small_longitude.test

  Modified: lib/geo.h (+2 -2)
===================================================================
--- lib/geo.h    2013-12-08 19:24:50 +0900 (5093d56)
+++ lib/geo.h    2013-12-08 19:31:01 +0900 (a5aedf8)
@@ -44,8 +44,8 @@ extern "C" {
 #define GRN_GEO_INT2RAD(x)   ((M_PI / (GRN_GEO_RESOLUTION * 180)) * (x))
 #define GRN_GEO_RAD2INT(x)   ((int)(((GRN_GEO_RESOLUTION * 180) / M_PI) * (x)))
 
-#define GRN_GEO_MAX_LATITUDE  324000000 /*  90 * 60 * 60 * 1000 */
-#define GRN_GEO_MAX_LONGITUDE 648000000 /* 180 * 60 * 60 * 1000 */
+#define GRN_GEO_MAX_LATITUDE  324000000       /*  90 * 60 * 60 * 1000 */
+#define GRN_GEO_MAX_LONGITUDE (648000000 - 1) /* 180 * 60 * 60 * 1000 - 1 */
 #define GRN_GEO_MIN_LATITUDE  -GRN_GEO_MAX_LATITUDE
 #define GRN_GEO_MIN_LONGITUDE -GRN_GEO_MAX_LONGITUDE
 

  Modified: test/command/suite/load/geo_point/scalar/max_longitude.expected (+2 -2)
===================================================================
--- test/command/suite/load/geo_point/scalar/max_longitude.expected    2013-12-08 19:24:50 +0900 (bb90653)
+++ test/command/suite/load/geo_point/scalar/max_longitude.expected    2013-12-08 19:31:01 +0900 (51052e5)
@@ -4,7 +4,7 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 [[0,0.0,0.0],true]
 load --table LandMarks
 [
-{"location": "128514964x648000000"}
+{"location": "128514964x647999999"}
 ]
 [[0,0.0,0.0],1]
 select LandMarks
@@ -31,7 +31,7 @@ select LandMarks
       ],
       [
         1,
-        "128514964x648000000"
+        "128514964x647999999"
       ]
     ]
   ]

  Modified: test/command/suite/load/geo_point/scalar/max_longitude.test (+1 -1)
===================================================================
--- test/command/suite/load/geo_point/scalar/max_longitude.test    2013-12-08 19:24:50 +0900 (e930ac9)
+++ test/command/suite/load/geo_point/scalar/max_longitude.test    2013-12-08 19:31:01 +0900 (57574ad)
@@ -3,7 +3,7 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 
 load --table LandMarks
 [
-{"location": "128514964x648000000"}
+{"location": "128514964x647999999"}
 ]
 
 select LandMarks

  Modified: test/command/suite/load/geo_point/scalar/min_longitude.expected (+2 -2)
===================================================================
--- test/command/suite/load/geo_point/scalar/min_longitude.expected    2013-12-08 19:24:50 +0900 (d8269f2)
+++ test/command/suite/load/geo_point/scalar/min_longitude.expected    2013-12-08 19:31:01 +0900 (f3ddb91)
@@ -4,7 +4,7 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 [[0,0.0,0.0],true]
 load --table LandMarks
 [
-{"location": "128514964x-648000000"}
+{"location": "128514964x-647999999"}
 ]
 [[0,0.0,0.0],1]
 select LandMarks
@@ -31,7 +31,7 @@ select LandMarks
       ],
       [
         1,
-        "128514964x-648000000"
+        "128514964x-647999999"
       ]
     ]
   ]

  Modified: test/command/suite/load/geo_point/scalar/min_longitude.test (+1 -1)
===================================================================
--- test/command/suite/load/geo_point/scalar/min_longitude.test    2013-12-08 19:24:50 +0900 (dd7d03c)
+++ test/command/suite/load/geo_point/scalar/min_longitude.test    2013-12-08 19:31:01 +0900 (b0b2707)
@@ -3,7 +3,7 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 
 load --table LandMarks
 [
-{"location": "128514964x-648000000"}
+{"location": "128514964x-647999999"}
 ]
 
 select LandMarks

  Modified: test/command/suite/load/invalid/geo_point/too_large_longitude.expected (+3 -3)
===================================================================
--- test/command/suite/load/invalid/geo_point/too_large_longitude.expected    2013-12-08 19:24:50 +0900 (692ff6e)
+++ test/command/suite/load/invalid/geo_point/too_large_longitude.expected    2013-12-08 19:31:01 +0900 (e217c92)
@@ -4,10 +4,10 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 [[0,0.0,0.0],true]
 load --table LandMarks
 [
-{"location": "1x648000001"}
+{"location": "1x648000000"}
 ]
 [[0,0.0,0.0],1]
-#|e| <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x648000001">
-#|e| [table][load] failed to set column value: <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x648000001">: key: <(NULL)>, column: <location>, value: <"1x648000001">
+#|e| <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x648000000">
+#|e| [table][load] failed to set column value: <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x648000000">: key: <(NULL)>, column: <location>, value: <"1x648000000">
 select LandMarks
 [[0,0.0,0.0],[[[1],[["_id","UInt32"],["location","WGS84GeoPoint"]],[1,"0x0"]]]]

  Modified: test/command/suite/load/invalid/geo_point/too_large_longitude.test (+1 -1)
===================================================================
--- test/command/suite/load/invalid/geo_point/too_large_longitude.test    2013-12-08 19:24:50 +0900 (55a5edc)
+++ test/command/suite/load/invalid/geo_point/too_large_longitude.test    2013-12-08 19:31:01 +0900 (3c0d908)
@@ -3,7 +3,7 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 
 load --table LandMarks
 [
-{"location": "1x648000001"}
+{"location": "1x648000000"}
 ]
 
 select LandMarks

  Modified: test/command/suite/load/invalid/geo_point/too_small_longitude.expected (+3 -3)
===================================================================
--- test/command/suite/load/invalid/geo_point/too_small_longitude.expected    2013-12-08 19:24:50 +0900 (c036851)
+++ test/command/suite/load/invalid/geo_point/too_small_longitude.expected    2013-12-08 19:31:01 +0900 (037f721)
@@ -4,10 +4,10 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 [[0,0.0,0.0],true]
 load --table LandMarks
 [
-{"location": "1x-648000001"}
+{"location": "1x-648000000"}
 ]
 [[0,0.0,0.0],1]
-#|e| <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x-648000001">
-#|e| [table][load] failed to set column value: <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x-648000001">: key: <(NULL)>, column: <location>, value: <"1x-648000001">
+#|e| <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x-648000000">
+#|e| [table][load] failed to set column value: <LandMarks.location>: failed to cast to <WGS84GeoPoint>: <"1x-648000000">: key: <(NULL)>, column: <location>, value: <"1x-648000000">
 select LandMarks
 [[0,0.0,0.0],[[[1],[["_id","UInt32"],["location","WGS84GeoPoint"]],[1,"0x0"]]]]

  Modified: test/command/suite/load/invalid/geo_point/too_small_longitude.test (+1 -1)
===================================================================
--- test/command/suite/load/invalid/geo_point/too_small_longitude.test    2013-12-08 19:24:50 +0900 (10440ef)
+++ test/command/suite/load/invalid/geo_point/too_small_longitude.test    2013-12-08 19:31:01 +0900 (2a70731)
@@ -3,7 +3,7 @@ column_create LandMarks location COLUMN_SCALAR WGS84GeoPoint
 
 load --table LandMarks
 [
-{"location": "1x-648000001"}
+{"location": "1x-648000000"}
 ]
 
 select LandMarks
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index