[Groonga-commit] groonga/groonga at 02b3b3b [master] geo_in_rectangle: support north area

Back to archive index

Kouhei Sutou null+****@clear*****
Sun Dec 8 18:32:02 JST 2013


Kouhei Sutou	2013-12-08 18:32:02 +0900 (Sun, 08 Dec 2013)

  New Revision: 02b3b3b870062d0b367ae7d1f7e5aa3198aa231a
  https://github.com/groonga/groonga/commit/02b3b3b870062d0b367ae7d1f7e5aa3198aa231a

  Message:
    geo_in_rectangle: support north area
    
    TODO: Support from 45 over longitude to -45 over longitude case.
    
    Supported case:
    
        |   A<-->B   |
    
    Not supported case:
    
        |<--A    B-->|

  Added files:
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/all_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/all_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_west_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_west_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_east_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_east_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_south_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_south_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_west_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_west_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/same_as_mesh.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/same_as_mesh.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_east_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_east_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_west_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_west_out.test
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/west_out.expected
    test/command/suite/select/filter/geo_in_rectangle/north/use_index/west_out.test
  Modified files:
    lib/geo.c
    lib/geo.h

  Modified: lib/geo.c (+171 -41)
===================================================================
--- lib/geo.c    2013-12-08 13:46:04 +0900 (eb0e8bd)
+++ lib/geo.c    2013-12-08 18:32:02 +0900 (11ce32c)
@@ -22,6 +22,15 @@
 #include <string.h>
 #include <stdlib.h>
 
+#define GRN_GEO_IN_NORTH_EAST(point) \
+  ((point)->latitude >= 0 && (point)->longitude >= 0)
+#define GRN_GEO_IN_NORTH_WEST(point) \
+  ((point)->latitude >= 0 && (point)->longitude < 0)
+#define GRN_GEO_IN_SOUTH_WEST(point) \
+  ((point)->latitude < 0 && (point)->longitude < 0)
+#define GRN_GEO_IN_SOUTH_EAST(point) \
+  ((point)->latitude < 0 && (point)->longitude >= 0)
+
 typedef struct {
   grn_id id;
   double d;
@@ -39,11 +48,14 @@ typedef struct {
   grn_obj bottom_right_point_buffer;
   grn_geo_point *top_left;
   grn_geo_point *bottom_right;
+} in_rectangle_data;
+
+typedef struct {
   grn_geo_point min;
   grn_geo_point max;
   int rectangle_common_bit;
   uint8_t rectangle_common_key[sizeof(grn_geo_point)];
-} in_rectangle_data;
+} in_rectangle_area_data;
 
 static int
 compute_diff_bit(uint8_t *geo_key1, uint8_t *geo_key2)
@@ -1147,21 +1159,20 @@ in_rectangle_data_validate(grn_ctx *ctx,
 }
 
 static void
-in_rectangle_data_compute(grn_ctx *ctx, in_rectangle_data *data)
+in_rectangle_area_data_compute(grn_ctx *ctx,
+                               grn_geo_point *top_left,
+                               grn_geo_point *bottom_right,
+                               in_rectangle_area_data *data)
 {
   int latitude_distance, longitude_distance;
   int diff_bit;
   grn_geo_point base;
-  grn_geo_point *top_left, *bottom_right;
   grn_geo_point *geo_point_input;
   uint8_t geo_key_input[sizeof(grn_geo_point)];
   uint8_t geo_key_base[sizeof(grn_geo_point)];
   uint8_t geo_key_top_left[sizeof(grn_geo_point)];
   uint8_t geo_key_bottom_right[sizeof(grn_geo_point)];
 
-  top_left = data->top_left;
-  bottom_right = data->bottom_right;
-
   latitude_distance = top_left->latitude - bottom_right->latitude;
   longitude_distance = bottom_right->longitude - top_left->longitude;
   if (latitude_distance > longitude_distance) {
@@ -1225,11 +1236,6 @@ in_rectangle_data_prepare(grn_ctx *ctx, grn_obj *index,
     goto exit;
   }
 
-  in_rectangle_data_compute(ctx, data);
-  if (ctx->rc != GRN_SUCCESS) {
-    goto exit;
-  }
-
 exit :
   return ctx->rc;
 }
@@ -1272,6 +1278,120 @@ exit :
   ((((uint8_t *)(a))[((n_bit) / 8)] &\
     (1 << (7 - ((n_bit) % 8)))) >> (1 << (7 - ((n_bit) % 8))))
 
+static grn_bool
+extract_rectangle_in_area(grn_ctx *ctx,
+                          grn_geo_area_type area_type,
+                          const grn_geo_point *top_left,
+                          const grn_geo_point *bottom_right,
+                          grn_geo_point *area_top_left,
+                          grn_geo_point *area_bottom_right)
+{
+  grn_bool out_of_area = GRN_FALSE;
+
+  switch (area_type) {
+  case GRN_GEO_AREA_NORTH_EAST :
+    if (GRN_GEO_IN_NORTH_EAST(top_left) ||
+        GRN_GEO_IN_NORTH_EAST(bottom_right)) {
+      area_top_left->latitude      = MAX(top_left->latitude,      0);
+      area_top_left->longitude     = MAX(top_left->longitude,     0);
+      area_bottom_right->latitude  = MAX(bottom_right->latitude,  0);
+      area_bottom_right->longitude = MAX(bottom_right->longitude, 0);
+    } else {
+      out_of_area = GRN_TRUE;
+    }
+    break;
+  case GRN_GEO_AREA_NORTH_WEST :
+    if (GRN_GEO_IN_NORTH_WEST(top_left) ||
+        GRN_GEO_IN_NORTH_WEST(bottom_right)) {
+      area_top_left->latitude      = MAX(top_left->latitude,       0);
+      area_top_left->longitude     = MIN(top_left->longitude,     -1);
+      area_bottom_right->latitude  = MAX(bottom_right->latitude,   0);
+      area_bottom_right->longitude = MIN(bottom_right->longitude, -1);
+    } else {
+      out_of_area = GRN_TRUE;
+    }
+    break;
+  case GRN_GEO_AREA_SOUTH_WEST :
+    if (GRN_GEO_IN_SOUTH_WEST(top_left) ||
+        GRN_GEO_IN_SOUTH_WEST(bottom_right)) {
+      area_top_left->latitude      = MIN(top_left->latitude,      -1);
+      area_top_left->longitude     = MIN(top_left->longitude,     -1);
+      area_bottom_right->latitude  = MIN(bottom_right->latitude,  -1);
+      area_bottom_right->longitude = MIN(bottom_right->longitude, -1);
+    } else {
+      out_of_area = GRN_TRUE;
+    }
+    break;
+  case GRN_GEO_AREA_SOUTH_EAST :
+    if (GRN_GEO_IN_SOUTH_EAST(top_left) ||
+        GRN_GEO_IN_SOUTH_EAST(bottom_right)) {
+      area_top_left->latitude      = MIN(top_left->latitude,      -1);
+      area_top_left->longitude     = MAX(top_left->longitude,      0);
+      area_bottom_right->latitude  = MIN(bottom_right->latitude,  -1);
+      area_bottom_right->longitude = MAX(bottom_right->longitude,  0);
+    } else {
+      out_of_area = GRN_TRUE;
+    }
+    break;
+  default :
+    out_of_area = GRN_TRUE;
+    break;
+  }
+
+  return out_of_area;
+}
+
+static void
+grn_geo_cursor_area_init(grn_ctx *ctx,
+                         grn_geo_cursor_area *area,
+                         grn_geo_area_type area_type,
+                         const grn_geo_point *top_left,
+                         const grn_geo_point *bottom_right)
+{
+  grn_geo_point area_top_left, area_bottom_right;
+  in_rectangle_area_data data;
+  grn_geo_cursor_entry *entry;
+  grn_bool out_of_area;
+
+  out_of_area = extract_rectangle_in_area(ctx,
+                                          area_type,
+                                          top_left,
+                                          bottom_right,
+                                          &area_top_left,
+                                          &area_bottom_right);
+  if (out_of_area) {
+    area->current_entry = -1;
+    return;
+  }
+
+  area->current_entry = 0;
+  memcpy(&(area->top_left), &area_top_left, sizeof(grn_geo_point));
+  memcpy(&(area->bottom_right), &area_bottom_right, sizeof(grn_geo_point));
+  grn_gton(area->top_left_key, &area_top_left, sizeof(grn_geo_point));
+  grn_gton(area->bottom_right_key, &area_bottom_right, sizeof(grn_geo_point));
+
+  entry = &(area->entries[area->current_entry]);
+  in_rectangle_area_data_compute(ctx,
+                                 &area_top_left,
+                                 &area_bottom_right,
+                                 &data);
+  entry->target_bit = data.rectangle_common_bit;
+  memcpy(entry->key, data.rectangle_common_key, sizeof(grn_geo_point));
+  entry->status_flags =
+    GRN_GEO_CURSOR_ENTRY_STATUS_TOP_INCLUDED |
+    GRN_GEO_CURSOR_ENTRY_STATUS_BOTTOM_INCLUDED |
+    GRN_GEO_CURSOR_ENTRY_STATUS_LEFT_INCLUDED |
+    GRN_GEO_CURSOR_ENTRY_STATUS_RIGHT_INCLUDED;
+  if (data.min.latitude == area_bottom_right.latitude &&
+      data.max.latitude == area_top_left.latitude) {
+    entry->status_flags |= GRN_GEO_CURSOR_ENTRY_STATUS_LATITUDE_INNER;
+  }
+  if (data.min.longitude == area_top_left.longitude &&
+      data.max.longitude == area_bottom_right.longitude) {
+    entry->status_flags |= GRN_GEO_CURSOR_ENTRY_STATUS_LONGITUDE_INNER;
+  }
+}
+
 grn_obj *
 grn_geo_cursor_open_in_rectangle(grn_ctx *ctx,
                                  grn_obj *index,
@@ -1302,32 +1422,21 @@ grn_geo_cursor_open_in_rectangle(grn_ctx *ctx,
   cursor->index = index;
   memcpy(&(cursor->top_left), data.top_left, sizeof(grn_geo_point));
   memcpy(&(cursor->bottom_right), data.bottom_right, sizeof(grn_geo_point));
-  grn_gton(cursor->top_left_key, data.top_left, sizeof(grn_geo_point));
-  grn_gton(cursor->bottom_right_key, data.bottom_right, sizeof(grn_geo_point));
   cursor->pat_cursor = NULL;
   cursor->ii_cursor = NULL;
   cursor->offset = offset;
   cursor->rest = limit;
 
-  cursor->current_entry = 0;
+  cursor->current_area = GRN_GEO_AREA_NORTH_EAST;
   {
-    grn_geo_cursor_entry *entry;
-
-    entry = &(cursor->entries[cursor->current_entry]);
-    entry->target_bit = data.rectangle_common_bit;
-    memcpy(entry->key, data.rectangle_common_key, sizeof(grn_geo_point));
-    entry->status_flags =
-      GRN_GEO_CURSOR_ENTRY_STATUS_TOP_INCLUDED |
-      GRN_GEO_CURSOR_ENTRY_STATUS_BOTTOM_INCLUDED |
-      GRN_GEO_CURSOR_ENTRY_STATUS_LEFT_INCLUDED |
-      GRN_GEO_CURSOR_ENTRY_STATUS_RIGHT_INCLUDED;
-    if (data.min.latitude == data.bottom_right->latitude &&
-        data.max.latitude == data.top_left->latitude) {
-      entry->status_flags |= GRN_GEO_CURSOR_ENTRY_STATUS_LATITUDE_INNER;
-    }
-    if (data.min.longitude == data.top_left->longitude &&
-        data.max.longitude == data.bottom_right->longitude) {
-      entry->status_flags |= GRN_GEO_CURSOR_ENTRY_STATUS_LONGITUDE_INNER;
+    grn_geo_area_type area_type;
+    const grn_geo_point *top_left = &(cursor->top_left);
+    const grn_geo_point *bottom_right = &(cursor->bottom_right);
+    for (area_type = GRN_GEO_AREA_NORTH_EAST;
+         area_type < GRN_GEO_AREA_LAST;
+         area_type++) {
+      grn_geo_cursor_area_init(ctx, &(cursor->areas[area_type]),
+                               area_type, top_left, bottom_right);
     }
   }
   {
@@ -1378,7 +1487,9 @@ grn_geo_cursor_entry_next_push(grn_ctx *ctx,
                                      GRN_CURSOR_PREFIX|GRN_CURSOR_SIZE_BY_BIT);
   if (pat_cursor) {
     if (grn_table_cursor_next(ctx, pat_cursor)) {
-      next_entry = &(cursor->entries[++cursor->current_entry]);
+      grn_geo_cursor_area *area;
+      area = &(cursor->areas[cursor->current_area]);
+      next_entry = &(area->entries[++area->current_entry]);
       memcpy(next_entry, entry, sizeof(grn_geo_cursor_entry));
       pushed = GRN_TRUE;
     }
@@ -1393,16 +1504,28 @@ grn_geo_cursor_entry_next(grn_ctx *ctx,
                           grn_geo_cursor_in_rectangle *cursor,
                           grn_geo_cursor_entry *entry)
 {
-  uint8_t *top_left_key = cursor->top_left_key;
-  uint8_t *bottom_right_key = cursor->bottom_right_key;
+  uint8_t *top_left_key;
+  uint8_t *bottom_right_key;
   int max_target_bit = GRN_GEO_KEY_MAX_BITS - cursor->minimum_reduce_bit;
+  grn_geo_cursor_area *area = NULL;
+
+  while (cursor->current_area < GRN_GEO_AREA_LAST) {
+    area = &(cursor->areas[cursor->current_area]);
+    if (area->current_entry >= 0) {
+      break;
+    }
+    cursor->current_area++;
+    area = NULL;
+  }
 
-  if (cursor->current_entry < 0) {
+  if (!area) {
     return GRN_FALSE;
   }
 
+  top_left_key = area->top_left_key;
+  bottom_right_key = area->bottom_right_key;
   memcpy(entry,
-         &(cursor->entries[cursor->current_entry--]),
+         &(area->entries[area->current_entry--]),
          sizeof(grn_geo_cursor_entry));
   while (GRN_TRUE) {
     grn_geo_cursor_entry next_entry0, next_entry1;
@@ -1581,9 +1704,9 @@ grn_geo_cursor_entry_next(grn_ctx *ctx,
 
       printf("%d: pushed\n", entry->target_bit);
       printf("stack:\n");
-      for (i = cursor->current_entry; i >= 0; i--) {
+      for (i = area->current_entry; i >= 0; i--) {
         grn_geo_cursor_entry *stack_entry;
-        stack_entry = &(cursor->entries[i]);
+        stack_entry = &(area->entries[i]);
         printf("%2d: ", i);
         inspect_key(ctx, stack_entry->key);
         printf("    ");
@@ -1591,7 +1714,7 @@ grn_geo_cursor_entry_next(grn_ctx *ctx,
       }
 #endif
       memcpy(entry,
-             &(cursor->entries[cursor->current_entry--]),
+             &(area->entries[area->current_entry--]),
              sizeof(grn_geo_cursor_entry));
 #ifdef GEO_DEBUG
       printf("%d: pop entry\n", entry->target_bit);
@@ -1838,6 +1961,7 @@ grn_geo_estimate_in_rectangle(grn_ctx *ctx,
     int total_latitude_distance, total_longitude_distance;
     double select_ratio;
     double estimated_n_records;
+    in_rectangle_area_data area_data;
 
     rc = geo_point_get(ctx, data.pat, GRN_CURSOR_ASCENDING, &min);
     if (!rc) {
@@ -1853,8 +1977,14 @@ grn_geo_estimate_in_rectangle(grn_ctx *ctx,
       goto exit;
     }
 
-    select_latitude_distance = abs(data.max.latitude - data.min.latitude);
-    select_longitude_distance = abs(data.max.longitude - data.min.longitude);
+    in_rectangle_area_data_compute(ctx,
+                                   data.top_left,
+                                   data.bottom_right,
+                                   &area_data);
+    select_latitude_distance =
+      abs(area_data.max.latitude - area_data.min.latitude);
+    select_longitude_distance =
+      abs(area_data.max.longitude - area_data.min.longitude);
     total_latitude_distance = abs(max.latitude - min.latitude);
     total_longitude_distance = abs(max.longitude - min.longitude);
 

  Modified: lib/geo.h (+21 -4)
===================================================================
--- lib/geo.h    2013-12-08 13:46:04 +0900 (5a839ad)
+++ lib/geo.h    2013-12-08 18:32:02 +0900 (5093d56)
@@ -74,6 +74,16 @@ typedef enum {
   GRN_GEO_CURSOR_ENTRY_STATUS_LONGITUDE_INNER = 1 << 5
 } grn_geo_cursor_entry_status_flag;
 
+typedef enum {
+  GRN_GEO_AREA_NORTH_EAST,
+  GRN_GEO_AREA_NORTH_WEST,
+  GRN_GEO_AREA_SOUTH_WEST,
+  GRN_GEO_AREA_SOUTH_EAST,
+  GRN_GEO_AREA_LAST
+} grn_geo_area_type;
+
+#define GRN_GEO_N_AREAS GRN_GEO_AREA_LAST
+
 typedef struct {
   uint8_t key[sizeof(grn_geo_point)];
   int target_bit;
@@ -81,21 +91,28 @@ typedef struct {
 } grn_geo_cursor_entry;
 
 typedef struct {
+  grn_geo_point top_left;
+  grn_geo_point bottom_right;
+  uint8_t top_left_key[sizeof(grn_geo_point)];
+  uint8_t bottom_right_key[sizeof(grn_geo_point)];
+  int current_entry;
+  grn_geo_cursor_entry entries[GRN_GEO_KEY_MAX_BITS];
+} grn_geo_cursor_area;
+
+typedef struct {
   grn_db_obj obj;
   grn_obj *pat;
   grn_obj *index;
   grn_geo_point top_left;
   grn_geo_point bottom_right;
-  uint8_t top_left_key[sizeof(grn_geo_point)];
-  uint8_t bottom_right_key[sizeof(grn_geo_point)];
   grn_geo_point current;
   grn_table_cursor *pat_cursor;
   grn_ii_cursor *ii_cursor;
   int offset;
   int rest;
-  grn_geo_cursor_entry entries[GRN_GEO_KEY_MAX_BITS];
-  int current_entry;
   int minimum_reduce_bit;
+  grn_geo_area_type current_area;
+  grn_geo_cursor_area areas[GRN_GEO_N_AREAS];
 } grn_geo_cursor_in_rectangle;
 
 grn_rc grn_geo_cursor_close(grn_ctx *ctx, grn_obj *geo_cursor);

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/all_out.expected (+93 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/all_out.expected    2013-12-08 18:32:02 +0900 (1189bb8)
@@ -0,0 +1,93 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "4x-3", "1x2")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        24
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "1x-3"
+      ],
+      [
+        "1x-2"
+      ],
+      [
+        "1x-1"
+      ],
+      [
+        "1x0"
+      ],
+      [
+        "1x1"
+      ],
+      [
+        "1x2"
+      ],
+      [
+        "2x-3"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "2x2"
+      ],
+      [
+        "3x-3"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "3x2"
+      ],
+      [
+        "4x-3"
+      ],
+      [
+        "4x-2"
+      ],
+      [
+        "4x-1"
+      ],
+      [
+        "4x0"
+      ],
+      [
+        "4x1"
+      ],
+      [
+        "4x2"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/all_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/all_out.test    2013-12-08 18:32:02 +0900 (b47b911)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "4x-3", "1x2")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_out.expected (+51 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_out.expected    2013-12-08 18:32:02 +0900 (f40f172)
@@ -0,0 +1,51 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "3x-2", "2x2")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        10
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "2x2"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "3x2"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_out.test    2013-12-08 18:32:02 +0900 (9874a61)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "3x-2", "2x2")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_west_out.expected (+57 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_west_out.expected    2013-12-08 18:32:02 +0900 (7536c26)
@@ -0,0 +1,57 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "3x-3", "2x2")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        12
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "2x-3"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "2x2"
+      ],
+      [
+        "3x-3"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "3x2"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_west_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/east_west_out.test    2013-12-08 18:32:02 +0900 (f0e8f87)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "3x-3", "2x2")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_east_out.expected (+66 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_east_out.expected    2013-12-08 18:32:02 +0900 (0b50c29)
@@ -0,0 +1,66 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "4x-2", "2x2")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        15
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "2x2"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "3x2"
+      ],
+      [
+        "4x-2"
+      ],
+      [
+        "4x-1"
+      ],
+      [
+        "4x0"
+      ],
+      [
+        "4x1"
+      ],
+      [
+        "4x2"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_east_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_east_out.test    2013-12-08 18:32:02 +0900 (7fdcfe0)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "4x-2", "2x2")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_out.expected (+57 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_out.expected    2013-12-08 18:32:02 +0900 (07eb3d9)
@@ -0,0 +1,57 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "4x-2", "2x1")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        12
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "4x-2"
+      ],
+      [
+        "4x-1"
+      ],
+      [
+        "4x0"
+      ],
+      [
+        "4x1"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_out.test    2013-12-08 18:32:02 +0900 (9ae497d)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "4x-2", "2x1")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_south_out.expected (+69 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_south_out.expected    2013-12-08 18:32:02 +0900 (6f9b1c4)
@@ -0,0 +1,69 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "4x-2", "1x1")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        16
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "1x-2"
+      ],
+      [
+        "1x-1"
+      ],
+      [
+        "1x0"
+      ],
+      [
+        "1x1"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "4x-2"
+      ],
+      [
+        "4x-1"
+      ],
+      [
+        "4x0"
+      ],
+      [
+        "4x1"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_south_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_south_out.test    2013-12-08 18:32:02 +0900 (c30fffd)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "4x-2", "1x1")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_west_out.expected (+66 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_west_out.expected    2013-12-08 18:32:02 +0900 (26e7cad)
@@ -0,0 +1,66 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "4x-3", "2x1")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        15
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "2x-3"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "3x-3"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "4x-3"
+      ],
+      [
+        "4x-2"
+      ],
+      [
+        "4x-1"
+      ],
+      [
+        "4x0"
+      ],
+      [
+        "4x1"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_west_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/north_west_out.test    2013-12-08 18:32:02 +0900 (369ecc8)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "4x-3", "2x1")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/same_as_mesh.expected (+45 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/same_as_mesh.expected    2013-12-08 18:32:02 +0900 (8a98250)
@@ -0,0 +1,45 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "3x-2", "2x1")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        8
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/same_as_mesh.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/same_as_mesh.test    2013-12-08 18:32:02 +0900 (82a56f0)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "3x-2", "2x1")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_east_out.expected (+66 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_east_out.expected    2013-12-08 18:32:02 +0900 (d572d03)
@@ -0,0 +1,66 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "3x-2", "1x2")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        15
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "1x-2"
+      ],
+      [
+        "1x-1"
+      ],
+      [
+        "1x0"
+      ],
+      [
+        "1x1"
+      ],
+      [
+        "1x2"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "2x2"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ],
+      [
+        "3x2"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_east_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_east_out.test    2013-12-08 18:32:02 +0900 (807b04c)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "3x-2", "1x2")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_out.expected (+57 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_out.expected    2013-12-08 18:32:02 +0900 (3331cad)
@@ -0,0 +1,57 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "3x-2", "1x1")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        12
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "1x-2"
+      ],
+      [
+        "1x-1"
+      ],
+      [
+        "1x0"
+      ],
+      [
+        "1x1"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_out.test    2013-12-08 18:32:02 +0900 (15e5b54)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "3x-2", "1x1")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_west_out.expected (+66 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_west_out.expected    2013-12-08 18:32:02 +0900 (4fbe654)
@@ -0,0 +1,66 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "3x-3", "1x1")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        15
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "1x-3"
+      ],
+      [
+        "1x-2"
+      ],
+      [
+        "1x-1"
+      ],
+      [
+        "1x0"
+      ],
+      [
+        "1x1"
+      ],
+      [
+        "2x-3"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "3x-3"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_west_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/south_west_out.test    2013-12-08 18:32:02 +0900 (1cc2013)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "3x-3", "1x1")'

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/west_out.expected (+51 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/west_out.expected    2013-12-08 18:32:02 +0900 (9c3cf54)
@@ -0,0 +1,51 @@
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1   --filter 'geo_in_rectangle(point, "3x-3", "2x1")'
+[
+  [
+    0,
+    0.0,
+    0.0
+  ],
+  [
+    [
+      [
+        10
+      ],
+      [
+        [
+          "point",
+          "WGS84GeoPoint"
+        ]
+      ],
+      [
+        "2x-3"
+      ],
+      [
+        "2x-2"
+      ],
+      [
+        "2x-1"
+      ],
+      [
+        "2x0"
+      ],
+      [
+        "2x1"
+      ],
+      [
+        "3x-3"
+      ],
+      [
+        "3x-2"
+      ],
+      [
+        "3x-1"
+      ],
+      [
+        "3x0"
+      ],
+      [
+        "3x1"
+      ]
+    ]
+  ]
+]

  Added: test/command/suite/select/filter/geo_in_rectangle/north/use_index/west_out.test (+4 -0) 100644
===================================================================
--- /dev/null
+++ test/command/suite/select/filter/geo_in_rectangle/north/use_index/west_out.test    2013-12-08 18:32:02 +0900 (cecf6aa)
@@ -0,0 +1,4 @@
+#@include fixture/geo/in_rectangle/north.grn
+
+select LandMarks --sortby '_id' --output_columns 'point' --limit -1 \
+  --filter 'geo_in_rectangle(point, "3x-3", "2x1")'
-------------- next part --------------
HTML����������������������������...
下載 



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