Kouhei Sutou
null+****@clear*****
Wed May 1 19:17:28 JST 2013
Kouhei Sutou 2013-05-01 19:17:28 +0900 (Wed, 01 May 2013) New Revision: 1cd68ffb8226fd2d20f271c141fae0e37794a516 https://github.com/groonga/groonga/commit/1cd68ffb8226fd2d20f271c141fae0e37794a516 Message: Support geo_in_circle(_key, ...) Reported by @ceekz. Thanks!!! Added files: test/command/suite/geo/in_circle/key.expected test/command/suite/geo/in_circle/key.test Modified files: lib/db.c Modified: lib/db.c (+2 -0) =================================================================== --- lib/db.c 2013-04-30 17:46:07 +0900 (f46670a) +++ lib/db.c 2013-05-01 19:17:28 +0900 (d9a62a2) @@ -8321,6 +8321,7 @@ grn_column_index_accessor(grn_ctx *ctx, grn_obj *obj, grn_operator op, case GRN_OP_GREATER : case GRN_OP_LESS_EQUAL : case GRN_OP_GREATER_EQUAL : + case GRN_OP_CALL : is_valid_index = is_valid_range_index(ctx, target); break; default : @@ -8418,6 +8419,7 @@ grn_column_index(grn_ctx *ctx, grn_obj *obj, grn_operator op, case GRN_OP_GREATER : case GRN_OP_LESS_EQUAL : case GRN_OP_GREATER_EQUAL : + case GRN_OP_CALL : n = grn_column_index_accessor(ctx, obj, op, indexbuf, buf_size, section); break; default : Added: test/command/suite/geo/in_circle/key.expected (+57 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/geo/in_circle/key.expected 2013-05-01 19:17:28 +0900 (a3fa1db) @@ -0,0 +1,57 @@ +table_create area TABLE_PAT_KEY WGS84GeoPoint +[[0,0.0,0.0],true] +column_create area index COLUMN_INDEX area _key +[[0,0.0,0.0],true] +load --table area +[ +{"_key": "128592911x503145263"}, +{"_key": "128565076x502976128"}, +{"_key": "128461363x502772717"}, +{"_key": "128597458x502942345"}, +{"_key": "128573438x502868189"} +] +[[0,0.0,0.0],5] +select area --filter 'geo_in_circle(_key, "128575000x502960000", 3000)' +[ + [ + 0, + 0.0, + 0.0 + ], + [ + [ + [ + 3 + ], + [ + [ + "_id", + "UInt32" + ], + [ + "_key", + "WGS84GeoPoint" + ], + [ + "index", + "area" + ] + ], + [ + 5, + "128573438x502868189", + 1 + ], + [ + 2, + "128565076x502976128", + 1 + ], + [ + 4, + "128597458x502942345", + 1 + ] + ] + ] +] Added: test/command/suite/geo/in_circle/key.test (+13 -0) 100644 =================================================================== --- /dev/null +++ test/command/suite/geo/in_circle/key.test 2013-05-01 19:17:28 +0900 (70e7f0e) @@ -0,0 +1,13 @@ +table_create area TABLE_PAT_KEY WGS84GeoPoint +column_create area index COLUMN_INDEX area _key + +load --table area +[ +{"_key": "128592911x503145263"}, +{"_key": "128565076x502976128"}, +{"_key": "128461363x502772717"}, +{"_key": "128597458x502942345"}, +{"_key": "128573438x502868189"} +] + +select area --filter 'geo_in_circle(_key, "128575000x502960000", 3000)' -------------- next part -------------- HTML����������������������������... Télécharger