diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8c30965f1..1d3faa49d 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,6 +9,11 @@ jobs:
steps:
- uses: actions/checkout@v7
+ - name: Turn on test-bin
+ run: |
+ cd osm-3s_testing
+ ./turn_testing_on.sh
+
- name: Automake
run: |
cd src
@@ -17,6 +22,34 @@ jobs:
- name: Configure & build
run: |
cd build
- ../src/configure
- make -j3
+ # With _GLIBCXX_ASSERTIONS, out-of-bounds indexing into strings and
+ # vectors aborts instead of reading past the end unnoticed.
+ ../src/configure --prefix="$GITHUB_WORKSPACE" CXXFLAGS="-g -O2 -D_GLIBCXX_ASSERTIONS"
+ make -j"$(nproc)" install
+
+ - name: Run the test suites
+ run: |
+ cd osm-3s_testing
+ ../test-bin/run_testsuite.sh 40 2>&1 | tee ../testsuite.log
+ echo "Tests reporting success: $(grep -c ' succeeded\.$' ../testsuite.log)"
+ if grep -q 'the tests haven.t compiled' ../testsuite.log \
+ || ! grep -q ' succeeded\.$' ../testsuite.log; then
+ echo "::error::The test suites did not run"
+ exit 1
+ fi
+ # Most suites report "Test X N FAILED." and diff -q's "Files A and B differ";
+ # the attic, vlt and implicit areas suites only report the latter.
+ if grep -E " FAILED\.$| differ$|doesn't exist\.$|^In Test .*Unexpected file" ../testsuite.log; then
+ echo "::error::Some tests failed"
+ exit 1
+ fi
+ - name: Upload the outputs of failed tests
+ if: failure()
+ uses: actions/upload-artifact@v7
+ with:
+ name: failed-tests
+ path: |
+ testsuite.log
+ osm-3s_testing/run/
+ if-no-files-found: ignore
diff --git a/osm-3s_testing/.gitignore b/osm-3s_testing/.gitignore
index 2e299e5d0..4673422f0 100644
--- a/osm-3s_testing/.gitignore
+++ b/osm-3s_testing/.gitignore
@@ -1,3 +1,4 @@
input/update_database/
run/
+result.osm
diff --git a/osm-3s_testing/expected/area/area_bbox.err b/osm-3s_testing/expected/area/area_bbox.err
index 43816ea16..ba861b591 100644
--- a/osm-3s_testing/expected/area/area_bbox.err
+++ b/osm-3s_testing/expected/area/area_bbox.err
@@ -1,2 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
-runtime error: Filters too weak in query statement: specify in addition a bbox, a tag filter, or similar.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/area_tag.err b/osm-3s_testing/expected/area/area_tag.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/area_tag.err
+++ b/osm-3s_testing/expected/area/area_tag.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_101_et_al.err b/osm-3s_testing/expected/area/is_in_101_et_al.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_101_et_al.err
+++ b/osm-3s_testing/expected/area/is_in_101_et_al.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_201.err b/osm-3s_testing/expected/area/is_in_201.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_201.err
+++ b/osm-3s_testing/expected/area/is_in_201.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_202.err b/osm-3s_testing/expected/area/is_in_202.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_202.err
+++ b/osm-3s_testing/expected/area/is_in_202.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_204_205.err b/osm-3s_testing/expected/area/is_in_204_205.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_204_205.err
+++ b/osm-3s_testing/expected/area/is_in_204_205.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_n_101_et_al.err b/osm-3s_testing/expected/area/is_in_n_101_et_al.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_n_101_et_al.err
+++ b/osm-3s_testing/expected/area/is_in_n_101_et_al.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_n_201.err b/osm-3s_testing/expected/area/is_in_n_201.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_n_201.err
+++ b/osm-3s_testing/expected/area/is_in_n_201.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_n_202.err b/osm-3s_testing/expected/area/is_in_n_202.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_n_202.err
+++ b/osm-3s_testing/expected/area/is_in_n_202.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_n_204_205.err b/osm-3s_testing/expected/area/is_in_n_204_205.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_n_204_205.err
+++ b/osm-3s_testing/expected/area/is_in_n_204_205.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_nn_102.err b/osm-3s_testing/expected/area/is_in_nn_102.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_nn_102.err
+++ b/osm-3s_testing/expected/area/is_in_nn_102.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/is_in_nn_201_202.err b/osm-3s_testing/expected/area/is_in_nn_201_202.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/is_in_nn_201_202.err
+++ b/osm-3s_testing/expected/area/is_in_nn_201_202.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/pivot_a.err b/osm-3s_testing/expected/area/pivot_a.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/pivot_a.err
+++ b/osm-3s_testing/expected/area/pivot_a.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/pivot_a_default.err b/osm-3s_testing/expected/area/pivot_a_default.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/pivot_a_default.err
+++ b/osm-3s_testing/expected/area/pivot_a_default.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/pivot_a_set_b.err b/osm-3s_testing/expected/area/pivot_a_set_b.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/pivot_a_set_b.err
+++ b/osm-3s_testing/expected/area/pivot_a_set_b.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/pivot_default.err b/osm-3s_testing/expected/area/pivot_default.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/pivot_default.err
+++ b/osm-3s_testing/expected/area/pivot_default.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_101.err b/osm-3s_testing/expected/area/way_101.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_101.err
+++ b/osm-3s_testing/expected/area/way_101.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_101_r.err b/osm-3s_testing/expected/area/way_101_r.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_101_r.err
+++ b/osm-3s_testing/expected/area/way_101_r.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_101_w.err b/osm-3s_testing/expected/area/way_101_w.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_101_w.err
+++ b/osm-3s_testing/expected/area/way_101_w.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_102.err b/osm-3s_testing/expected/area/way_102.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_102.err
+++ b/osm-3s_testing/expected/area/way_102.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_103.err b/osm-3s_testing/expected/area/way_103.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_103.err
+++ b/osm-3s_testing/expected/area/way_103.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_201.err b/osm-3s_testing/expected/area/way_201.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_201.err
+++ b/osm-3s_testing/expected/area/way_201.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_202.err b/osm-3s_testing/expected/area/way_202.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_202.err
+++ b/osm-3s_testing/expected/area/way_202.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_203.err b/osm-3s_testing/expected/area/way_203.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_203.err
+++ b/osm-3s_testing/expected/area/way_203.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_204.err b/osm-3s_testing/expected/area/way_204.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_204.err
+++ b/osm-3s_testing/expected/area/way_204.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_205.err b/osm-3s_testing/expected/area/way_205.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_205.err
+++ b/osm-3s_testing/expected/area/way_205.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_311.err b/osm-3s_testing/expected/area/way_311.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_311.err
+++ b/osm-3s_testing/expected/area/way_311.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_312.err b/osm-3s_testing/expected/area/way_312.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_312.err
+++ b/osm-3s_testing/expected/area/way_312.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_313.err b/osm-3s_testing/expected/area/way_313.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_313.err
+++ b/osm-3s_testing/expected/area/way_313.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_314.err b/osm-3s_testing/expected/area/way_314.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_314.err
+++ b/osm-3s_testing/expected/area/way_314.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_321.err b/osm-3s_testing/expected/area/way_321.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_321.err
+++ b/osm-3s_testing/expected/area/way_321.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_322.err b/osm-3s_testing/expected/area/way_322.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_322.err
+++ b/osm-3s_testing/expected/area/way_322.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_323.err b/osm-3s_testing/expected/area/way_323.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_323.err
+++ b/osm-3s_testing/expected/area/way_323.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/area/way_324.err b/osm-3s_testing/expected/area/way_324.err
index 54aa94a48..ba861b591 100644
--- a/osm-3s_testing/expected/area/way_324.err
+++ b/osm-3s_testing/expected/area/way_324.err
@@ -1 +1,2 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/osm3s_query_20/stderr.log b/osm-3s_testing/expected/osm3s_query_20/stderr.log
index 7bcb082eb..cecbc051f 100644
--- a/osm-3s_testing/expected/osm3s_query_20/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_20/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1024.
diff --git a/osm-3s_testing/expected/osm3s_query_21/stderr.log b/osm-3s_testing/expected/osm3s_query_21/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_21/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_21/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_22/stderr.log b/osm-3s_testing/expected/osm3s_query_22/stderr.log
index 7bcb082eb..05c8cf548 100644
--- a/osm-3s_testing/expected/osm3s_query_22/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_22/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 1 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_23/stderr.log b/osm-3s_testing/expected/osm3s_query_23/stderr.log
index 7bcb082eb..cecbc051f 100644
--- a/osm-3s_testing/expected/osm3s_query_23/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_23/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1024.
diff --git a/osm-3s_testing/expected/osm3s_query_24/stderr.log b/osm-3s_testing/expected/osm3s_query_24/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_24/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_24/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_25/stderr.log b/osm-3s_testing/expected/osm3s_query_25/stderr.log
index 7bcb082eb..05c8cf548 100644
--- a/osm-3s_testing/expected/osm3s_query_25/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_25/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 1 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_26/stderr.log b/osm-3s_testing/expected/osm3s_query_26/stderr.log
index 6673062ce..ae3a75da6 100644
--- a/osm-3s_testing/expected/osm3s_query_26/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_26/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "query", part 9, on line 4.
+runtime remark: Timeout is 3600 and maxsize is 1024.
+After: in "query", part 9, on line 4.
runtime error: Query run out of memory in "query" at line 4 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_27/stderr.log b/osm-3s_testing/expected/osm3s_query_27/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_27/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_27/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_29/stderr.log b/osm-3s_testing/expected/osm3s_query_29/stderr.log
index 7bcb082eb..cecbc051f 100644
--- a/osm-3s_testing/expected/osm3s_query_29/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_29/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1024.
diff --git a/osm-3s_testing/expected/osm3s_query_30/stderr.log b/osm-3s_testing/expected/osm3s_query_30/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_30/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_30/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_32/stderr.log b/osm-3s_testing/expected/osm3s_query_32/stderr.log
index bbdbb049d..a21871b20 100644
--- a/osm-3s_testing/expected/osm3s_query_32/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_32/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "bbox-query", part 0, on line 4.
+runtime remark: Timeout is 3600 and maxsize is 1024.
+After: in "bbox-query", part 0, on line 4.
runtime error: Query run out of memory in "bbox-query" at line 4 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_33/stderr.log b/osm-3s_testing/expected/osm3s_query_33/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_33/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_33/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_35/stderr.log b/osm-3s_testing/expected/osm3s_query_35/stderr.log
index 6cb415712..b2ee06a2b 100644
--- a/osm-3s_testing/expected/osm3s_query_35/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_35/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 80.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_36/stderr.log b/osm-3s_testing/expected/osm3s_query_36/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_36/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_36/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_37/stderr.log b/osm-3s_testing/expected/osm3s_query_37/stderr.log
index 7bcb082eb..05c8cf548 100644
--- a/osm-3s_testing/expected/osm3s_query_37/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_37/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 1 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_38/stderr.log b/osm-3s_testing/expected/osm3s_query_38/stderr.log
index 6cb415712..b2ee06a2b 100644
--- a/osm-3s_testing/expected/osm3s_query_38/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_38/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 80.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_39/stderr.log b/osm-3s_testing/expected/osm3s_query_39/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_39/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_39/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_40/stderr.log b/osm-3s_testing/expected/osm3s_query_40/stderr.log
index 4a3217fe7..e806a5fd1 100644
--- a/osm-3s_testing/expected/osm3s_query_40/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_40/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "recurse", part 0, on line 11. Stack: 1 of 104 66 of 104 76 of 104
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "recurse", part 0, on line 11.
runtime error: Query timed out in "recurse" at line 11 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_41/stderr.log b/osm-3s_testing/expected/osm3s_query_41/stderr.log
index 6cb415712..8a1f9b0dd 100644
--- a/osm-3s_testing/expected/osm3s_query_41/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_41/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 200.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_42/stderr.log b/osm-3s_testing/expected/osm3s_query_42/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_42/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_42/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_43/stderr.log b/osm-3s_testing/expected/osm3s_query_43/stderr.log
index 5cc1b0553..e806a5fd1 100644
--- a/osm-3s_testing/expected/osm3s_query_43/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_43/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "recurse", part 0, on line 11. Stack: 1 of 99 40 of 99 53 of 99
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "recurse", part 0, on line 11.
runtime error: Query timed out in "recurse" at line 11 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_44/stderr.log b/osm-3s_testing/expected/osm3s_query_44/stderr.log
index 6cb415712..8a1f9b0dd 100644
--- a/osm-3s_testing/expected/osm3s_query_44/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_44/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 200.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_45/stderr.log b/osm-3s_testing/expected/osm3s_query_45/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_45/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_45/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_46/stderr.log b/osm-3s_testing/expected/osm3s_query_46/stderr.log
index b2b85c8db..4bc7c1b0b 100644
--- a/osm-3s_testing/expected/osm3s_query_46/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_46/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "recurse", part 0, on line 13. Stack: 1 of 4800 1 of 4800 401 of 4800
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "recurse", part 0, on line 13.
runtime error: Query timed out in "recurse" at line 13 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_47/stderr.log b/osm-3s_testing/expected/osm3s_query_47/stderr.log
index 6cb415712..23ae55aa0 100644
--- a/osm-3s_testing/expected/osm3s_query_47/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_47/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 280.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_48/stderr.log b/osm-3s_testing/expected/osm3s_query_48/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_48/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_48/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_49/stderr.log b/osm-3s_testing/expected/osm3s_query_49/stderr.log
index daadbf6c6..99fdd4c3e 100644
--- a/osm-3s_testing/expected/osm3s_query_49/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_49/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "recurse", part 0, on line 20. Stack: 2 of 21 1 of 21 12 of 21 10 of 21
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "recurse", part 0, on line 20.
runtime error: Query timed out in "recurse" at line 20 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_50/stderr.log b/osm-3s_testing/expected/osm3s_query_50/stderr.log
index 6cb415712..23ae55aa0 100644
--- a/osm-3s_testing/expected/osm3s_query_50/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_50/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 280.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_51/stderr.log b/osm-3s_testing/expected/osm3s_query_51/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_51/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_51/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_52/stderr.log b/osm-3s_testing/expected/osm3s_query_52/stderr.log
index 403fb7314..731c6087e 100644
--- a/osm-3s_testing/expected/osm3s_query_52/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_52/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "recurse", part 0, on line 17. Stack: 2 of 18 7 of 18 7 of 18 16 of 18
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "recurse", part 0, on line 17.
runtime error: Query timed out in "recurse" at line 17 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_53/stderr.log b/osm-3s_testing/expected/osm3s_query_53/stderr.log
index 6cb415712..23ae55aa0 100644
--- a/osm-3s_testing/expected/osm3s_query_53/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_53/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 280.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_54/stderr.log b/osm-3s_testing/expected/osm3s_query_54/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_54/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_54/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_55/stderr.log b/osm-3s_testing/expected/osm3s_query_55/stderr.log
index a815142f9..f70db07bf 100644
--- a/osm-3s_testing/expected/osm3s_query_55/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_55/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "recurse", part 0, on line 18. Stack: 2 of 18 17 of 18 7 of 18 17 of 18
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "recurse", part 0, on line 18.
runtime error: Query timed out in "recurse" at line 18 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_56/stderr.log b/osm-3s_testing/expected/osm3s_query_56/stderr.log
index 6cb415712..23ae55aa0 100644
--- a/osm-3s_testing/expected/osm3s_query_56/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_56/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m0s: in "recurse", part 0, on line 5.
+runtime remark: Timeout is 3600 and maxsize is 280.
+After: in "recurse", part 0, on line 5.
runtime error: Query run out of memory in "recurse" at line 5 using about 0 MB of RAM.
diff --git a/osm-3s_testing/expected/osm3s_query_57/stderr.log b/osm-3s_testing/expected/osm3s_query_57/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_57/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_57/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_58/stderr.log b/osm-3s_testing/expected/osm3s_query_58/stderr.log
index 7bcb082eb..05c8cf548 100644
--- a/osm-3s_testing/expected/osm3s_query_58/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_58/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 1 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_59/stderr.log b/osm-3s_testing/expected/osm3s_query_59/stderr.log
index 7bcb082eb..05c8cf548 100644
--- a/osm-3s_testing/expected/osm3s_query_59/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_59/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 1 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_60/stderr.log b/osm-3s_testing/expected/osm3s_query_60/stderr.log
index 7bcb082eb..05c8cf548 100644
--- a/osm-3s_testing/expected/osm3s_query_60/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_60/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 1 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_61/stderr.log b/osm-3s_testing/expected/osm3s_query_61/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_61/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_61/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_62/stderr.log b/osm-3s_testing/expected/osm3s_query_62/stderr.log
index 0b0b223aa..e3c68d419 100644
--- a/osm-3s_testing/expected/osm3s_query_62/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_62/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "print", part 0, on line 12. Stack: 1 of 99 1 of 99 35 of 99 55 of 99
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "print", part 0, on line 12.
runtime error: Query timed out in "print" at line 12 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_63/stderr.log b/osm-3s_testing/expected/osm3s_query_63/stderr.log
index c25a1fa7b..e3c68d419 100644
--- a/osm-3s_testing/expected/osm3s_query_63/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_63/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "print", part 0, on line 12. Stack: 1 of 99 4 of 99 26 of 99 47 of 99
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "print", part 0, on line 12.
runtime error: Query timed out in "print" at line 12 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_64/stderr.log b/osm-3s_testing/expected/osm3s_query_64/stderr.log
index 29898b824..e3c68d419 100644
--- a/osm-3s_testing/expected/osm3s_query_64/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_64/stderr.log
@@ -1,5 +1,6 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
-After 0h0m2s: in "print", part 0, on line 12. Stack: 1 of 99 9 of 99 24 of 99 59 of 99
+runtime remark: Timeout is 1 and maxsize is 1073741824.
+After: in "print", part 0, on line 12.
runtime error: Query timed out in "print" at line 12 after 2 seconds.
diff --git a/osm-3s_testing/expected/osm3s_query_65/stderr.log b/osm-3s_testing/expected/osm3s_query_65/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_65/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_65/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_68/stderr.log b/osm-3s_testing/expected/osm3s_query_68/stderr.log
index 7bcb082eb..05c8cf548 100644
--- a/osm-3s_testing/expected/osm3s_query_68/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_68/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 1 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/osm3s_query_69/stderr.log b/osm-3s_testing/expected/osm3s_query_69/stderr.log
index 7bcb082eb..63261b624 100644
--- a/osm-3s_testing/expected/osm3s_query_69/stderr.log
+++ b/osm-3s_testing/expected/osm3s_query_69/stderr.log
@@ -1,3 +1,4 @@
encoding remark: Please enter your query and terminate it with CTRL+D.
encoding remark: Your input contains an 'osm-script' tag. Thus, a line with the
datatype declaration is added. This shifts line numbering by -1 line(s).
+runtime remark: Timeout is 3600 and maxsize is 1073741824.
diff --git a/osm-3s_testing/expected/regression_cgi_bbox_not_numeric/stderr.log b/osm-3s_testing/expected/regression_cgi_bbox_not_numeric/stderr.log
new file mode 100644
index 000000000..e69de29bb
diff --git a/osm-3s_testing/expected/regression_cgi_bbox_not_numeric/stdout.log b/osm-3s_testing/expected/regression_cgi_bbox_not_numeric/stdout.log
new file mode 100644
index 000000000..123fb1281
--- /dev/null
+++ b/osm-3s_testing/expected/regression_cgi_bbox_not_numeric/stdout.log
@@ -0,0 +1,18 @@
+Status: 400 Bad Request
+Content-type: text/html; charset=utf-8
+
+
+
+
+
+
+ OSM3S Response
+
+
+
+The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.
+Error: line 1: parse error: bbox requires four arguments
+
+
+
diff --git a/osm-3s_testing/expected/regression_cgi_custom_url_line_break/stderr.log b/osm-3s_testing/expected/regression_cgi_custom_url_line_break/stderr.log
new file mode 100644
index 000000000..e69de29bb
diff --git a/osm-3s_testing/expected/regression_cgi_custom_url_line_break/stdout.log b/osm-3s_testing/expected/regression_cgi_custom_url_line_break/stdout.log
new file mode 100644
index 000000000..ca3df7028
--- /dev/null
+++ b/osm-3s_testing/expected/regression_cgi_custom_url_line_break/stdout.log
@@ -0,0 +1,18 @@
+Status: 400 Bad Request
+Content-type: text/html; charset=utf-8
+
+
+
+
+
+
+ OSM3S Response
+
+
+
+The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.
+Error: encoding error: Parameter "url" must not contain line breaks.
+
+
+
diff --git a/osm-3s_testing/expected/regression_cgi_truncated_percent/stderr.log b/osm-3s_testing/expected/regression_cgi_truncated_percent/stderr.log
new file mode 100644
index 000000000..e69de29bb
diff --git a/osm-3s_testing/expected/regression_cgi_truncated_percent/stdout.log b/osm-3s_testing/expected/regression_cgi_truncated_percent/stdout.log
new file mode 100644
index 000000000..f003706d0
--- /dev/null
+++ b/osm-3s_testing/expected/regression_cgi_truncated_percent/stdout.log
@@ -0,0 +1,21 @@
+Status: 400 Bad Request
+Content-type: text/html; charset=utf-8
+
+
+
+
+
+
+ OSM3S Response
+
+
+
+The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.
+Error: line 1: parse error: Unknown type "%"
+Error: line 1: parse error: An empty query is not allowed
+Error: line 1: parse error: ';' expected - '%' found.
+Error: line 1: parse error: Unexpected end of input.
+
+
+
diff --git a/osm-3s_testing/expected/regression_ql_nesting_limit/stderr.log b/osm-3s_testing/expected/regression_ql_nesting_limit/stderr.log
new file mode 100644
index 000000000..69bea0599
--- /dev/null
+++ b/osm-3s_testing/expected/regression_ql_nesting_limit/stderr.log
@@ -0,0 +1,1031 @@
+encoding remark: Please enter your query and terminate it with CTRL+D.
+line 1: parse error: Nesting of statements is limited to 1023 levels
+line 1: parse error: Nesting of statements is limited to 1023 levels
+line 1: parse error: Nesting of statements is limited to 1023 levels
+line 1: parse error: ';' expected - '(' found.
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
+line 1: parse error: Unknown type ")"
+line 1: parse error: An empty query is not allowed
diff --git a/osm-3s_testing/expected/regression_ql_nesting_limit/stdout.log b/osm-3s_testing/expected/regression_ql_nesting_limit/stdout.log
new file mode 100644
index 000000000..e69de29bb
diff --git a/osm-3s_testing/expected/regression_user_touched_relations/stderr.log b/osm-3s_testing/expected/regression_user_touched_relations/stderr.log
new file mode 100644
index 000000000..ba861b591
--- /dev/null
+++ b/osm-3s_testing/expected/regression_user_touched_relations/stderr.log
@@ -0,0 +1,2 @@
+encoding remark: Please enter your query and terminate it with CTRL+D.
+runtime remark: Timeout is 180 and maxsize is 536870912.
diff --git a/osm-3s_testing/expected/regression_user_touched_relations/stdout.log b/osm-3s_testing/expected/regression_user_touched_relations/stdout.log
new file mode 100644
index 000000000..806ae27e3
--- /dev/null
+++ b/osm-3s_testing/expected/regression_user_touched_relations/stdout.log
@@ -0,0 +1,19 @@
+
+
+The data included in this document is from www.openstreetmap.org. The data is made available under ODbL.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/osm-3s_testing/expected/run_and_compare.sh_1/stderr.log b/osm-3s_testing/expected/run_and_compare.sh_1/stderr.log
index 49e04fc87..98a93cc5c 100644
--- a/osm-3s_testing/expected/run_and_compare.sh_1/stderr.log
+++ b/osm-3s_testing/expected/run_and_compare.sh_1/stderr.log
@@ -1,9 +1,3 @@
-Reading XML file ... elapsed node 2795331. Flushing to database ...... done.
-Reading XML file ... elapsed node 5590728. Flushing to database ...... done.
-Reading XML file ... elapsed node 8386125. Flushing to database ...... done.
-Reading XML file ... elapsed node 11181522. Flushing to database ...... done.
-Reading XML file ... elapsed node 13976919. Flushing to database ...... done.
-Reading XML file ... finished reading nodes. Flushing to database ...... done.
-Reorganizing the database ... done.
+Reading XML file ... finished reading nodes. Compute current ... ready. Flushing to database ...... done.
compare_osm_base_maps: File error caught: 2 ./ways.bin File_Blocks::File_Blocks::1
compare_osm_base_maps: File error caught: 2 ./relations.bin File_Blocks::File_Blocks::1
diff --git a/osm-3s_testing/expected/run_and_compare.sh_1/stdout.log b/osm-3s_testing/expected/run_and_compare.sh_1/stdout.log
index 9a215f2ff..5d6e6b2ca 100644
--- a/osm-3s_testing/expected/run_and_compare.sh_1/stdout.log
+++ b/osm-3s_testing/expected/run_and_compare.sh_1/stdout.log
@@ -1 +1 @@
-For 16000000 nodes their idx in bin matches their idx in map.
+For 6400 nodes their idx in bin matches their idx in map.
diff --git a/osm-3s_testing/expected/run_and_compare.sh_2/stderr.log b/osm-3s_testing/expected/run_and_compare.sh_2/stderr.log
index cfbcc519a..a698dac1c 100644
--- a/osm-3s_testing/expected/run_and_compare.sh_2/stderr.log
+++ b/osm-3s_testing/expected/run_and_compare.sh_2/stderr.log
@@ -1,19 +1,4 @@
-Reading XML file ... elapsed node 2795331. Flushing to database ...... done.
-Reading XML file ... elapsed node 5590728. Flushing to database ...... done.
-Reading XML file ... elapsed node 8386125. Flushing to database ...... done.
-Reading XML file ... elapsed node 11181522. Flushing to database ...... done.
-Reading XML file ... elapsed node 13976919. Flushing to database ...... done.
-Reading XML file ... finished reading nodes. Flushing to database ...... done.
-Reorganizing the database ... done.
-Reading XML file ... elapsed way 986772. Flushing to database ....... done.
-Reading XML file ... elapsed way 1973566. Flushing to database ....... done.
-Reading XML file ... elapsed way 2021162. Flushing to database ....... done.
-Reading XML file ... elapsed way 3007957. Flushing to database ....... done.
-Reading XML file ... elapsed way 3994752. Flushing to database ....... done.
-Reading XML file ... elapsed way 4042347. Flushing to database ....... done.
-Reading XML file ... elapsed way 5029142. Flushing to database ....... done.
-Reading XML file ... elapsed way 6000030. Flushing to database ....... done.
-Reading XML file ... finished reading ways. Flushing to database ....... done.
-Reorganizing the database ... done.
+Reading XML file ... finished reading nodes. Compute current ... ready. Flushing to database ...... done.
+Reading XML file ... finished reading ways. Compute current ... ready. Flushing to database ...... done.
compare_osm_base_maps: File error caught: 2 ./nodes.bin File_Blocks::File_Blocks::1
compare_osm_base_maps: File error caught: 2 ./relations.bin File_Blocks::File_Blocks::1
diff --git a/osm-3s_testing/expected/run_and_compare.sh_2/stdout.log b/osm-3s_testing/expected/run_and_compare.sh_2/stdout.log
index 6a13b404e..a7d336212 100644
--- a/osm-3s_testing/expected/run_and_compare.sh_2/stdout.log
+++ b/osm-3s_testing/expected/run_and_compare.sh_2/stdout.log
@@ -1 +1 @@
-For 6002994 ways their idx in bin matches their idx in map.
+For 2454 ways their idx in bin matches their idx in map.
diff --git a/osm-3s_testing/expected/run_and_compare.sh_3/stderr.log b/osm-3s_testing/expected/run_and_compare.sh_3/stderr.log
index a19722b3b..290260fe4 100644
--- a/osm-3s_testing/expected/run_and_compare.sh_3/stderr.log
+++ b/osm-3s_testing/expected/run_and_compare.sh_3/stderr.log
@@ -1,19 +1,5 @@
-Reading XML file ... elapsed node 2795331. Flushing to database ...... done.
-Reading XML file ... elapsed node 5590728. Flushing to database ...... done.
-Reading XML file ... elapsed node 8386125. Flushing to database ...... done.
-Reading XML file ... elapsed node 11181522. Flushing to database ...... done.
-Reading XML file ... elapsed node 13976919. Flushing to database ...... done.
-Reading XML file ... finished reading nodes. Flushing to database ...... done.
-Reorganizing the database ... done.
-Reading XML file ... elapsed way 986772. Flushing to database ....... done.
-Reading XML file ... elapsed way 1973566. Flushing to database ....... done.
-Reading XML file ... elapsed way 2021162. Flushing to database ....... done.
-Reading XML file ... elapsed way 3007957. Flushing to database ....... done.
-Reading XML file ... elapsed way 3994752. Flushing to database ....... done.
-Reading XML file ... elapsed way 4042347. Flushing to database ....... done.
-Reading XML file ... elapsed way 5029142. Flushing to database ....... done.
-Reading XML file ... elapsed way 6000030. Flushing to database ....... done.
-Reading XML file ... finished reading ways. Flushing to database ....... done.
-Reading XML file ... finished reading relations. Flushing to database ........ done.
+Reading XML file ... finished reading nodes. Compute current ... ready. Flushing to database ...... done.
+Reading XML file ... finished reading ways. Compute current ... ready. Flushing to database ...... done.
+Reading XML file ... finished reading relations. Flushing to database ....... done.
compare_osm_base_maps: File error caught: 2 ./nodes.bin File_Blocks::File_Blocks::1
compare_osm_base_maps: File error caught: 2 ./ways.bin File_Blocks::File_Blocks::1
diff --git a/osm-3s_testing/input/osm3s_query_22/stdin.log b/osm-3s_testing/input/osm3s_query_22/stdin.log
index bc411caa6..b4241e113 100644
--- a/osm-3s_testing/input/osm3s_query_22/stdin.log
+++ b/osm-3s_testing/input/osm3s_query_22/stdin.log
@@ -3,8 +3,8 @@
-
-
+
+
diff --git a/osm-3s_testing/input/regression_cgi_bbox_not_numeric/env b/osm-3s_testing/input/regression_cgi_bbox_not_numeric/env
new file mode 100644
index 000000000..04037d35e
--- /dev/null
+++ b/osm-3s_testing/input/regression_cgi_bbox_not_numeric/env
@@ -0,0 +1,2 @@
+REQUEST_METHOD=GET
+QUERY_STRING=data=node(bbox);out;&bbox=7,51,8);node(id:1,52
diff --git a/osm-3s_testing/input/regression_cgi_bbox_not_numeric/init.osm b/osm-3s_testing/input/regression_cgi_bbox_not_numeric/init.osm
new file mode 100644
index 000000000..140a94367
--- /dev/null
+++ b/osm-3s_testing/input/regression_cgi_bbox_not_numeric/init.osm
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/osm-3s_testing/input/regression_cgi_custom_url_line_break/env b/osm-3s_testing/input/regression_cgi_custom_url_line_break/env
new file mode 100644
index 000000000..8f939c879
--- /dev/null
+++ b/osm-3s_testing/input/regression_cgi_custom_url_line_break/env
@@ -0,0 +1,2 @@
+REQUEST_METHOD=GET
+QUERY_STRING=data=[out:custom];node(1);out;&url=http://example.com/%0d%0aX-Injected:%201
diff --git a/osm-3s_testing/input/regression_cgi_custom_url_line_break/init.osm b/osm-3s_testing/input/regression_cgi_custom_url_line_break/init.osm
new file mode 100644
index 000000000..140a94367
--- /dev/null
+++ b/osm-3s_testing/input/regression_cgi_custom_url_line_break/init.osm
@@ -0,0 +1,4 @@
+
+
+
+
diff --git a/osm-3s_testing/input/regression_cgi_truncated_percent/env b/osm-3s_testing/input/regression_cgi_truncated_percent/env
new file mode 100644
index 000000000..1192b3b48
--- /dev/null
+++ b/osm-3s_testing/input/regression_cgi_truncated_percent/env
@@ -0,0 +1,2 @@
+REQUEST_METHOD=GET
+QUERY_STRING=data=node(1);out;%
diff --git a/osm-3s_testing/input/regression_ql_nesting_limit/stdin.log b/osm-3s_testing/input/regression_ql_nesting_limit/stdin.log
new file mode 100644
index 000000000..0d6556594
--- /dev/null
+++ b/osm-3s_testing/input/regression_ql_nesting_limit/stdin.log
@@ -0,0 +1 @@
+((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((node(1);););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););););
diff --git a/osm-3s_testing/input/regression_user_touched_relations/import.args b/osm-3s_testing/input/regression_user_touched_relations/import.args
new file mode 100644
index 000000000..65d113bed
--- /dev/null
+++ b/osm-3s_testing/input/regression_user_touched_relations/import.args
@@ -0,0 +1 @@
+--keep-attic
diff --git a/osm-3s_testing/input/regression_user_touched_relations/init.osm b/osm-3s_testing/input/regression_user_touched_relations/init.osm
new file mode 100644
index 000000000..5ec2fe3a9
--- /dev/null
+++ b/osm-3s_testing/input/regression_user_touched_relations/init.osm
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/osm-3s_testing/input/regression_user_touched_relations/stdin.log b/osm-3s_testing/input/regression_user_touched_relations/stdin.log
new file mode 100644
index 000000000..6e4af4f7b
--- /dev/null
+++ b/osm-3s_testing/input/regression_user_touched_relations/stdin.log
@@ -0,0 +1,6 @@
+rel(1);
+nwr._(uid_touched:999999999);
+out count;
+rel(1);
+nwr._(uid_touched:1);
+out count;
diff --git a/osm-3s_testing/turn_testing_on.sh b/osm-3s_testing/turn_testing_on.sh
index 493a8d17c..3f10e2042 100755
--- a/osm-3s_testing/turn_testing_on.sh
+++ b/osm-3s_testing/turn_testing_on.sh
@@ -1,14 +1,14 @@
#!/usr/bin/env bash
cat ../src/Makefile.am | awk '{ if ($1 == "#SUBDIRS" && $3 != "") print substr($0,2); else if ($1 == "SUBDIRS" && $3 == "") print "#"$0; else print $0; }' >_
-if [[ -z $(diff -q _ ../src/Makefile.test.am) ]]; then
+if [[ -f ../src/Makefile.test.am && -z $(diff -q _ ../src/Makefile.test.am) ]]; then
mv ../src/Makefile.test.am ../src/Makefile.am
else
mv _ ../src/Makefile.am
fi
cat ../src/configure.ac | awk '{ if (substr($1,1,16) == "#AC_CONFIG_FILES" && $2 != "") print substr($0,2); else if (substr($1,1,15) == "AC_CONFIG_FILES" && $2 == "") print "#"$0; else print $0; }' >_
-if [[ -z $(diff -q _ ../src/configure.test.ac) ]]; then
+if [[ -f ../src/configure.test.ac && -z $(diff -q _ ../src/configure.test.ac) ]]; then
mv ../src/configure.test.ac ../src/configure.ac
else
mv _ ../src/configure.ac
diff --git a/src/overpass_api/core/four_field_index.test.cc b/src/overpass_api/core/four_field_index.test.cc
new file mode 100644
index 000000000..4f5bb29a4
--- /dev/null
+++ b/src/overpass_api/core/four_field_index.test.cc
@@ -0,0 +1,79 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include "four_field_index.h"
+
+#include
+#include
+
+
+void check_result(const Four_Field_Index& idx, const std::string& expected)
+{
+ std::string result = idx.to_string();
+ if (result == expected)
+ std::cout<<"OK"<<'\n';
+ else
+ std::cout<<"failed: "<.
+ */
+
+#include "index_computations.h"
+
+#include
+#include
+#include
+#include
+
+
+void cout_ranges(const Ranges< Uint31_Index >& result)
+{
+ std::cout<<"0x__80: ";
+ for (auto it = result.begin(); it != result.end(); ++it)
+ {
+ if ((it.lower_bound().val() & 0x80000000) && (it.lower_bound().val() & 0xff) == 0x80)
+ std::cout<(1, ll_upper(lat, 0) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+ for (uint32 lat = 0; lat <= 0x1000000; lat += 0x100000)
+ std::cout<(1, ll_upper(lat, 0) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+ for (uint32 lat = 0; lat <= 0x10000000; lat += 0x1000000)
+ std::cout<(1, ll_upper(lat, 0) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+ for (uint32 lat = 0; lat < 0x80000000; lat += 0x10000000)
+ std::cout<(1, ll_upper(lat, 0) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+
+ for (int32 lon = 0; lon <= 0x100000; lon += 0x10000)
+ std::cout<(1, ll_upper(0, lon) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+ for (int32 lon = 0; lon <= 0x1000000; lon += 0x100000)
+ std::cout<(1, ll_upper(0, lon) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+ for (int32 lon = 0; lon <= 0x10000000; lon += 0x1000000)
+ std::cout<(1, ll_upper(0, lon) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+ for (int32 lon = 0xffff8000; lon < (int32)0x8000; lon += 0x1000)
+ std::cout<(1, ll_upper(0, lon<<16) ^ 0x40000000))<<' ';
+ std::cout<<'\n';
+
+ std::cout<<"\nTest calc_index with 2 entries:\n";
+
+ for (uint32 lat = 0; lat <= 0x100000; lat += 0x10000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon<<16) ^ 0x40000000);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+ for (uint32 lat = 0; lat <= 0x1000000; lat += 0x100000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+ for (uint32 lat = 0; lat <= 0x10000000; lat += 0x1000000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+ for (uint32 lat = 0; lat < 0x80000000; lat += 0x10000000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+
+ for (int32 lon = 0; lon <= 0x100000; lon += 0x10000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+ for (int32 lon = 0; lon <= 0x1000000; lon += 0x100000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+ for (int32 lon = 0; lon <= 0x10000000; lon += 0x1000000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+ for (int32 lon = 0xffff8000; lon < (int32)0x8000; lon += 0x1000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon<<16) ^ 0x40000000);
+ std::cout<(1, calc_index(idxs)))<<' ';
+ }
+ std::cout<<'\n';
+
+ std::cout<<"\nTest calc_index with an already cumulated and another entry:\n";
+
+ for (uint32 lat = 0; lat <= 0x100000; lat += 0x10000)
+ {
+ std::vector< uint32 > idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(lat, 0) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(1, 0x40000000);
+ idxs.push_back(ll_upper(0, lon<<16) ^ 0x40000000);
+ idxs[1] = calc_index(idxs);
+ std::cout< idxs(2, 0x3f3f3f3f);
+ std::vector< Uint32_Index > result = calc_node_children(idxs);
+ for (std::vector< Uint32_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint32_Index > result = calc_node_children(std::vector< uint32 >(1, 0x40848400));
+ for (std::vector< Uint32_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint32_Index > result = calc_node_children(std::vector< uint32 >(1, 0xc0848401));
+ for (std::vector< Uint32_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint32_Index > result = calc_node_children(std::vector< uint32 >(1, 0xc0848402));
+ for (std::vector< Uint32_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint32_Index > result = calc_node_children(std::vector< uint32 >(1, 0xc0848404));
+ for (std::vector< Uint32_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ // Disabled due to their size.
+/* {
+ std::vector< uint32 > result = calc_node_children(std::vector< uint32 >(1, 0xc0848008));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_node_children(std::vector< uint32 >(1, 0xc0840010));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_node_children(std::vector< uint32 >(1, 0xc0800020));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_node_children(std::vector< uint32 >(1, 0xc0000040));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< idxs(2, 0x3f3f3f3f);
+ std::vector< Uint31_Index > result = calc_children(idxs);
+ for (std::vector< Uint31_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint31_Index > result = calc_children(std::vector< uint32 >(1, 0x40848400));
+ for (std::vector< Uint31_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint31_Index > result = calc_children(std::vector< uint32 >(1, 0xc0848401));
+ for (std::vector< Uint31_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint31_Index > result = calc_children(std::vector< uint32 >(1, 0xc0848402));
+ for (std::vector< Uint31_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ {
+ std::vector< Uint31_Index > result = calc_children(std::vector< uint32 >(1, 0xc0848404));
+ for (std::vector< Uint31_Index >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout<val()<<' ';
+ std::cout<<'\n';
+ }
+ }
+
+ if ((test_to_execute == "6") || (test_to_execute == ""))
+ {
+ std::cout<<"\nTest calc_parents:\n";
+
+ for (uint32 lat = 0; lat <= 0x100000; lat += 0x10000)
+ {
+ std::vector< uint32 > result = calc_parents(std::vector< uint32 >(1, ll_upper(lat, 0) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >(1, ll_upper(lat, 0) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >(1, ll_upper(lat, 0) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >(1, ll_upper(lat, 0) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >(1, ll_upper(0, lon) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >(1, ll_upper(0, lon) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >(1, ll_upper(0, lon) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >
+ (1, ll_upper(0, (int32)lon) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< result = calc_parents(std::vector< uint32 >
+ (1, ll_upper(0, (int32)lon) ^ 0x40000000));
+ for (std::vector< uint32 >::const_iterator it = result.begin(); it != result.end(); ++it)
+ std::cout< input(ll_upper(lat, 0) ^ 0x40000000, (ll_upper(lat, 0) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ for (uint32 lat = 0x40000000; lat <= 0x41000000; lat += 0x100000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(lat, 0) ^ 0x40000000, (ll_upper(lat, 0) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ for (uint32 lat = 0x40000000; lat <= 0x50000000; lat += 0x1000000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(lat, 0) ^ 0x40000000, (ll_upper(lat, 0) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ for (uint32 lat = 0x40000000; lat < 0x80000000; lat += 0x10000000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(lat, 0) ^ 0x40000000, (ll_upper(lat, 0) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+
+ for (int32 lon = 0; lon <= 0x100000; lon += 0x10000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(0x40000000, lon) ^ 0x40000000, (ll_upper(0x40000000, lon) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ for (int32 lon = 0; lon <= 0x1000000; lon += 0x100000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(0x40000000, lon) ^ 0x40000000,
+ (ll_upper(0x40000000, lon) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ for (int32 lon = 0; lon <= 0x10000000; lon += 0x1000000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(0x40000000, lon) ^ 0x40000000,
+ (ll_upper(0x40000000, lon) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ for (uint32 lon = 0; (uint32)lon < (uint32)0x80000000; lon += 0x10000000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(0x40000000ul, (int32)lon) ^ 0x40000000,
+ (ll_upper(0x40000000ul, (int32)lon) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ for (uint32 lon = 0x80000000; (uint32)lon != (uint32)0; lon += 0x10000000)
+ {
+ Ranges< Uint32_Index > input(ll_upper(0x40000000ul, (int32)lon) ^ 0x40000000,
+ (ll_upper(0x40000000ul, (int32)lon) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 1\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40010000, 0) ^ 0x40000000, (ll_upper(0x40010000, 0) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 2\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40020000, 0) ^ 0x40000000, (ll_upper(0x40030000, 0x10000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 3\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40040000, 0) ^ 0x40000000, (ll_upper(0x40070000, 0x30000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 4\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40080000, 0) ^ 0x40000000, (ll_upper(0x400f0000, 0x70000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 5\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40100000, 0) ^ 0x40000000, (ll_upper(0x401f0000, 0xf0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 6\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40200000, 0) ^ 0x40000000, (ll_upper(0x403f0000, 0x1f0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 7\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40400000, 0) ^ 0x40000000, (ll_upper(0x407f0000, 0x3f0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 8\n";
+ Ranges< Uint32_Index > input(ll_upper(0x40800000, 0) ^ 0x40000000, (ll_upper(0x40ff0000, 0x7f0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 9\n";
+ Ranges< Uint32_Index > input(ll_upper(0x41000000, 0) ^ 0x40000000, (ll_upper(0x41ff0000, 0xff0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 10\n";
+ Ranges< Uint32_Index > input(ll_upper(0x42000000, 0) ^ 0x40000000, (ll_upper(0x43ff0000, 0x1ff0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 11\n";
+ Ranges< Uint32_Index > input(ll_upper(0x44000000, 0) ^ 0x40000000, (ll_upper(0x47ff0000, 0x3ff0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 12\n";
+ Ranges< Uint32_Index > input(ll_upper(0x48000000, 0) ^ 0x40000000, (ll_upper(0x4fff0000, 0x7ff0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 13\n";
+ Ranges< Uint32_Index > input(ll_upper(0x50000000, 0) ^ 0x40000000, (ll_upper(0x5fff0000, 0xfff0000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Two Size 1\n";
+ Ranges< Uint32_Index > input(ll_upper(0x3fff0000, 0x7fff0000) ^ 0x40000000,
+ (ll_upper(0x40000000, 0) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 1 + Size 2\n";
+ Ranges< Uint32_Index > input(ll_upper(0x3fff0000, 0x7fff0000) ^ 0x40000000,
+ (ll_upper(0x40010000, 0x10000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 1 + Size 2 + Size 1\n";
+ Ranges< Uint32_Index > input(ll_upper(0x3fff0000, 0x7fff0000) ^ 0x40000000,
+ (ll_upper(0x40000000, 0x20000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 3 + Size 2 + Size 1\n";
+ Ranges< Uint32_Index > input(ll_upper(0x3ffc0000, 0x7ffc0000) ^ 0x40000000,
+ (ll_upper(0x40000000, 0x20000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ {
+ std::cout<<"Size 4 + Size 2 + Size 1\n";
+ Ranges< Uint32_Index > input(ll_upper(0x3ff80000, 0x7ff80000) ^ 0x40000000,
+ (ll_upper(0x40000000, 0x20000) ^ 0x40000000) + 1);
+ cout_ranges(calc_parents(input));
+ }
+ std::cout<<'\n';
+ }
+
+ return 0;
+}
diff --git a/src/overpass_api/dispatch/consistency_check.cc b/src/overpass_api/dispatch/consistency_check.cc
new file mode 100644
index 000000000..ba1fdd8e7
--- /dev/null
+++ b/src/overpass_api/dispatch/consistency_check.cc
@@ -0,0 +1,301 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include "../../expat/expat_justparse_interface.h"
+#include "../../template_db/dispatcher.h"
+#include "../frontend/console_output.h"
+#include "../frontend/user_interface.h"
+#include "../statements/statement.h"
+#include "resource_manager.h"
+#include "scripting_core.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+template< class TIndex, class Id_Type >
+struct Flat_Meta_Collector
+{
+ public:
+ Flat_Meta_Collector(Transaction& transaction, const File_Properties* meta_file_prop = 0);
+
+ void reset();
+ const OSM_Element_Metadata_Skeleton< Id_Type >* get(const TIndex& index, Id_Type ref);
+
+ ~Flat_Meta_Collector()
+ {
+ if (meta_db)
+ {
+ delete db_it;
+ delete meta_db;
+ }
+ }
+
+ private:
+ Block_Backend< TIndex, OSM_Element_Metadata_Skeleton< Id_Type > >* meta_db;
+ typename Block_Backend< TIndex, OSM_Element_Metadata_Skeleton< Id_Type > >::Flat_Iterator*
+ db_it;
+ TIndex* current_index;
+ std::map< OSM_Element_Metadata_Skeleton< Id_Type >, bool > current_objects;
+};
+
+/** Implementation --------------------------------------------------------- */
+
+template< class TIndex, class Id_Type >
+Flat_Meta_Collector< TIndex, Id_Type >::Flat_Meta_Collector
+ (Transaction& transaction, const File_Properties* meta_file_prop)
+ : meta_db(0), db_it(0), current_index(0)
+{
+ meta_db = new Block_Backend< TIndex, OSM_Element_Metadata_Skeleton< Id_Type > >
+ (transaction.data_index(meta_file_prop));
+
+ reset();
+}
+
+template< class TIndex, class Id_Type >
+void Flat_Meta_Collector< TIndex, Id_Type >::reset()
+{
+ if (!meta_db)
+ return;
+
+ if (db_it)
+ delete db_it;
+ if (current_index)
+ {
+ delete current_index;
+ current_index = 0;
+ }
+
+ db_it = new typename Block_Backend< TIndex, OSM_Element_Metadata_Skeleton< Id_Type > >
+ ::Flat_Iterator(meta_db->flat_begin());
+
+ if (!(*db_it == meta_db->flat_end()))
+ current_index = new TIndex(db_it->index());
+ while (!(*db_it == meta_db->flat_end()) && (*current_index == db_it->index()))
+ {
+ current_objects.insert(std::make_pair(db_it->object(), false));
+ ++(*db_it);
+ }
+}
+
+template< class TIndex, class Id_Type >
+const OSM_Element_Metadata_Skeleton< Id_Type >* Flat_Meta_Collector< TIndex, Id_Type >::get
+ (const TIndex& index, Id_Type ref)
+{
+ if (!meta_db)
+ return 0;
+
+ if ((current_index) && (*current_index < index))
+ {
+ for (typename std::map< OSM_Element_Metadata_Skeleton< Id_Type >, bool >::const_iterator
+ it = current_objects.begin(); it != current_objects.end(); ++it)
+ {
+ if (!it->second)
+ std::cout<<"Skipping meta data of "<first.ref.val()
+ <<" at "<val()<<'\n';
+ }
+ current_objects.clear();
+
+ while (!(*db_it == meta_db->flat_end()) && (db_it->index() < index))
+ {
+ std::cout<<"Skipping meta data of "<object().ref.val()
+ <<" at "<index().val()<<'\n';
+ ++(*db_it);
+ }
+ if (!(*db_it == meta_db->flat_end()))
+ *current_index = db_it->index();
+ while (!(*db_it == meta_db->flat_end()) && (*current_index == db_it->index()))
+ {
+ current_objects.insert(std::make_pair(db_it->object(), false));
+ ++(*db_it);
+ }
+ }
+
+ typename std::map< OSM_Element_Metadata_Skeleton< Id_Type >, bool >::iterator it
+ = current_objects.find(OSM_Element_Metadata_Skeleton< Id_Type >(ref));
+ it->second = true;
+ if (it != current_objects.end())
+ return &it->first;
+ else
+ return 0;
+}
+
+//-----------------------------------------------------------------------------
+
+int main(int argc, char *argv[])
+{
+ // read command line arguments
+ std::string db_dir;
+ uint log_level = Error_Output::ASSISTING;
+
+ int area_level = 0;
+
+ int argpos = 1;
+ while (argpos < argc)
+ {
+ if (!(strncmp(argv[argpos], "--db-dir=", 9)))
+ {
+ db_dir = ((std::string)argv[argpos]).substr(9);
+ if ((db_dir.size() > 0) && (db_dir[db_dir.size()-1] != '/'))
+ db_dir += '/';
+ }
+ else if (!(strcmp(argv[argpos], "--quiet")))
+ log_level = Error_Output::QUIET;
+ else if (!(strcmp(argv[argpos], "--concise")))
+ log_level = Error_Output::CONCISE;
+ else if (!(strcmp(argv[argpos], "--progress")))
+ log_level = Error_Output::PROGRESS;
+ else if (!(strcmp(argv[argpos], "--verbose")))
+ log_level = Error_Output::VERBOSE;
+ ++argpos;
+ }
+
+ Error_Output* error_output(new Console_Output(log_level));
+ Statement::set_error_output(error_output);
+
+ // connect to dispatcher and get database dir
+ try
+ {
+ // open read transaction and log this.
+ Parsed_Query global_settings;
+ Dispatcher_Stub dispatcher(
+ db_dir, error_output, "-- consistency check --\n", area_level,
+ 24*60*60, 1024*1024*1024, global_settings);
+ Resource_Manager& rman = dispatcher.resource_manager();
+
+ // perform check
+ {
+ uint32 count = 0;
+ Flat_Meta_Collector< Uint32_Index, Node::Id_Type > meta_collector
+ (*rman.get_transaction(), meta_settings().NODES_META);
+ Block_Backend< Uint32_Index, Node_Skeleton > db
+ (rman.get_transaction()->data_index(osm_base_settings().NODES));
+ for (Block_Backend< Uint32_Index, Node_Skeleton >::Flat_Iterator
+ it(db.flat_begin()); !(it == db.flat_end()); ++it)
+ {
+ if (++count >= 1000*1000)
+ {
+ dispatcher.ping();
+ count = 0;
+ std::cout<<"Processed 1000000 nodes.\n";
+ }
+ if (!meta_collector.get(it.index(), it.object().id))
+ std::cout<<"Missing meta data of "<data_index(props);
+ std::cout<<"ways_meta address "<* index =
+// dynamic_cast< Readonly_File_Blocks_Index< Uint31_Index >* >(index_base);
+ std::cout<<"ways_meta";
+// for (int i = 0; i < (int)index->get_void_blocks().size(); ++i)
+// std::cout<<' '<get_void_blocks()[i].first<<' '<get_void_blocks()[i].second;
+// std::cout<<'\n';
+ Flat_Meta_Collector< Uint31_Index, Way::Id_Type > meta_collector
+ (*rman.get_transaction(), props);
+ Block_Backend< Uint31_Index, Way_Skeleton > db
+ (rman.get_transaction()->data_index(osm_base_settings().WAYS));
+ for (Block_Backend< Uint31_Index, Way_Skeleton >::Flat_Iterator
+ it(db.flat_begin()); !(it == db.flat_end()); ++it)
+ {
+ if (++count >= 100*1000)
+ {
+ dispatcher.ping();
+ count = 0;
+ std::cout<<"Processed 100000 ways.\n";
+ }
+ if (!meta_collector.get(it.index(), it.object().id))
+ std::cout<<"Missing meta data of "< meta_collector
+ (*rman.get_transaction(), meta_settings().RELATIONS_META);
+ Block_Backend< Uint31_Index, Relation_Skeleton > db
+ (rman.get_transaction()->data_index(osm_base_settings().RELATIONS));
+ for (Block_Backend< Uint31_Index, Relation_Skeleton >::Flat_Iterator
+ it(db.flat_begin()); !(it == db.flat_end()); ++it)
+ {
+ if (++count >= 100*1000)
+ {
+ dispatcher.ping();
+ count = 0;
+ std::cout<<"Processed 100000 relations.\n";
+ }
+ if (!meta_collector.get(it.index(), it.object().id))
+ std::cout<<"Missing meta data of "<runtime_error(temp.str());
+ }
+
+ return 1;
+ }
+ catch(Resource_Error e)
+ {
+ std::ostringstream temp;
+ if (e.timed_out)
+ temp<<"Query timed out in \""<runtime_error(temp.str());
+
+ return 2;
+ }
+ catch(Exit_Error e)
+ {
+ return 3;
+ }
+}
diff --git a/src/overpass_api/osm-backend/compare_osm_base_maps.test.cc b/src/overpass_api/osm-backend/compare_osm_base_maps.test.cc
new file mode 100644
index 000000000..02c00ae7f
--- /dev/null
+++ b/src/overpass_api/osm-backend/compare_osm_base_maps.test.cc
@@ -0,0 +1,223 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "../../template_db/block_backend.h"
+#include "../../template_db/random_file.h"
+#include "../../template_db/transaction.h"
+#include "../core/datatypes.h"
+#include "../core/settings.h"
+
+
+// not const - sorts its container first and clears it afterwards.
+void clear_nodes_to_map(std::vector< std::pair< uint32, Uint32_Index > >& id_to_idx,
+ Nonsynced_Transaction& transaction)
+{
+ bool deviations_exist = false;
+
+ sort(id_to_idx.begin(), id_to_idx.end());
+
+ Random_File< Node_Skeleton::Id_Type, Uint32_Index > random
+ (transaction.random_index(osm_base_settings().NODES));
+
+ for (std::vector< std::pair< uint32, Uint32_Index > >::const_iterator it(id_to_idx.begin());
+ it != id_to_idx.end(); ++it)
+ {
+ if (!(random.get(it->first) == it->second))
+ {
+ deviations_exist = true;
+ std::cout<<"Node "<first<<":\tmap = "<first).val()
+ <<",\tbin = "<second.val()<<'\n';
+ }
+ }
+
+ if (!deviations_exist)
+ std::cout<<"For "< > id_to_idx;
+
+ Nonsynced_Transaction transaction(Access_Mode::readonly, false, db_dir, "");
+ Block_Backend< Uint32_Index, Node_Skeleton > nodes_db
+ (transaction.data_index(osm_base_settings().NODES));
+ for (Block_Backend< Uint32_Index, Node_Skeleton >::Flat_Iterator
+ it(nodes_db.flat_begin()); !(it == nodes_db.flat_end()); ++it)
+ {
+ id_to_idx.push_back(std::make_pair(it.object().id.val(), it.index()));
+ if (id_to_idx.size() > 16*1024*1024)
+ clear_nodes_to_map(id_to_idx, transaction);
+ }
+ clear_nodes_to_map(id_to_idx, transaction);
+}
+
+// not const - sorts its container first and clears it afterwards.
+void clear_ways_to_map(std::vector< std::pair< uint32, Uint31_Index > >& id_to_idx,
+ Nonsynced_Transaction& transaction)
+{
+ bool deviations_exist = false;
+
+ sort(id_to_idx.begin(), id_to_idx.end());
+
+ Random_File< Way_Skeleton::Id_Type, Uint31_Index > random
+ (transaction.random_index(osm_base_settings().WAYS));
+
+ for (std::vector< std::pair< uint32, Uint31_Index > >::const_iterator it(id_to_idx.begin());
+ it != id_to_idx.end(); ++it)
+ {
+ if (!(random.get(it->first) == it->second))
+ {
+ deviations_exist = true;
+ std::cout<<"Way "<first<<":\tmap = "<first).val()
+ <<",\tbin = "<second.val()<<'\n';
+ }
+ }
+
+ if (!deviations_exist)
+ std::cout<<"For "< > id_to_idx;
+
+ Nonsynced_Transaction transaction(Access_Mode::readonly, false, db_dir, "");
+ Block_Backend< Uint31_Index, Way_Skeleton > ways_db
+ (transaction.data_index(osm_base_settings().WAYS));
+ for (Block_Backend< Uint31_Index, Way_Skeleton >::Flat_Iterator
+ it(ways_db.flat_begin()); !(it == ways_db.flat_end()); ++it)
+ {
+ id_to_idx.push_back(std::make_pair(it.object().id.val(), it.index()));
+ if (id_to_idx.size() > 16*1024*1024)
+ clear_ways_to_map(id_to_idx, transaction);
+ }
+ clear_ways_to_map(id_to_idx, transaction);
+}
+
+// not const - sorts its container first and clears it afterwards.
+void clear_relations_to_map(std::vector< std::pair< uint32, Uint31_Index > >& id_to_idx,
+ Nonsynced_Transaction& transaction)
+{
+ bool deviations_exist = false;
+
+ sort(id_to_idx.begin(), id_to_idx.end());
+
+ Random_File< Relation_Skeleton::Id_Type, Uint31_Index > random
+ (transaction.random_index(osm_base_settings().RELATIONS));
+
+ for (std::vector< std::pair< uint32, Uint31_Index > >::const_iterator it(id_to_idx.begin());
+ it != id_to_idx.end(); ++it)
+ {
+ if (!(random.get(it->first) == it->second))
+ {
+ deviations_exist = true;
+ std::cout<<"Relation "<first<<":\tmap = "<first).val()
+ <<",\tbin = "<second.val()<<'\n';
+ }
+ }
+
+ if (!deviations_exist)
+ std::cout<<"For "< > id_to_idx;
+
+ Nonsynced_Transaction transaction(Access_Mode::readonly, false, db_dir, "");
+ Block_Backend< Uint31_Index, Relation_Skeleton > relations_db
+ (transaction.data_index(osm_base_settings().RELATIONS));
+ for (Block_Backend< Uint31_Index, Relation_Skeleton >::Flat_Iterator
+ it(relations_db.flat_begin()); !(it == relations_db.flat_end()); ++it)
+ {
+ id_to_idx.push_back(std::make_pair(it.object().id.val(), it.index()));
+ if (id_to_idx.size() > 16*1024*1024)
+ clear_relations_to_map(id_to_idx, transaction);
+ }
+ clear_relations_to_map(id_to_idx, transaction);
+}
+
+int main(int argc, char* args[])
+{
+ // read command line arguments
+ std::string db_dir;
+
+ int argpos(1);
+ while (argpos < argc)
+ {
+ if (!(strncmp(args[argpos], "--db-dir=", 9)))
+ {
+ db_dir = ((std::string)args[argpos]).substr(9);
+ if ((db_dir.size() > 0) && (db_dir[db_dir.size()-1] != '/'))
+ db_dir += '/';
+ }
+ ++argpos;
+ }
+
+ try
+ {
+ dump_nodes(db_dir);
+ }
+ catch (File_Error e)
+ {
+ std::cerr<<"compare_osm_base_maps: File error caught: "
+ <.
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "../../template_db/block_backend.h"
+#include "../../template_db/random_file.h"
+#include "../../template_db/transaction.h"
+#include "../core/datatypes.h"
+#include "../core/settings.h"
+
+
+struct Output_Sorter
+{
+ std::vector< std::string > output_per_index;
+ uint32 last_index;
+
+ Output_Sorter() : last_index(0) {}
+
+ void sort_and_output_if_index_changed(uint32 index)
+ {
+ if (index != last_index)
+ {
+ sort(output_per_index.begin(), output_per_index.end());
+ for (std::vector< std::string >::const_iterator it(output_per_index.begin());
+ it != output_per_index.end(); ++it)
+ std::cout<<*it;
+ output_per_index.clear();
+ last_index = index;
+ }
+ }
+
+ ~Output_Sorter()
+ {
+ sort(output_per_index.begin(), output_per_index.end());
+ for (std::vector< std::string >::const_iterator it(output_per_index.begin());
+ it != output_per_index.end(); ++it)
+ std::cout<<*it;
+ }
+};
+
+struct Output_Sorter_Kv
+{
+ std::vector< std::string > output_per_index;
+ std::pair< std::string, std::string > last_index;
+
+ Output_Sorter_Kv() {}
+
+ void sort_and_output_if_index_changed(const std::pair< std::string, std::string >& index)
+ {
+ if (index != last_index)
+ {
+ sort(output_per_index.begin(), output_per_index.end());
+ for (std::vector< std::string >::const_iterator it(output_per_index.begin());
+ it != output_per_index.end(); ++it)
+ std::cout<<*it;
+ output_per_index.clear();
+ last_index = index;
+ }
+ }
+
+ ~Output_Sorter_Kv()
+ {
+ sort(output_per_index.begin(), output_per_index.end());
+ for (std::vector< std::string >::const_iterator it(output_per_index.begin());
+ it != output_per_index.end(); ++it)
+ std::cout<<*it;
+ }
+};
+
+void dump_nodes(uint32 pattern_size, std::string db_dir)
+{
+ Output_Sorter output_sorter;
+
+ Nonsynced_Transaction transaction(Access_Mode::readonly, false, db_dir, "");
+ Block_Backend< Uint32_Index, Node_Skeleton > nodes_db
+ (transaction.data_index(osm_base_settings().NODES));
+ for (Block_Backend< Uint32_Index, Node_Skeleton >::Flat_Iterator
+ it(nodes_db.flat_begin()); !(it == nodes_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed(it.index().val());
+ std::ostringstream buf;
+ buf< nodes_local_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(nodes_local_db.flat_begin());
+ !(it == nodes_local_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed(it.index().index);
+ std::ostringstream buf;
+ buf< > nodes_global_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_global_db.flat_begin());
+ !(it == nodes_global_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed
+ (std::make_pair(it.index().key, it.index().value));
+ std::ostringstream buf;
+ buf< ways_db
+ (transaction.data_index(osm_base_settings().WAYS));
+ for (Block_Backend< Uint31_Index, Way_Skeleton >::Flat_Iterator
+ it(ways_db.flat_begin()); !(it == ways_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed(it.index().val());
+ std::ostringstream buf;
+ buf< ways_local_db
+ (transaction.data_index(osm_base_settings().WAY_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(ways_local_db.flat_begin());
+ !(it == ways_local_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed(it.index().index);
+ std::ostringstream buf;
+ buf< > ways_global_db
+ (transaction.data_index(osm_base_settings().WAY_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Way_Skeleton::Id_Type > >::Flat_Iterator
+ it(ways_global_db.flat_begin());
+ !(it == ways_global_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed
+ (std::make_pair(it.index().key, it.index().value));
+ std::ostringstream buf;
+ buf< roles;
+ Block_Backend< Uint32_Index, String_Object > roles_db
+ (transaction.data_index(osm_base_settings().RELATION_ROLES));
+ for (Block_Backend< Uint32_Index, String_Object >::Flat_Iterator
+ it(roles_db.flat_begin()); !(it == roles_db.flat_end()); ++it)
+ roles[it.index().val()] = it.object().val();
+
+ Block_Backend< Uint31_Index, Relation_Skeleton > relations_db
+ (transaction.data_index(osm_base_settings().RELATIONS));
+ for (Block_Backend< Uint31_Index, Relation_Skeleton >::Flat_Iterator
+ it(relations_db.flat_begin()); !(it == relations_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed(it.index().val());
+ std::ostringstream buf;
+ buf< relations_local_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(relations_local_db.flat_begin());
+ !(it == relations_local_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed(it.index().index);
+ std::ostringstream buf;
+ buf< > relations_global_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Relation_Skeleton::Id_Type > >::Flat_Iterator
+ it(relations_global_db.flat_begin());
+ !(it == relations_global_db.flat_end()); ++it)
+ {
+ output_sorter.sort_and_output_if_index_changed
+ (std::make_pair(it.index().key, it.index().value));
+ std::ostringstream buf;
+ buf< 0) && (db_dir[db_dir.size()-1] != '/'))
+ db_dir += '/';
+ }
+ else if (!(strncmp(args[argpos], "--pattern_size=", 15)))
+ pattern_size = atol(((std::string)args[argpos]).substr(15).c_str());
+ ++argpos;
+ }
+
+ if (pattern_size == 0)
+ {
+ std::cerr<<"Pattern size must be nonzero.\n";
+ return -1;
+ }
+
+ try
+ {
+ dump_nodes(pattern_size, db_dir);
+ dump_node_tags_local(pattern_size, db_dir);
+ dump_node_tags_global(pattern_size, db_dir);
+ dump_ways(pattern_size, db_dir);
+ dump_way_tags_local(pattern_size, db_dir);
+ dump_way_tags_global(pattern_size, db_dir);
+ dump_relations(pattern_size, db_dir);
+ dump_relation_tags_local(pattern_size, db_dir);
+ dump_relation_tags_global(pattern_size, db_dir);
+ }
+ catch (File_Error e)
+ {
+ std::cerr<<"File error caught: "
+ <.
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "../../template_db/random_file.h"
+#include "../../expat/expat_justparse_interface.h"
+#include "../core/settings.h"
+#include "../frontend/output.h"
+#include "node_updater.h"
+#include "relation_updater.h"
+#include "way_updater.h"
+
+
+uint32 osm_element_count;
+
+struct Ofstream_Collection
+{
+ std::vector< std::ofstream* > streams;
+ std::string prefix;
+ std::string postfix;
+
+ Ofstream_Collection(std::string prefix_, std::string postfix_)
+ : prefix(prefix_), postfix(postfix_) {}
+
+ std::ofstream* get(uint32 i)
+ {
+ while (streams.size() <= i)
+ {
+ std::ostringstream buf("");
+ buf<::iterator it(streams.begin());
+ it != streams.end(); ++it)
+ {
+ (*it)->close();
+ delete (*it);
+ }
+ }
+};
+
+void dump_nodes(Transaction& transaction, const std::string& db_dir, uint64 divisor, bool attic)
+{
+ Ofstream_Collection node_db_out(db_dir + "after_node_", "_db.csv");
+ Ofstream_Collection node_tags_local_out(db_dir + "after_node_tags_", "_local.csv");
+ Ofstream_Collection node_tags_global_out(db_dir + "after_node_tags_", "_global.csv");
+
+ Block_Backend< Uint32_Index, Node_Skeleton > nodes_db
+ (transaction.data_index(osm_base_settings().NODES));
+ for (Block_Backend< Uint32_Index, Node_Skeleton >::Flat_Iterator
+ it(nodes_db.flat_begin()); !(it == nodes_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_db_out.get(it.object().id.val() / divisor));
+ (*out)< nodes_local_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Node_Skeleton::Id_Type >::Flat_Iterator
+ it(nodes_local_db.flat_begin());
+ !(it == nodes_local_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_tags_local_out.get(it.object().val() / divisor));
+ (*out)< > nodes_global_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_global_db.flat_begin());
+ !(it == nodes_global_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_tags_global_out.get(it.object().id.val() / divisor));
+ (*out)< > nodes_meta_db
+ (transaction.data_index(meta_settings().NODES_META));
+ for (Block_Backend< Uint31_Index, OSM_Element_Metadata_Skeleton< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_meta_db.flat_begin()); !(it == nodes_meta_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_meta_db_out.get(it.object().ref.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < > nodes_db
+ (transaction.data_index(attic_settings().NODES));
+ for (Block_Backend< Uint31_Index, Attic< Node_Skeleton > >::Flat_Iterator
+ it(nodes_db.flat_begin()); !(it == nodes_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_attic_db_out.get(it.object().id.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < > nodes_undeleted_db
+ (transaction.data_index(attic_settings().NODES_UNDELETED));
+ for (Block_Backend< Uint31_Index, Attic< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_undeleted_db.flat_begin()); !(it == nodes_undeleted_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_undeleted_db_out.get(it.object().val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < idx_db
+ (transaction.data_index(attic_settings().NODE_IDX_LIST));
+ for (Block_Backend< Node::Id_Type, Uint31_Index >::Flat_Iterator
+ it(idx_db.flat_begin()); !(it == idx_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_idx_list_out.get(it.index().val() / divisor));
+ (*out)< > nodes_attic_meta_db
+ (transaction.data_index(attic_settings().NODES_META));
+ for (Block_Backend< Uint31_Index, OSM_Element_Metadata_Skeleton< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_attic_meta_db.flat_begin()); !(it == nodes_attic_meta_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_attic_meta_db_out.get(it.object().ref.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < > nodes_local_db
+ (transaction.data_index(attic_settings().NODE_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Attic< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_local_db.flat_begin());
+ !(it == nodes_local_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_attic_tags_local_out.get(it.object().val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\n';
+ }
+
+ Block_Backend< Tag_Index_Global, Attic< Tag_Object_Global< Node_Skeleton::Id_Type > > > nodes_global_db
+ (transaction.data_index(attic_settings().NODE_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Attic< Tag_Object_Global< Node_Skeleton::Id_Type > > >::Flat_Iterator
+ it(nodes_global_db.flat_begin());
+ !(it == nodes_global_db.flat_end()); ++it)
+ {
+ std::ofstream* out(node_attic_tags_global_out.get(it.object().id.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\n';
+ }
+ }
+}
+
+void check_nodes(Transaction& transaction)
+{
+ uint element_count = 0;
+ std::ofstream out("/dev/null");
+
+ Block_Backend< Uint32_Index, Node_Skeleton > nodes_db
+ (transaction.data_index(osm_base_settings().NODES));
+ for (Block_Backend< Uint32_Index, Node_Skeleton >::Flat_Iterator
+ it(nodes_db.flat_begin()); !(it == nodes_db.flat_end()); ++it)
+ {
+ out< nodes_local_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(nodes_local_db.flat_begin());
+ !(it == nodes_local_db.flat_end()); ++it)
+ {
+ out< > nodes_global_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_global_db.flat_begin());
+ !(it == nodes_global_db.flat_end()); ++it)
+ {
+ out< ways_db
+ (transaction.data_index(osm_base_settings().WAYS));
+ for (Block_Backend< Uint31_Index, Way_Skeleton >::Flat_Iterator
+ it(ways_db.flat_begin()); !(it == ways_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_db_out.get(it.object().id.val() / divisor));
+ (*out)< ways_local_db
+ (transaction.data_index(osm_base_settings().WAY_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(ways_local_db.flat_begin());
+ !(it == ways_local_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_tags_local_out.get(it.object().val() / divisor));
+ (*out)< > ways_global_db
+ (transaction.data_index(osm_base_settings().WAY_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Way_Skeleton::Id_Type > >::Flat_Iterator
+ it(ways_global_db.flat_begin());
+ !(it == ways_global_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_tags_global_out.get(it.object().id.val() / divisor));
+ (*out)< > ways_meta_db
+ (transaction.data_index(meta_settings().WAYS_META));
+ for (Block_Backend< Uint31_Index, OSM_Element_Metadata_Skeleton< Way_Skeleton::Id_Type > >::Flat_Iterator
+ it(ways_meta_db.flat_begin()); !(it == ways_meta_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_meta_db_out.get(it.object().ref.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < > ways_db
+ (transaction.data_index(attic_settings().WAYS));
+ for (Block_Backend< Uint31_Index, Attic< Way_Delta > >::Flat_Iterator
+ it(ways_db.flat_begin()); !(it == ways_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_attic_db_out.get(it.object().id.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < > ways_undeleted_db
+ (transaction.data_index(attic_settings().WAYS_UNDELETED));
+ for (Block_Backend< Uint31_Index, Attic< Way_Skeleton::Id_Type > >::Flat_Iterator
+ it(ways_undeleted_db.flat_begin()); !(it == ways_undeleted_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_undeleted_db_out.get(it.object().val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < idx_db
+ (transaction.data_index(attic_settings().WAY_IDX_LIST));
+ for (Block_Backend< Way::Id_Type, Uint31_Index >::Flat_Iterator
+ it(idx_db.flat_begin()); !(it == idx_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_idx_list_out.get(it.index().val() / divisor));
+ (*out)< > ways_attic_meta_db
+ (transaction.data_index(attic_settings().WAYS_META));
+ for (Block_Backend< Uint31_Index, OSM_Element_Metadata_Skeleton< Way_Skeleton::Id_Type > >::Flat_Iterator
+ it(ways_attic_meta_db.flat_begin()); !(it == ways_attic_meta_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_attic_meta_db_out.get(it.object().ref.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\t'
+ < > ways_local_db
+ (transaction.data_index(attic_settings().WAY_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Attic< Way_Skeleton::Id_Type > >::Flat_Iterator
+ it(ways_local_db.flat_begin());
+ !(it == ways_local_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_attic_tags_local_out.get(it.object().val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\n';
+ }
+
+ Block_Backend< Tag_Index_Global, Attic< Tag_Object_Global< Way_Skeleton::Id_Type > > > ways_global_db
+ (transaction.data_index(attic_settings().WAY_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Attic< Tag_Object_Global< Way_Skeleton::Id_Type > > >::Flat_Iterator
+ it(ways_global_db.flat_begin());
+ !(it == ways_global_db.flat_end()); ++it)
+ {
+ std::ofstream* out(way_attic_tags_global_out.get(it.object().id.val() / divisor));
+ (*out)<>26)<<' '
+ <<((it.object().timestamp & 0x3c00000)>>22)<<' '
+ <<((it.object().timestamp & 0x3e0000)>>17)<<' '
+ <<((it.object().timestamp & 0x1f000)>>12)<<' '
+ <<((it.object().timestamp & 0xfc0)>>6)<<' '
+ <<(it.object().timestamp & 0x3f)<<'\n';
+ }
+ }
+}
+
+void check_ways(Transaction& transaction)
+{
+ uint element_count = 0;
+ std::ofstream out("/dev/null");
+
+ // check update_members - compare both files for the result
+ Block_Backend< Uint31_Index, Way_Skeleton > ways_db
+ (transaction.data_index(osm_base_settings().WAYS));
+ for (Block_Backend< Uint31_Index, Way_Skeleton >::Flat_Iterator
+ it(ways_db.flat_begin()); !(it == ways_db.flat_end()); ++it)
+ {
+ out< ways_local_db
+ (transaction.data_index(osm_base_settings().WAY_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(ways_local_db.flat_begin());
+ !(it == ways_local_db.flat_end()); ++it)
+ {
+ out< > ways_global_db
+ (transaction.data_index(osm_base_settings().WAY_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Way_Skeleton::Id_Type > >::Flat_Iterator
+ it(ways_global_db.flat_begin());
+ !(it == ways_global_db.flat_end()); ++it)
+ {
+ out< roles;
+ Block_Backend< Uint32_Index, String_Object > roles_db
+ (transaction.data_index(osm_base_settings().RELATION_ROLES));
+ for (Block_Backend< Uint32_Index, String_Object >::Flat_Iterator
+ it(roles_db.flat_begin()); !(it == roles_db.flat_end()); ++it)
+ roles[it.index().val()] = it.object().val();
+
+ // check update_members - compare both files for the result
+ Block_Backend< Uint31_Index, Relation_Skeleton > relations_db
+ (transaction.data_index(osm_base_settings().RELATIONS));
+ for (Block_Backend< Uint31_Index, Relation_Skeleton >::Flat_Iterator
+ it(relations_db.flat_begin()); !(it == relations_db.flat_end()); ++it)
+ {
+ std::ofstream* out(relation_db_out.get(it.object().id.val() / divisor));
+ (*out)< relations_local_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(relations_local_db.flat_begin());
+ !(it == relations_local_db.flat_end()); ++it)
+ {
+ std::ofstream* out(relation_tags_local_out.get(it.object().val() / divisor));
+ (*out)< > relations_global_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Relation_Skeleton::Id_Type > >::Flat_Iterator
+ it(relations_global_db.flat_begin());
+ !(it == relations_global_db.flat_end()); ++it)
+ {
+ std::ofstream* out(relation_tags_global_out.get(it.object().id.val() / divisor));
+ (*out)< roles;
+ Block_Backend< Uint32_Index, String_Object > roles_db
+ (transaction.data_index(osm_base_settings().RELATION_ROLES));
+ for (Block_Backend< Uint32_Index, String_Object >::Flat_Iterator
+ it(roles_db.flat_begin()); !(it == roles_db.flat_end()); ++it)
+ roles[it.index().val()] = it.object().val();
+
+ // check update_members - compare both files for the result
+ Block_Backend< Uint31_Index, Relation_Skeleton > relations_db
+ (transaction.data_index(osm_base_settings().RELATIONS));
+ for (Block_Backend< Uint31_Index, Relation_Skeleton >::Flat_Iterator
+ it(relations_db.flat_begin()); !(it == relations_db.flat_end()); ++it)
+ {
+ out< relations_local_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(relations_local_db.flat_begin());
+ !(it == relations_local_db.flat_end()); ++it)
+ {
+ out< > relations_global_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Relation_Skeleton::Id_Type > >::Flat_Iterator
+ it(relations_global_db.flat_begin());
+ !(it == relations_global_db.flat_end()); ++it)
+ {
+ out< 0) && (db_dir[db_dir.size()-1] != '/'))
+ db_dir += '/';
+ }
+ else if (!(strncmp(argv[argpos], "--only-check", 12)))
+ dump = false;
+ else if (!(strncmp(argv[argpos], "--attic", 7)))
+ attic = true;
+ ++argpos;
+ }
+
+ try
+ {
+ Nonsynced_Transaction transaction(Access_Mode::readonly, false, db_dir, "");
+ if (dump)
+ {
+ dump_nodes(transaction, db_dir, 10000000000, attic);
+ dump_ways(transaction, db_dir, 1000000000, attic);
+ dump_relations(transaction, db_dir, 1000000000);
+ }
+ else
+ {
+ check_nodes(transaction);
+ check_ways(transaction);
+ check_relations(transaction);
+ }
+ }
+ catch (File_Error e)
+ {
+ report_file_error(e);
+ }
+
+ return 0;
+}
diff --git a/src/overpass_api/osm-backend/generate_test_file.cc b/src/overpass_api/osm-backend/generate_test_file.cc
new file mode 100644
index 000000000..3b6b72701
--- /dev/null
+++ b/src/overpass_api/osm-backend/generate_test_file.cc
@@ -0,0 +1,5736 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+typedef unsigned int uint;
+typedef unsigned long long uint64;
+
+template < typename T >
+struct V : public std::vector< T >
+{
+ V(const T& t) : std::vector< T >(1, t) {}
+ V& operator()(const T& t)
+ {
+ this->push_back(t);
+ return *this;
+ }
+};
+
+struct Data_Modifier
+{
+ virtual ~Data_Modifier() {}
+
+ virtual bool admit_node(uint id) const = 0;
+ virtual bool admit_node_skeleton(uint id) const = 0;
+ virtual bool admit_node_tags(uint id) const = 0;
+ virtual bool admit_way(uint id) const = 0;
+ virtual bool admit_way_skeleton(uint id) const = 0;
+ virtual bool admit_way_tags(uint id) const = 0;
+ virtual bool admit_relation(uint id) const = 0;
+ virtual bool admit_relation_skeleton(uint id) const = 0;
+ virtual bool admit_relation_tags(uint id) const = 0;
+};
+
+struct Accept_All_Tags : public Data_Modifier
+{
+ virtual bool admit_node_skeleton(uint id) const { return true; }
+ virtual bool admit_node_tags(uint id) const { return true; }
+ virtual bool admit_way_skeleton(uint id) const { return true; }
+ virtual bool admit_way_tags(uint id) const { return true; }
+ virtual bool admit_relation_skeleton(uint id) const { return true; }
+ virtual bool admit_relation_tags(uint id) const { return true; }
+};
+
+struct Accept_All : public Accept_All_Tags
+{
+ virtual bool admit_node(uint id) const { return true; }
+ virtual bool admit_node_skeleton(uint id) const { return true; }
+ virtual bool admit_node_tags(uint id) const { return true; }
+ virtual bool admit_way(uint id) const { return true; }
+ virtual bool admit_way_skeleton(uint id) const { return true; }
+ virtual bool admit_way_tags(uint id) const { return true; }
+ virtual bool admit_relation(uint id) const { return true; }
+ virtual bool admit_relation_skeleton(uint id) const { return true; }
+ virtual bool admit_relation_tags(uint id) const { return true; }
+};
+
+struct Accept_Print_1 : public Accept_All_Tags
+{
+ virtual bool admit_node(uint id) const { return (id % 10000 == 0); }
+ virtual bool admit_way(uint id) const { return (id % 1000 == 0); }
+ virtual bool admit_relation(uint id) const { return (id % 4 == 0); }
+};
+
+struct Accept_Print_2 : public Data_Modifier
+{
+ virtual bool admit_node(uint id) const { return (id % 10000 == 0); }
+ virtual bool admit_node_skeleton(uint id) const { return true; }
+ virtual bool admit_node_tags(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 1000 == 0); }
+ virtual bool admit_way_skeleton(uint id) const { return true; }
+ virtual bool admit_way_tags(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 4 == 0); }
+ virtual bool admit_relation_skeleton(uint id) const { return true; }
+ virtual bool admit_relation_tags(uint id) const { return false; }
+};
+
+struct Accept_Print_3 : public Data_Modifier
+{
+ virtual bool admit_node(uint id) const { return (id % 10000 == 0); }
+ virtual bool admit_node_skeleton(uint id) const { return false; }
+ virtual bool admit_node_tags(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 1000 == 0); }
+ virtual bool admit_way_skeleton(uint id) const { return false; }
+ virtual bool admit_way_tags(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 4 == 0); }
+ virtual bool admit_relation_skeleton(uint id) const { return false; }
+ virtual bool admit_relation_tags(uint id) const { return false; }
+};
+
+struct Accept_Recurse_1 : public Accept_All_Tags
+{
+ Accept_Recurse_1(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size) && (id <= pattern_size*3/2+1)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_2 : public Accept_All_Tags
+{
+ Accept_Recurse_2(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id % pattern_size == pattern_size/2+1)
+ && (id < 2*pattern_size*pattern_size)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_3 : public Accept_All_Tags
+{
+ Accept_Recurse_3(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Recurse_4 : public Accept_All_Tags
+{
+ Accept_Recurse_4(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ { return (id == pattern_size*pattern_size - pattern_size/2); }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_5 : public Accept_All_Tags
+{
+ Accept_Recurse_5(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ { return (id <= pattern_size*(pattern_size/2-1)); }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_6 : public Accept_All_Tags
+{
+ Accept_Recurse_6(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id == 1) || (id == 2)
+ || (id == pattern_size+1) || (id == pattern_size+2)
+ || (id == pattern_size*pattern_size)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_7 : public Accept_All_Tags
+{
+ Accept_Recurse_7(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ { return ((id == 2) || (id == 8) || (id == 10) || (id == 11)); }
+};
+
+struct Accept_Recurse_8 : public Accept_All_Tags
+{
+ Accept_Recurse_8(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ { return ((id == 1) || (id == 2)
+ || (id == pattern_size/2*(pattern_size/2-1) + 1)
+ || (id == pattern_size/2*(pattern_size/2+1) + 1)); }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_9 : public Accept_All_Tags
+{
+ Accept_Recurse_9(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ { return ((id == 6) || (id == 8) || (id == 10)); }
+};
+
+struct Accept_Recurse_10 : public Accept_All_Tags
+{
+ Accept_Recurse_10(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ { return ((id == 1) || (id == 2)); }
+};
+
+struct Accept_Recurse_11 : public Accept_All_Tags
+{
+ Accept_Recurse_11(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ { return ((id == 9) || (id == 10)); }
+};
+
+struct Accept_Recurse_12 : public Accept_All_Tags
+{
+ Accept_Recurse_12(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 1 || id == pattern_size + 2);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_13 : public Accept_All_Tags
+{
+ Accept_Recurse_13(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 2
+ || id == pattern_size + 1 || id == pattern_size + 2 || id == pattern_size + 3
+ || id == 2*pattern_size + 4 || id == 3*pattern_size + 4);
+ }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4 + pattern_size/2 + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_14 : public Accept_All_Tags
+{
+ Accept_Recurse_14(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 1 || id == 2 || id == pattern_size
+ || id == pattern_size + 1 || id == pattern_size + 2 || id == pattern_size + 3
+ || id == 2*pattern_size + 4 || id == 3*pattern_size + 4
+ || id == pattern_size*pattern_size/4
+ || id == pattern_size*pattern_size - pattern_size
+ || id == pattern_size*pattern_size);
+ }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4 + pattern_size/2 + 1);
+ }
+ virtual bool admit_relation(uint id) const
+ {
+ return ((id >= 1 && id <= 6) || id == 9);
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_15 : public Accept_All_Tags
+{
+ Accept_Recurse_15(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size + 1 || id == pattern_size + 2 || id == pattern_size + 3
+ || id == 2*pattern_size + 4 || id == 3*pattern_size + 4);
+ }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4 + pattern_size/2 + 1);
+ }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 1 || id == 2 || id == 10);
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_16 : public Accept_All_Tags
+{
+ Accept_Recurse_16(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4);
+ }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 1 || id == 2 || id == 6 || id == 8 || id == 10 || id == 11);
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_17 : public Accept_All_Tags
+{
+ Accept_Recurse_17(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 6 || id == 8 || id == 10);
+ }
+};
+
+struct Accept_Recurse_18 : public Accept_All_Tags
+{
+ Accept_Recurse_18(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == pattern_size*pattern_size/4 - pattern_size/2 + 1);
+ }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 2 || id == 6 || id == 8 || id == 9 || id == 10 || id == 11);
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_19 : public Accept_All_Tags
+{
+ Accept_Recurse_19(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 6 || id == 8 || id == 9 || id == 10);
+ }
+};
+
+struct Accept_Recurse_20 : public Accept_All_Tags
+{
+ Accept_Recurse_20(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 1 || id == 9 || id == 10);
+ }
+};
+
+struct Accept_Recurse_21 : public Accept_All_Tags
+{
+ Accept_Recurse_21(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == pattern_size + 1 || id == pattern_size + 2);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_23 : public Accept_All_Tags
+{
+ Accept_Recurse_23(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 1);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Recurse_24 : public Accept_All_Tags
+{
+ Accept_Recurse_24(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 11);
+ }
+};
+
+struct Accept_Recurse_25 : public Accept_All_Tags
+{
+ Accept_Recurse_25(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == pattern_size*(pattern_size/2-1) + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_26 : public Accept_All_Tags
+{
+ Accept_Recurse_26(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 6 || id == 8 || id == 10);
+ }
+};
+
+struct Accept_Recurse_27 : public Accept_All_Tags
+{
+ Accept_Recurse_27(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 3);
+ }
+};
+
+struct Accept_Recurse_28 : public Accept_All_Tags
+{
+ Accept_Recurse_28(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 9);
+ }
+};
+
+struct Accept_Recurse_29 : public Accept_All_Tags
+{
+ Accept_Recurse_29(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == 2 || (pattern_size + 1 <= id && id <= pattern_size + 4); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_30 : public Accept_All_Tags
+{
+ Accept_Recurse_30(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == pattern_size + 3; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_31 : public Accept_All_Tags
+{
+ Accept_Recurse_31(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Recurse_34 : public Accept_All_Tags
+{
+ Accept_Recurse_34(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == pattern_size/2 + 1 || id == pattern_size/2 + 2
+ || id == pattern_size*pattern_size - pattern_size/2 + 1 || id == pattern_size*pattern_size - pattern_size/2 + 2
+ || id == pattern_size*pattern_size/2 + 1 || id == pattern_size*pattern_size/2 + pattern_size
+ || id == pattern_size*pattern_size/2 + pattern_size + 1 || id == pattern_size*pattern_size/2 + 2*pattern_size; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_35 : public Accept_All_Tags
+{
+ Accept_Recurse_35(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return
+ ((pattern_size*pattern_size/2 + 2 <= id && id <= pattern_size*pattern_size/2 + 2*pattern_size - 1)
+ || (pattern_size < id && id < pattern_size*(pattern_size - 1) &&
+ (id % pattern_size == pattern_size/2 + 1 || id % pattern_size == pattern_size/2 + 2)))
+ && id != pattern_size*pattern_size/2 + pattern_size/2 + 1
+ && id != pattern_size*pattern_size/2 + pattern_size/2 + 2
+ && id != pattern_size*pattern_size/2 + pattern_size
+ && id != pattern_size*pattern_size/2 + pattern_size + 1
+ && id != pattern_size*pattern_size/2 + 3*pattern_size/2 + 1
+ && id != pattern_size*pattern_size/2 + 3*pattern_size/2 + 2; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Recurse_36 : public Accept_All_Tags
+{
+ Accept_Recurse_36(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == pattern_size*pattern_size/2 + pattern_size/2 + 1
+ || id == pattern_size*pattern_size/2 + pattern_size/2 + 2
+ || id == pattern_size*pattern_size/2 + 3*pattern_size/2 + 1
+ || id == pattern_size*pattern_size/2 + 3*pattern_size/2 + 2; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Bbox_Query_1 : public Accept_All_Tags
+{
+ Accept_Bbox_Query_1(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size*6/5)
+ && (id % pattern_size > 0)
+ && (id % pattern_size <= pattern_size/5)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Bbox_Query_2 : public Accept_All_Tags
+{
+ Accept_Bbox_Query_2(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size*11/10)
+ && (id % pattern_size > 0)
+ && (id % pattern_size <= pattern_size/10)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Bbox_Query_3 : public Accept_All_Tags
+{
+ Accept_Bbox_Query_3(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size*11/10)
+ && ((id-1) % pattern_size >= pattern_size*9/10)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Bbox_Query_4 : public Accept_All_Tags
+{
+ Accept_Bbox_Query_4(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size*11/10)
+ && ((id % pattern_size > pattern_size*9/10)
+ || (id % pattern_size <= pattern_size/10))); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Bbox_Query_5 : public Accept_All_Tags
+{
+ Accept_Bbox_Query_5(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Bbox_Query_6 : public Accept_All_Tags
+{
+ Accept_Bbox_Query_6(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size*11/10)
+ && (id % pattern_size == 1)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Bbox_Query_8 : public Accept_All_Tags
+{
+ Accept_Bbox_Query_8(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size + pattern_size)
+ && ((id-1) % pattern_size < pattern_size/10)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_1 : public Accept_All_Tags
+{
+ Accept_Query_1(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id == 11); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_2 : public Accept_All_Tags
+{
+ Accept_Query_2(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id % 5 == 0); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_3 : public Accept_All_Tags
+{
+ Accept_Query_3(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id % 11 == 0); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_4 : public Accept_All_Tags
+{
+ Accept_Query_4(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id % 15 == 0); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_5 : public Accept_All_Tags
+{
+ Accept_Query_5(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_6 : public Accept_All_Tags
+{
+ Accept_Query_6(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id == 77); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_7 : public Accept_All_Tags
+{
+ Accept_Query_7(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id % 105 == 0); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_8 : public Accept_All_Tags
+{
+ Accept_Query_8(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id == 11); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_9 : public Accept_All_Tags
+{
+ Accept_Query_9(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size*11/10)
+ && (id % pattern_size > 0)
+ && (id % pattern_size <= pattern_size/10)
+ && (id % 5 == 0)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_10 : public Accept_All_Tags
+{
+ Accept_Query_10(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return ((id > pattern_size*pattern_size)
+ && (id <= pattern_size*pattern_size*11/10)
+ && (id % pattern_size > 0)
+ && (id % pattern_size <= pattern_size/10)
+ && (id % 7 == 0)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_11 : public Accept_All_Tags
+{
+ Accept_Query_11(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id % 105 == 0); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_12 : public Accept_All_Tags
+{
+ Accept_Query_12(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ { return (id == 11); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_13 : public Accept_All_Tags
+{
+ Accept_Query_13(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ { return (id % 5 == 0); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_14 : public Accept_All_Tags
+{
+ Accept_Query_14(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 11 == 0); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_15 : public Accept_All_Tags
+{
+ Accept_Query_15(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 15 == 0); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_17 : public Accept_All_Tags
+{
+ Accept_Query_17(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 77); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_18 : public Accept_All_Tags
+{
+ Accept_Query_18(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 105 == 0); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_19 : public Accept_All_Tags
+{
+ Accept_Query_19(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 105 == 0); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_20 : public Accept_All_Tags
+{
+ Accept_Query_20(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id == 11); }
+};
+
+struct Accept_Query_21 : public Accept_All_Tags
+{
+ Accept_Query_21(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 4 == 1); }
+};
+
+struct Accept_Query_22 : public Accept_All_Tags
+{
+ Accept_Query_22(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 4 != 3); }
+};
+
+struct Accept_Query_23 : public Accept_All_Tags
+{
+ Accept_Query_23(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 5 == 0); }
+};
+
+struct Accept_Query_25 : public Accept_All_Tags
+{
+ Accept_Query_25(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 10 == 0); }
+};
+
+struct Accept_Query_28 : public Accept_All_Tags
+{
+ Accept_Query_28(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ if (id % 5 != 0)
+ return false;
+ if (id / (2*(pattern_size/2+1)*(pattern_size/2-1) + pattern_size/2) != 1)
+ return false;
+ uint remainder = id % (2*(pattern_size/2+1)*(pattern_size/2-1) + pattern_size/2);
+ if (remainder <= pattern_size/2*(pattern_size/4-1))
+ return false;
+ if (remainder <= pattern_size/2*(pattern_size/2-1))
+ return true;
+ if (remainder <= (pattern_size/2-1)*(pattern_size/4-1) + pattern_size/2*(pattern_size/2-1))
+ return false;
+ if (remainder <= 2*pattern_size/2*(pattern_size/2-1))
+ return true;
+ if (remainder > pattern_size/2*(pattern_size/2-1)*2 + pattern_size/2*2-2)
+ return true;
+ return false;
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_29 : public Accept_All_Tags
+{
+ Accept_Query_29(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ if (id % 5 != 0)
+ return false;
+ if (id / (2*(pattern_size/2+1)*(pattern_size/2-1) + pattern_size/2) != 1)
+ return false;
+ uint remainder = id % (2*(pattern_size/2+1)*(pattern_size/2-1) + pattern_size/2);
+ if (remainder <= 2*pattern_size/2*(pattern_size/2-1) + pattern_size/4-1)
+ return false;
+ if (remainder <= 2*pattern_size/2*(pattern_size/2-1) + pattern_size/2-1)
+ return true;
+ if (remainder <= 2*pattern_size/2*(pattern_size/2-1) + pattern_size/2-1 + pattern_size/4-1)
+ return false;
+ if (remainder <= pattern_size/2*(pattern_size/2-1)*2 + pattern_size/2*2-2)
+ return true;
+ return false;
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_30 : public Accept_All_Tags
+{
+ Accept_Query_30(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ if (id == 18)
+ return true;
+ return (id == 22 && pattern_size <= 360);
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_31 : public Accept_All_Tags
+{
+ Accept_Query_31(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ if (id == 14)
+ return true;
+ return (id == 22 && pattern_size <= 200);
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_37 : public Accept_All_Tags
+{
+ Accept_Query_37(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 2*(2*(pattern_size/2+1)*(pattern_size/2-1) + pattern_size/2) - pattern_size + 1
+ || id == 2*(2*(pattern_size/2+1)*(pattern_size/2-1) + pattern_size/2) - 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_38 : public Accept_All_Tags
+{
+ Accept_Query_38(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 2*(2*(pattern_size/2+1)*(pattern_size/2-1) + pattern_size/2));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_39 : public Accept_All_Tags
+{
+ Accept_Query_39(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return ((id >= 12 && id <= 15) || id == 17 || id == 19 || id == 21 || id == 22);
+ }
+};
+
+struct Accept_Query_40 : public Accept_All_Tags
+{
+ Accept_Query_40(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 18 || id == 22);
+ }
+};
+
+struct Accept_Query_41 : public Accept_All_Tags
+{
+ Accept_Query_41(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == pattern_size*pattern_size + 1 || id == pattern_size*pattern_size + 2
+ || id == pattern_size*pattern_size + pattern_size + 1
+ || id == pattern_size*pattern_size + pattern_size + 2
+ || id == pattern_size*pattern_size + pattern_size + 3
+ || id == pattern_size*pattern_size + 2*pattern_size + 1
+ || id == pattern_size*pattern_size + 2*pattern_size + 2);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_42 : public Accept_All_Tags
+{
+ Accept_Query_42(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return ((id >= 2*(pattern_size*pattern_size/2 - 2) + 1
+ && id <= 2*(pattern_size*pattern_size/2 - 2) + pattern_size/2)
+ || id == 2*(pattern_size*pattern_size/2 - 2 + pattern_size/2) - 1
+ || id == 2*(pattern_size*pattern_size/2 - 2 + pattern_size/2));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_43 : public Accept_All_Tags
+{
+ Accept_Query_43(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == pattern_size*pattern_size + pattern_size/2*pattern_size/2 - pattern_size
+ || id == pattern_size*pattern_size + pattern_size/2*pattern_size/2 - 1
+ || id == pattern_size*pattern_size + pattern_size/2*pattern_size/2
+ || id == pattern_size*pattern_size + pattern_size/2*pattern_size/2 + pattern_size);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_44 : public Accept_All_Tags
+{
+ Accept_Query_44(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == pattern_size*pattern_size/2 - 2 + pattern_size/2 + 1
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2 + 2
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2 + 3
+ || id == pattern_size*pattern_size/2 - 2 + 2*pattern_size/2 + 3
+ || id == pattern_size*pattern_size/2 - 2 + 2*pattern_size/2 + 4
+ || id == pattern_size*pattern_size/2 - 2 + 3*pattern_size/2 + 3
+ || id == pattern_size*pattern_size/2 - 2 + 3*pattern_size/2 + 4
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2*(pattern_size/2) + 1
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2*(pattern_size/2) + 2
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2*(pattern_size/2+1)
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2*(pattern_size/2+1) + 1
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2*(pattern_size/2+1) + 2
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2*(pattern_size/2+2) + 1
+ || id == pattern_size*pattern_size/2 - 2 + pattern_size/2*(pattern_size/2+3));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_45 : public Accept_All_Tags
+{
+ Accept_Query_45(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 21 != 14); }
+};
+
+struct Accept_Query_46 : public Accept_All_Tags
+{
+ Accept_Query_46(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id < 100 && id % 21 != 0); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_47 : public Accept_All_Tags
+{
+ Accept_Query_47(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id % 21 != 14 && id % 21 != 0); }
+};
+
+struct Accept_Query_51 : public Accept_All_Tags
+{
+ Accept_Query_51(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id > pattern_size*(pattern_size/2) && id <= pattern_size*(pattern_size/2+1));
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_52 : public Accept_All_Tags
+{
+ Accept_Query_52(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id > pattern_size*(pattern_size/2) && id <= pattern_size*(pattern_size/2+1)
+ && id % 5 == 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_53 : public Accept_All_Tags
+{
+ Accept_Query_53(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id > (pattern_size+1)*(pattern_size/2) && id <= pattern_size*(pattern_size/2+1));
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_54 : public Accept_All_Tags
+{
+ Accept_Query_54(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id > (pattern_size+1)*(pattern_size/2) && id <= pattern_size*(pattern_size/2+1)
+ && id % 5 == 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_55 : public Accept_All_Tags
+{
+ Accept_Query_55(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == pattern_size*(pattern_size/2+1) - 1);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_56 : public Accept_All_Tags
+{
+ Accept_Query_56(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id <= pattern_size*pattern_size && id <= 32767);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_57 : public Accept_All_Tags
+{
+ Accept_Query_57(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id <= pattern_size*pattern_size && id <= 32767 && id % 5 == 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_58 : public Accept_All_Tags
+{
+ Accept_Query_58(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id > pattern_size*pattern_size/2 && id <= pattern_size*pattern_size
+ && (id % pattern_size > pattern_size/2 || id % pattern_size == 0)
+ && id <= 32767);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_59 : public Accept_All_Tags
+{
+ Accept_Query_59(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id > pattern_size*pattern_size/2 && id <= pattern_size*pattern_size
+ && (id % pattern_size > pattern_size/2 || id % pattern_size == 0)
+ && id <= 32767 && id % 5 == 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_60 : public Accept_All_Tags
+{
+ Accept_Query_60(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 1 || id == pattern_size + 2);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_61 : public Accept_All_Tags
+{
+ Accept_Query_61(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2 || id == pattern_size/2*(pattern_size/2-1) + 1
+ || id == pattern_size/2*(pattern_size/2-1) + pattern_size + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_62 : public Accept_All_Tags
+{
+ Accept_Query_62(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return ((id == 1 || id == pattern_size/2*(pattern_size/2-1) + 1
+ || id == pattern_size/2*(pattern_size/2-1) + pattern_size + 1) && id % 4 == 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_63 : public Accept_All_Tags
+{
+ Accept_Query_63(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2 || id == pattern_size/2*(pattern_size/2-1) + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_64 : public Accept_All_Tags
+{
+ Accept_Query_64(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return ((id == 1 || id == pattern_size/2*(pattern_size/2-1) + 1) && id % 4 == 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_65 : public Accept_All_Tags
+{
+ Accept_Query_65(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2 || id == pattern_size/2*(pattern_size/2-1) + 1
+ || id == pattern_size/2*(pattern_size/2-1) + pattern_size + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_66 : public Accept_All_Tags
+{
+ Accept_Query_66(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id <= 6);
+ }
+};
+
+struct Accept_Query_67 : public Accept_All_Tags
+{
+ Accept_Query_67(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id <= 6 && id % 2 == 0);
+ }
+};
+
+struct Accept_Query_68 : public Accept_All_Tags
+{
+ Accept_Query_68(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 3 || id == 4);
+ }
+};
+
+struct Accept_Query_69 : public Accept_All_Tags
+{
+ Accept_Query_69(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 4);
+ }
+};
+
+struct Accept_Query_70 : public Accept_All_Tags
+{
+ Accept_Query_70(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 1 || id == 2);
+ }
+};
+
+struct Accept_Query_71 : public Accept_All_Tags
+{
+ Accept_Query_71(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id >= (pattern_size+1)*(pattern_size/2-1) - 3
+ && id <= (pattern_size+1)*(pattern_size/2-1));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_72 : public Accept_All_Tags
+{
+ Accept_Query_72(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == (pattern_size+1)*(pattern_size/2-1) - 3
+ || id == (pattern_size+1)*(pattern_size/2-1) - 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_73 : public Accept_All_Tags
+{
+ Accept_Query_73(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == (pattern_size+1)*(pattern_size/2-1) - 1
+ || id == (pattern_size+1)*(pattern_size/2-1));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_74 : public Accept_All_Tags
+{
+ Accept_Query_74(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == (pattern_size+1)*(pattern_size/2-1) - 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_75 : public Accept_All_Tags
+{
+ Accept_Query_75(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == (pattern_size+1)*(pattern_size/2-1) - 3
+ || id == (pattern_size+1)*(pattern_size/2-1) - 2);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_76 : public Accept_All_Tags
+{
+ Accept_Query_76(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 1 || id == 2 || id == 4 || id == 8 || id == 10 || id == 11);
+ }
+};
+
+struct Accept_Query_77 : public Accept_All_Tags
+{
+ Accept_Query_77(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 2 || id == 4 || id == 8 || id == 10);
+ }
+};
+
+struct Accept_Query_78 : public Accept_All_Tags
+{
+ Accept_Query_78(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 4 || (id == 11 && pattern_size*pattern_size < 32768));
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_79 : public Accept_All_Tags
+{
+ Accept_Query_79(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 4);
+ }
+};
+
+struct Accept_Query_80 : public Accept_All_Tags
+{
+ Accept_Query_80(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 4 || (id == 11 && pattern_size*pattern_size < 32768));
+ }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_81 : public Accept_All_Tags
+{
+ Accept_Query_81(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 6 || id == 8 || id == 10);
+ }
+};
+
+struct Accept_Query_82 : public Accept_All_Tags
+{
+ Accept_Query_82(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 10);
+ }
+};
+
+struct Accept_Query_83 : public Accept_All_Tags
+{
+ Accept_Query_83(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 6 || id == 8 || id == 10);
+ }
+};
+
+struct Accept_Query_84 : public Accept_All_Tags
+{
+ Accept_Query_84(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 10);
+ }
+};
+
+struct Accept_Query_85 : public Accept_All_Tags
+{
+ Accept_Query_85(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 6 || id == 8 || id == 10);
+ }
+};
+
+struct Accept_Query_86 : public Accept_All_Tags
+{
+ Accept_Query_86(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 9 || id == 10);
+ }
+};
+
+struct Accept_Query_87 : public Accept_All_Tags
+{
+ Accept_Query_87(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 10);
+ }
+};
+
+struct Accept_Query_88 : public Accept_All_Tags
+{
+ Accept_Query_88(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 10);
+ }
+};
+
+struct Accept_Query_89 : public Accept_All_Tags
+{
+ Accept_Query_89(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 10);
+ }
+};
+
+struct Accept_Query_90 : public Accept_All_Tags
+{
+ Accept_Query_90(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 9 || id == 10);
+ }
+};
+
+struct Accept_Query_91 : public Accept_All_Tags
+{
+ Accept_Query_91(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id <= 10); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_92 : public Accept_All_Tags
+{
+ Accept_Query_92(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id == 5 || id == 10); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_93 : public Accept_All_Tags
+{
+ Accept_Query_93(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id <= 5); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_94 : public Accept_All_Tags
+{
+ Accept_Query_94(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id == 5); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_95 : public Accept_All_Tags
+{
+ Accept_Query_95(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id == 9 || id == 10); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_96 : public Accept_All_Tags
+{
+ Accept_Query_96(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id <= 10); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_97 : public Accept_All_Tags
+{
+ Accept_Query_97(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 5 || id == 10); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_98 : public Accept_All_Tags
+{
+ Accept_Query_98(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id <= 5); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_99 : public Accept_All_Tags
+{
+ Accept_Query_99(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 5); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_100 : public Accept_All_Tags
+{
+ Accept_Query_100(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 9 || id == 10); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_101 : public Accept_All_Tags
+{
+ Accept_Query_101(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id <= 10); }
+};
+
+struct Accept_Query_102 : public Accept_All_Tags
+{
+ Accept_Query_102(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id == 5 || id == 10); }
+};
+
+struct Accept_Query_103 : public Accept_All_Tags
+{
+ Accept_Query_103(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id <= 10 && id != 5 && id != 9); }
+};
+
+struct Accept_Query_104 : public Accept_All_Tags
+{
+ Accept_Query_104(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id == 10); }
+};
+
+struct Accept_Query_105 : public Accept_All_Tags
+{
+ Accept_Query_105(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return (id == 9 || id == 10); }
+};
+
+struct Accept_Query_106 : public Accept_All_Tags
+{
+ Accept_Query_106(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size + 1 || id == pattern_size + 2 || id == pattern_size + 3
+ || id == 2*pattern_size + 4 || id == 3*pattern_size + 4);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_107 : public Accept_All_Tags
+{
+ Accept_Query_107(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4 + pattern_size/2 + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_108 : public Accept_All_Tags
+{
+ Accept_Query_108(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_109 : public Accept_All_Tags
+{
+ Accept_Query_109(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == 1 || id == 2 || id == pattern_size
+ || id == pattern_size + 1 || id == pattern_size + 2 || id == pattern_size + 3
+ || id == 2*pattern_size + 4 || id == 3*pattern_size + 4
+ || id == pattern_size*pattern_size/4
+ || id == pattern_size*pattern_size - pattern_size
+ || id == pattern_size*pattern_size);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_110 : public Accept_All_Tags
+{
+ Accept_Query_110(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == 1 || id == 2
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4 + pattern_size/2 + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_111 : public Accept_All_Tags
+{
+ Accept_Query_111(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return ((id >= 1 && id <= 6) || id == 9);
+ }
+};
+
+struct Accept_Query_113 : public Accept_All_Tags
+{
+ Accept_Query_113(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id == pattern_size*pattern_size/4 - pattern_size/2 + 1);
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_114 : public Accept_All_Tags
+{
+ Accept_Query_114(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 2 || (id >= 6 && id <= 8) || id == 10 || id == 11);
+ }
+};
+
+struct Accept_Query_117 : public Accept_All_Tags
+{
+ Accept_Query_117(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 2 || (id >= 6 && id <= 11));
+ }
+};
+
+struct Accept_Query_118 : public Accept_All_Tags
+{
+ Accept_Query_118(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (3*pattern_size*pattern_size < id &&
+ id <= 3*pattern_size*pattern_size + pattern_size &&
+ id % 35 == 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_119 : public Accept_All_Tags
+{
+ Accept_Query_119(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (3*pattern_size*pattern_size < id &&
+ id <= 3*pattern_size*pattern_size + pattern_size &&
+ id % 7 == 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_122 : public Accept_All_Tags
+{
+ Accept_Query_122(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (3*pattern_size*pattern_size < id &&
+ id <= 3*pattern_size*pattern_size + pattern_size &&
+ id % 7 == 0 && id % 3 != 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_124 : public Accept_All_Tags
+{
+ Accept_Query_124(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (3*pattern_size*pattern_size < id &&
+ id <= 3*pattern_size*pattern_size + pattern_size &&
+ id % 7 == 0 && id % 11 != 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_125 : public Accept_All_Tags
+{
+ Accept_Query_125(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (3*pattern_size*pattern_size < id &&
+ id <= 3*pattern_size*pattern_size + pattern_size &&
+ id % 7 == 0 && id % 3 == 0);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_139 : public Accept_All_Tags
+{
+ Accept_Query_139(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id % 11 == 0 && id >= 99 && id <= 1078); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_140 : public Accept_All_Tags
+{
+ Accept_Query_140(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id % 55 == 0 && id >= 99 && id <= 1078); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_141 : public Accept_All_Tags
+{
+ Accept_Query_141(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 22 == 0 && id >= 99 && id <= 1078); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_142 : public Accept_All_Tags
+{
+ Accept_Query_142(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 110 == 0 && id >= 99 && id <= 1078); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_143 : public Accept_All_Tags
+{
+ Accept_Query_143(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 11 == 0 && id % 4 != 3 && id >= 99 && id <= 1078); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_144 : public Accept_All_Tags
+{
+ Accept_Query_144(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id % 55 == 0 && id % 4 != 3 && id >= 99 && id <= 1078); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_145 : public Accept_All_Tags
+{
+ Accept_Query_145(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id % 11 == 0 && id >= 99 && id <= 1078 && id <= pattern_size*pattern_size/2);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_146 : public Accept_All_Tags
+{
+ Accept_Query_146(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id % 55 == 0 && id >= 99 && id <= 1078 && id <= pattern_size*pattern_size/2);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_147 : public Accept_All_Tags
+{
+ Accept_Query_147(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id % 22 == 0 && id >= 99 && id <= 1078 &&
+ (id <= (pattern_size+1)*(pattern_size/2-1)
+ || (id > (pattern_size+2)*(pattern_size/2-1) && id <= (pattern_size+3)*(pattern_size/2-1)+1)));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_148 : public Accept_All_Tags
+{
+ Accept_Query_148(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id % 110 == 0 && id >= 99 && id <= 1078 &&
+ (id <= (pattern_size+1)*(pattern_size/2-1)
+ || (id > (pattern_size+2)*(pattern_size/2-1) && id <= (pattern_size+3)*(pattern_size/2-1)+1)));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_149 : public Accept_All_Tags
+{
+ Accept_Query_149(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id % 11 == 0 && id % 4 != 3 && id >= 99 && id <= 1078 &&
+ (id <= (pattern_size+1)*(pattern_size/2-1)
+ || (id > (pattern_size+2)*(pattern_size/2-1) && id <= (pattern_size+3)*(pattern_size/2-1)+1)));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_150 : public Accept_All_Tags
+{
+ Accept_Query_150(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return (id % 55 == 0 && id % 4 != 3 && id >= 99 && id <= 1078 &&
+ (id <= (pattern_size+1)*(pattern_size/2-1)
+ || (id > (pattern_size+2)*(pattern_size/2-1) && id <= (pattern_size+3)*(pattern_size/2-1)+1)));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_151 : public Accept_All_Tags
+{
+ Accept_Query_151(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return id % 5 == 0 && pattern_size*pattern_size/4*5 < id && id < pattern_size*pattern_size/2*3
+ && id % pattern_size <= pattern_size/2 && id % pattern_size > 0;
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_153 : public Accept_All_Tags
+{
+ Accept_Query_153(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return id == 18 || (id == 22 && pattern_size <= 362); }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_154 : public Accept_All_Tags
+{
+ Accept_Query_154(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id % 5 == 0 && id < 100; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_155 : public Accept_All_Tags
+{
+ Accept_Query_155(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return id % 5 == 0 && id < 100; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_156 : public Accept_All_Tags
+{
+ Accept_Query_156(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return id % 5 == 0 && id % 4 != 3; }
+};
+
+struct Accept_Query_157 : public Accept_All_Tags
+{
+ Accept_Query_157(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == 11; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_158 : public Accept_All_Tags
+{
+ Accept_Query_158(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return id == 11; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_159 : public Accept_All_Tags
+{
+ Accept_Query_159(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return id == 11; }
+};
+
+struct Accept_Query_160 : public Accept_All_Tags
+{
+ Accept_Query_160(uint pattern_size_, bool node_one_, bool node_two_,
+ bool way_two_, bool way_three_, bool rel_zero_, bool rel_three_)
+ : pattern_size(pattern_size_), node_one(node_one_), node_two(node_two_),
+ way_two(way_two_), way_three(way_three_), rel_zero(rel_zero_), rel_three(rel_three_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (node_one && id == 1) || (node_two && id == 2)
+ || (node_one && id == pattern_size + 1) || (node_two && id == pattern_size + 2); }
+ virtual bool admit_way(uint id) const { return (way_three && id == 2)
+ || (way_two && (id == 1
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4 + pattern_size/2 + 1)); }
+ virtual bool admit_relation(uint id) const { return (rel_three && id == 1) || (rel_zero && id == 2); }
+
+private:
+ uint pattern_size;
+ bool node_one, node_two, way_two, way_three, rel_zero, rel_three;
+};
+
+struct Accept_Query_170 : public Accept_All_Tags
+{
+ Accept_Query_170(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id % 15 == 0; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_171 : public Accept_All_Tags
+{
+ Accept_Query_171(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == 10; }
+ virtual bool admit_way(uint id) const { return id == 10; }
+ virtual bool admit_relation(uint id) const { return id == 10; }
+};
+
+struct Accept_Query_172 : public Accept_All_Tags
+{
+ Accept_Query_172(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == 10; }
+ virtual bool admit_way(uint id) const { return id == 10; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Query_173 : public Accept_All_Tags
+{
+ Accept_Query_173(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return id == 10; }
+ virtual bool admit_relation(uint id) const { return id == 10; }
+};
+
+struct Accept_Query_174 : public Accept_All_Tags
+{
+ Accept_Query_174(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == 10; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return id == 10; }
+};
+
+struct Accept_Query_175 : public Accept_All_Tags
+{
+ Accept_Query_175(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == (pattern_size+1)*pattern_size/2 + 1; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_177 : public Accept_All_Tags
+{
+ Accept_Query_177(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id != (pattern_size+1)*pattern_size/2 + 1 &&
+ ((pattern_size*pattern_size/2 + 2 <= id && id <= pattern_size*(pattern_size/2 + 1) - 1)
+ || (id % pattern_size == pattern_size/2 + 1 && pattern_size < id && id < pattern_size*(pattern_size-1))));
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Query_178 : public Accept_All_Tags
+{
+ Accept_Query_178(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == (pattern_size+1)*pattern_size/2 + 2
+ || id == (pattern_size+3)*pattern_size/2 + 1; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Foreach_1 : public Accept_All_Tags
+{
+ Accept_Foreach_1(uint pattern_size_)
+ {
+ way_id_offset = (2*(pattern_size_/2+1)*(pattern_size_/2-1) + pattern_size_/2);
+ }
+
+ virtual bool admit_node(uint id) const
+ { return ((id == 1) || (id == 2) || (id == 3)); }
+ virtual bool admit_way(uint id) const
+ { return ((id % way_id_offset == 1) && (id / way_id_offset <= 3) && (id != 1)); }
+ virtual bool admit_relation(uint id) const
+ { return (/*(id == 10) || */(id == 21) || (id == 32)); }
+
+private:
+ uint way_id_offset;
+};
+
+struct Accept_Foreach_2 : public Accept_All_Tags
+{
+ Accept_Foreach_2(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Union_1 : public Accept_All_Tags
+{
+ Accept_Union_1(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id == 2); }
+ virtual bool admit_way(uint id) const { return (id == 11); }
+ virtual bool admit_relation(uint id) const
+ { return ((id == 2) || (id == 8) || (id == 10) || (id == 11)); }
+};
+
+struct Accept_Union_2 : public Accept_All_Tags
+{
+ Accept_Union_2(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return ((id == 1) || (id == 2)); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Union_4 : public Accept_All_Tags
+{
+ Accept_Union_4(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 1); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Union_5 : public Accept_All_Tags
+{
+ Accept_Union_5(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id == 2); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Union_6 : public Accept_All_Tags
+{
+ Accept_Union_6(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ { return ((id == 2) || (id == 8) || (id == 10) || (id == 11)); }
+};
+
+struct Accept_Difference_1 : public Accept_All_Tags
+{
+ Accept_Difference_1(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Difference_2 : public Accept_All_Tags
+{
+ Accept_Difference_2(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return (id == 2); }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Difference_4 : public Accept_All_Tags
+{
+ Accept_Difference_4(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 1 || id == 4); }
+ virtual bool admit_relation(uint id) const { return (id == 1 || id == 4); }
+};
+
+struct Accept_Difference_5 : public Accept_All_Tags
+{
+ Accept_Difference_5(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 1 || id == 4); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Difference_6 : public Accept_All_Tags
+{
+ Accept_Difference_6(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return (id == 1); }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+struct Accept_Complete_1 : public Accept_All_Tags
+{
+ Accept_Complete_1(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return id == 1; }
+ virtual bool admit_way(uint id) const { return id == 2; }
+ virtual bool admit_relation(uint id) const { return id == 3; }
+};
+
+struct Accept_Complete_6 : public Accept_All_Tags
+{
+ Accept_Complete_6(uint pattern_size_, bool admit_node_4_) : admit_node_4(admit_node_4_) {}
+
+ virtual bool admit_node(uint id) const { return id == 1 || (id == 4 && admit_node_4); }
+ virtual bool admit_way(uint id) const { return id == 2; }
+ virtual bool admit_relation(uint id) const { return id == 3; }
+
+private:
+ bool admit_node_4;
+};
+
+struct Accept_Complete_7 : public Accept_All_Tags
+{
+ Accept_Complete_7(uint pattern_size_, uint iteration_) : pattern_size(pattern_size_), iteration(iteration_) {}
+
+ virtual bool admit_node(uint id) const { return id == 1; }
+ virtual bool admit_way(uint id) const
+ {
+ if (iteration == 0)
+ return id == 2;
+
+ if (id <= pattern_size/2*9)
+ return (id % (pattern_size/2) != 0
+ && id % (pattern_size/2) <= 10
+ && id % (pattern_size/2) + (id/(pattern_size/2)) < iteration + 3
+ && id / (pattern_size/2) < iteration);
+
+ if (id <= (pattern_size/2)*(pattern_size/2 - 1))
+ return false;
+
+ uint delta = id - (pattern_size/2)*(pattern_size/2 - 1);
+
+ if (delta >= (pattern_size/2 - 1)*10)
+ return false;
+
+ return (delta % (pattern_size/2 - 1) != 0
+ && delta % (pattern_size/2 - 1) <= 9
+ && delta % (pattern_size/2 - 1) < iteration + 2
+ && delta % (pattern_size/2 - 1) + (delta / (pattern_size/2 - 1)) < iteration + 3
+ && delta / (pattern_size/2 - 1) < iteration + 1);
+ }
+ virtual bool admit_relation(uint id) const { return id == 3; }
+
+private:
+ uint pattern_size;
+ uint iteration;
+};
+
+struct Accept_If : public Accept_All_Tags
+{
+ Accept_If(uint target_way_id_) : target_way_id(target_way_id_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return id == target_way_id; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint target_way_id;
+};
+
+struct Accept_Polygon_1 : public Accept_All_Tags
+{
+ Accept_Polygon_1(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return ((id >= pattern_size*pattern_size*3 + pattern_size*5 + 8
+ && id <= pattern_size*pattern_size*3 + pattern_size*5 + 10)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*6 + 7
+ && id <= pattern_size*pattern_size*3 + pattern_size*6 + 11)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*7 + 6
+ && id <= pattern_size*pattern_size*3 + pattern_size*7 + 12)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*8 + 6
+ && id <= pattern_size*pattern_size*3 + pattern_size*8 + 12)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*9 + 6
+ && id <= pattern_size*pattern_size*3 + pattern_size*9 + 12)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*10 + 7
+ && id <= pattern_size*pattern_size*3 + pattern_size*10 + 11)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*11 + 8
+ && id <= pattern_size*pattern_size*3 + pattern_size*11 + 10));
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Polygon_2 : public Accept_All_Tags
+{
+ Accept_Polygon_2(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id == pattern_size*pattern_size*2
+ || id == pattern_size*pattern_size*4 - pattern_size + 1);
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Polygon_3 : public Accept_All_Tags
+{
+ Accept_Polygon_3(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ {
+ return (id % 5 == 0 &&
+ ((id >= pattern_size*pattern_size*3 + pattern_size*5 + 8
+ && id <= pattern_size*pattern_size*3 + pattern_size*5 + 10)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*6 + 7
+ && id <= pattern_size*pattern_size*3 + pattern_size*6 + 11)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*7 + 6
+ && id <= pattern_size*pattern_size*3 + pattern_size*7 + 12)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*8 + 6
+ && id <= pattern_size*pattern_size*3 + pattern_size*8 + 12)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*9 + 6
+ && id <= pattern_size*pattern_size*3 + pattern_size*9 + 12)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*10 + 7
+ && id <= pattern_size*pattern_size*3 + pattern_size*10 + 11)
+ || (id >= pattern_size*pattern_size*3 + pattern_size*11 + 8
+ && id <= pattern_size*pattern_size*3 + pattern_size*11 + 10)));
+ }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Polygon_4 : public Accept_All_Tags
+{
+ Accept_Polygon_4(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ {
+ return ((id >= pattern_size*pattern_size - pattern_size/2 - 1
+ && id <= pattern_size*pattern_size - pattern_size/4 - 2)
+ || (id >= pattern_size*pattern_size + pattern_size/2 - 3
+ && id <= pattern_size*pattern_size + pattern_size/4*3 - 3));
+ }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+struct Accept_Polygon_5 : public Accept_All_Tags
+{
+ Accept_Polygon_5(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ {
+ return (id == 18 || id == 22);
+ }
+};
+
+struct Accept_All_But_5 : public Accept_All_Tags
+{
+ Accept_All_But_5(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return (id != 5); }
+ virtual bool admit_way(uint id) const
+ { return (id != 5); }
+ virtual bool admit_relation(uint id) const
+ { return (id != 5); }
+};
+
+double great_circle_dist(double lat1, double lon1, double lat2, double lon2)
+{
+ double scalar_prod =
+ sin(lat1/90.0*acos(0))*sin(lat2/90.0*acos(0)) +
+ cos(lat1/90.0*acos(0))*sin(lon1/90.0*acos(0))*cos(lat2/90.0*acos(0))*sin(lon2/90.0*acos(0)) +
+ cos(lat1/90.0*acos(0))*cos(lon1/90.0*acos(0))*cos(lat2/90.0*acos(0))*cos(lon2/90.0*acos(0));
+ if (scalar_prod > 1)
+ scalar_prod = 1;
+ return acos(scalar_prod)*(10*1000*1000/acos(0));
+}
+
+struct Accept_Around_1 : public Accept_All_Tags
+{
+ Accept_Around_1(uint pattern_size_, double radius_, bool northeast_ = false, uint divisor_ = 0)
+ : pattern_size(pattern_size_), radius(radius_), northeast(northeast_), divisor(divisor_)
+ {
+ north = 48.1;
+ south = 47.9;
+ west = -0.2;
+ east = 0.2;
+
+ lat = (north - south)/pattern_size*0.5 + south;
+ lon = (east - west)/pattern_size*0.5 + west;
+
+ lat_ne = (north - south)/pattern_size*(-0.5 + pattern_size) + south;
+ lon_ne = (east - west)/pattern_size*(-0.5 + pattern_size) + west;
+ }
+
+ virtual bool admit_node(uint id) const
+ {
+ if ((id > 3*pattern_size*pattern_size) || (id <= 2*pattern_size*pattern_size))
+ return false;
+
+ if (divisor > 0)
+ {
+ if ((divisor == 11) && (id % 11 != 0))
+ return false;
+ if ((divisor == 7) && (id % 21 != 7))
+ return false;
+ }
+
+ int i = (id-2*pattern_size*pattern_size-1) / pattern_size;
+ int j = (id-2*pattern_size*pattern_size-1) % pattern_size;
+ double arg_lat = (north - south)/pattern_size*(0.5 + i) + south;
+ double arg_lon = (east - west)/pattern_size*(0.5 + j) + west;
+
+ if (great_circle_dist(lat, lon, arg_lat, arg_lon) <= radius)
+ return true;
+ if (!northeast)
+ return false;
+ return (great_circle_dist(lat_ne, lon_ne, arg_lat, arg_lon) <= radius);
+ }
+
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+ double radius;
+ bool northeast;
+ uint divisor;
+ double lat, lon, lat_ne, lon_ne;
+ double north, south, west, east;
+};
+
+
+struct Accept_Around_10 : public Accept_All_Tags
+{
+ Accept_Around_10(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return id == 1 || id == 2 || id == 3 || id == pattern_size + 1 || id == pattern_size + 2
+ || id == 2*pattern_size + 1; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+
+struct Accept_Around_11 : public Accept_All_Tags
+{
+ Accept_Around_11(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const
+ { return id == 1 || id == 2 || id == 3 || id == pattern_size + 1 || id == pattern_size + 2; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+
+struct Accept_Around_17 : public Accept_All_Tags
+{
+ Accept_Around_17(uint pattern_size_) : pattern_size(pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const
+ { return id == 1 || id == 2 || id == pattern_size/2+1
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 1
+ || id == pattern_size*pattern_size/4 - pattern_size/2 + 2
+ || id == pattern_size*pattern_size/4; }
+ virtual bool admit_relation(uint id) const { return false; }
+
+private:
+ uint pattern_size;
+};
+
+
+struct Accept_Around_18 : public Accept_All_Tags
+{
+ Accept_Around_18(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return false; }
+ virtual bool admit_relation(uint id) const
+ { return id <= 11 && id != 5 && id != 7 && id != 9; }
+};
+
+
+struct Accept_Around_19 : public Accept_All_Tags
+{
+ Accept_Around_19(uint pattern_size_) {}
+
+ virtual bool admit_node(uint id) const { return false; }
+ virtual bool admit_way(uint id) const { return id == 1; }
+ virtual bool admit_relation(uint id) const { return false; }
+};
+
+
+std::vector< std::pair< std::string, std::string > > collect_tags(std::string prefix, uint id)
+{
+ std::vector< std::pair< std::string, std::string > > tags;
+ if (id < 100)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key", prefix + "_few"));
+ if (id % 11 == 0)
+ {
+ std::ostringstream buf;
+ buf<
+ (prefix + "_key_11", buf.str()));
+ }
+ if (id % 15 == 0)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_15", prefix + "_value_15"));
+ if ((id % 2 == 0) && ((prefix == "way") || (prefix == "relation")))
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_2/4", prefix + "_value_0"));
+ if ((id % 4 == 1) && ((prefix == "way") || (prefix == "relation")))
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_2/4", prefix + "_value_1"));
+ if (id % 5 == 0)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_5", prefix + "_value_5"));
+ if (id % 7 == 0)
+ {
+ std::ostringstream buf;
+ buf<
+ (prefix + "_key_7", buf.str()));
+ }
+ if (id == 2310)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_unique", prefix + "_2310"));
+ return tags;
+}
+
+void fill_bbox_with_nodes
+ (double south, double north, double west, double east,
+ uint begin_id, uint end_id, uint64 global_node_offset,
+ const Data_Modifier* modifier)
+{
+ int sqrt_ = sqrt(end_id - begin_id);
+ for (int i = 0; i < sqrt_; ++i)
+ {
+ for (int j = 0; j < sqrt_; ++j)
+ {
+ if (!modifier->admit_node(begin_id + i*sqrt_ + j))
+ continue;
+ if (!modifier->admit_node_skeleton(begin_id + i*sqrt_ + j) &&
+ !modifier->admit_node_tags(begin_id + i*sqrt_ + j))
+ {
+ std::cout<<" \n";
+ continue;
+ }
+ std::cout<<" > tags
+ = collect_tags("node", begin_id + i*sqrt_ + j);
+ if ((tags.empty()) || !modifier->admit_node_tags(begin_id + i*sqrt_ + j))
+ std::cout<<"/>\n";
+ else
+ {
+ std::cout<<">\n";
+ for (std::vector< std::pair< std::string, std::string > >::const_iterator
+ it = tags.begin(); it != tags.end(); ++it)
+ std::cout<<" first<<"\" v=\""<second<<"\"/>\n";
+ std::cout<<" \n";
+ }
+ }
+ }
+}
+
+void create_way
+ (uint id, uint start_node_ref, uint end_node_ref, uint stepping, uint64 global_node_offset,
+ const Data_Modifier* modifier)
+{
+ if (!modifier->admit_way(id))
+ return;
+ if (!modifier->admit_way_skeleton(id) && !modifier->admit_way_tags(id))
+ {
+ std::cout<<" \n";
+ return;
+ }
+ std::cout<<" \n";
+ if (start_node_ref < end_node_ref)
+ {
+ for (uint ref = start_node_ref; ref <= end_node_ref; ref += stepping)
+ std::cout<<" \n";
+ }
+ else
+ {
+ for (uint ref = start_node_ref; (int)ref >= (int)end_node_ref; ref -= stepping)
+ std::cout<<" \n";
+ }
+ if (modifier->admit_way_tags(id))
+ {
+ std::vector< std::pair< std::string, std::string > > tags = collect_tags("way", id);
+ for (std::vector< std::pair< std::string, std::string > >::const_iterator
+ it = tags.begin(); it != tags.end(); ++it)
+ std::cout<<" first<<"\" v=\""<second<<"\"/>\n";
+ }
+ std::cout<<" \n";
+}
+
+void create_relation
+ (uint id, const std::vector< uint >& refs, uint64 global_node_offset, const std::vector< uint >& types,
+ const Data_Modifier* modifier)
+{
+ if (!modifier->admit_relation(id))
+ return;
+ if (!modifier->admit_relation_skeleton(id) &&
+ !modifier->admit_relation_tags(id))
+ {
+ std::cout<<" \n";
+ return;
+ }
+
+ std::vector< std::string > roles = V< std::string >("zero")("one")("two")("three");
+ std::vector< std::string > typenames = V< std::string >("node")("way")("relation");
+
+ std::cout<<" \n";
+ for (uint i = 0; i < refs.size(); ++i)
+ {
+ std::cout<<" \n";
+ }
+ if (modifier->admit_relation_tags(id))
+ {
+ std::vector< std::pair< std::string, std::string > > tags = collect_tags("relation", id);
+ for (std::vector< std::pair< std::string, std::string > >::const_iterator
+ it = tags.begin(); it != tags.end(); ++it)
+ std::cout<<" first<<"\" v=\""<second<<"\"/>\n";
+ }
+ std::cout<<" \n";
+}
+
+void create_node_test_pattern
+ (double south, double north, double west, double east, uint id, uint size, uint64 global_node_offset,
+ const Data_Modifier* modifier)
+{
+ fill_bbox_with_nodes
+ (south, north, west, east,
+ id*size*size + 1, (id+1)*size*size + 1, global_node_offset, modifier);
+}
+
+void create_way_test_pattern(uint id, uint size, uint64 global_node_offset, const Data_Modifier* modifier)
+{
+ uint way_id_offset = id * (2*(size/2+1)*(size/2-1) + size/2);
+ uint node_id_offset = id*size*size;
+
+ // Draw a rectangular mesh of streets of length 1 segment.
+ for (uint i = 1; i < size/2; ++i)
+ for (uint j = 1; j <= size/2; ++j)
+ create_way(way_id_offset + (i-1)*size/2 + j,
+ node_id_offset + i*size + j, node_id_offset + i*size + j + 1, 1, global_node_offset,
+ modifier);
+ way_id_offset += size/2*(size/2-1);
+ for (uint i = 1; i <= size/2; ++i)
+ for (uint j = 1; j < size/2; ++j)
+ create_way(way_id_offset + (i-1)*(size/2-1) + j,
+ node_id_offset + (i-1)*size + j + 1,
+ node_id_offset + i*size + j + 1, size, global_node_offset, modifier);
+
+ way_id_offset += size/2*(size/2-1);
+
+ // Draw long straight ways from south to north.
+ for (uint j = size/2+1; j < size; ++j)
+ create_way(way_id_offset + j - size/2,
+ node_id_offset + j,
+ node_id_offset + size*(size-1) + j, size, global_node_offset, modifier);
+ way_id_offset += size/2-1;
+ // Draw long straight ways from east to west.
+ for (uint i = size/2+1; i < size; ++i)
+ create_way(way_id_offset + i - size/2,
+ node_id_offset + size*i,
+ node_id_offset + size*(i-1) + 1, 1, global_node_offset, modifier);
+
+ way_id_offset += size/2-1;
+ // Draw diagonal ways from northwest to southeast
+ for (uint i = 0; i < size/2; ++i)
+ create_way(way_id_offset + i + 1,
+ node_id_offset + size*(i+size/2) + 1,
+ node_id_offset + i+size/2 + 1, (size-1)*(i+size/2), global_node_offset, modifier);
+}
+
+void create_relation_test_pattern(uint id, uint size, uint64 global_node_offset, const Data_Modifier* modifier)
+{
+ uint way_id_offset = id * (2*(size/2+1)*(size/2-1) + size/2);
+ uint node_id_offset = id*size*size;
+ uint relation_id_offset = id*11;
+
+ //create three small and two big relations based only on nodes
+ create_relation(relation_id_offset + 1,
+ V< uint >(node_id_offset + 1)(node_id_offset + size + 2), global_node_offset,
+ V< uint >(0)(0), modifier);
+ create_relation
+ (relation_id_offset + 2,
+ V< uint >(node_id_offset + 1)(node_id_offset + 2)
+ (node_id_offset + size + 2)(node_id_offset + size + 1)(node_id_offset + 1), global_node_offset,
+ V< uint >(0)(0)(0)(0)(0), modifier);
+ create_relation(relation_id_offset + 3,
+ V< uint >(node_id_offset + 1)(node_id_offset + size*size), global_node_offset,
+ V< uint >(0)(0), modifier);
+ create_relation
+ (relation_id_offset + 4,
+ V< uint >(node_id_offset + 1)(node_id_offset + size)
+ (node_id_offset + size*size)(node_id_offset + size*(size-1)), global_node_offset,
+ V< uint >(0)(0)(0)(0), modifier);
+ create_relation(relation_id_offset + 5,
+ V< uint >(node_id_offset + size/2*size/2), global_node_offset,
+ V< uint >(0), modifier);
+
+ //create one small and one big relation based only on ways
+ create_relation
+ (relation_id_offset + 6,
+ V< uint >(way_id_offset + 1)(way_id_offset + 2)
+ (way_id_offset + size/2*(size/2-1) + 1)(way_id_offset + size/2*(size/2+1) + 1), global_node_offset,
+ V< uint >(1)(1)(1)(1), modifier);
+ create_relation
+ (relation_id_offset + 7,
+ V< uint >(way_id_offset + size*(size/2-1) + 1)
+ (way_id_offset + size*(size/2-1) + size/2)
+ (way_id_offset + size*(size/2-1) + size - 1), global_node_offset,
+ V< uint >(1)(1)(1), modifier);
+
+ // mixed
+ create_relation
+ (relation_id_offset + 8,
+ V< uint >(node_id_offset + 1)
+ (way_id_offset + 1)
+ (node_id_offset + 2)
+ (way_id_offset + 2)
+ (node_id_offset + size + 2)
+ (way_id_offset + size/2*(size/2-1) + 1)
+ (node_id_offset + size + 1)
+ (way_id_offset + size/2*(size/2+1) + 1)
+ (node_id_offset + 1), global_node_offset,
+ V< uint >(0)(1)(0)(1)(0)(1)(0)(1)(0), modifier);
+
+ // relations on relations
+ create_relation
+ (relation_id_offset + 9,
+ V< uint >(relation_id_offset + 1)(relation_id_offset + 2)(relation_id_offset + 3)
+ (relation_id_offset + 4)(relation_id_offset + 5)(relation_id_offset + 6), global_node_offset,
+ V< uint >(2)(2)(2)(2)(2)(2), modifier);
+ create_relation
+ (relation_id_offset + 10,
+ V< uint >(relation_id_offset + 1)
+ (node_id_offset + 1)
+ (way_id_offset + 1)
+ (node_id_offset + 2)
+ (way_id_offset + 2)
+ (node_id_offset + size + 2)
+ (way_id_offset + size/2*(size/2-1) + 1)
+ (node_id_offset + size + 1)
+ (way_id_offset + size/2*(size/2+1) + 1)
+ (node_id_offset + 1)
+ (relation_id_offset + 2), global_node_offset,
+ V< uint >(2)(0)(1)(0)(1)(0)(1)(0)(1)(0)(2), modifier);
+
+ // a big relation
+ std::vector< uint > refs, types;
+ int max_num_node_members = size*size;
+ if (max_num_node_members > 32767)
+ max_num_node_members = 32767;
+ for (int i = 0; i < max_num_node_members; ++i)
+ {
+ refs.push_back(node_id_offset + i + 1);
+ types.push_back(0);
+ }
+ for (int i = 0; i < max_num_node_members; ++i)
+ {
+ refs.push_back(node_id_offset + i + 1);
+ types.push_back(0);
+ }
+ create_relation(relation_id_offset + 11, refs, global_node_offset, types, modifier);
+}
+
+
+std::string lat_lon_of_node(unsigned int id, unsigned int pattern_size)
+{
+ std::ostringstream out;
+ out< 1)
+ pattern_size = atoi(args[1]);
+ Data_Modifier* modifier = 0;
+ if (argc > 2)
+ {
+ if (std::string(args[2]) == "print_1")
+ modifier = new Accept_Print_1;
+ else if (std::string(args[2]) == "print_2")
+ modifier = new Accept_Print_2;
+ else if (std::string(args[2]) == "print_3")
+ modifier = new Accept_Print_3;
+ else if (std::string(args[2]) == "print_4")
+ modifier = new Accept_Print_1; //print_1 and print_4 are equal
+ else if (std::string(args[2]) == "recurse_1")
+ modifier = new Accept_Recurse_1(pattern_size);
+ else if (std::string(args[2]) == "recurse_2")
+ modifier = new Accept_Recurse_2(pattern_size);
+ else if (std::string(args[2]) == "recurse_3")
+ modifier = new Accept_Recurse_3(pattern_size);
+ else if (std::string(args[2]) == "recurse_4")
+ modifier = new Accept_Recurse_4(pattern_size);
+ else if (std::string(args[2]) == "recurse_5")
+ modifier = new Accept_Recurse_5(pattern_size);
+ else if (std::string(args[2]) == "recurse_6")
+ modifier = new Accept_Recurse_6(pattern_size);
+ else if (std::string(args[2]) == "recurse_7")
+ modifier = new Accept_Recurse_7(pattern_size);
+ else if (std::string(args[2]) == "recurse_8")
+ modifier = new Accept_Recurse_8(pattern_size);
+ else if (std::string(args[2]) == "recurse_9")
+ modifier = new Accept_Recurse_9(pattern_size);
+ else if (std::string(args[2]) == "recurse_10")
+ modifier = new Accept_Recurse_10(pattern_size);
+ else if (std::string(args[2]) == "recurse_11")
+ modifier = new Accept_Recurse_11(pattern_size);
+ else if (std::string(args[2]) == "recurse_12")
+ modifier = new Accept_Recurse_12(pattern_size);
+ else if (std::string(args[2]) == "recurse_13")
+ modifier = new Accept_Recurse_13(pattern_size);
+ else if (std::string(args[2]) == "recurse_14")
+ modifier = new Accept_Recurse_14(pattern_size);
+ else if (std::string(args[2]) == "recurse_15")
+ modifier = new Accept_Recurse_15(pattern_size);
+ else if (std::string(args[2]) == "recurse_16")
+ modifier = new Accept_Recurse_16(pattern_size);
+ else if (std::string(args[2]) == "recurse_17")
+ modifier = new Accept_Recurse_17(pattern_size);
+ else if (std::string(args[2]) == "recurse_18")
+ modifier = new Accept_Recurse_18(pattern_size);
+ else if (std::string(args[2]) == "recurse_19")
+ modifier = new Accept_Recurse_19(pattern_size);
+ else if (std::string(args[2]) == "recurse_20")
+ modifier = new Accept_Recurse_20(pattern_size);
+ else if (std::string(args[2]) == "recurse_21")
+ modifier = new Accept_Recurse_21(pattern_size);
+ else if (std::string(args[2]) == "recurse_22")
+ modifier = new Accept_Recurse_21(pattern_size); //recurse_21 and recurse_22 are equal
+ else if (std::string(args[2]) == "recurse_23")
+ modifier = new Accept_Recurse_23(pattern_size);
+ else if (std::string(args[2]) == "recurse_24")
+ modifier = new Accept_Recurse_24(pattern_size);
+ else if (std::string(args[2]) == "recurse_25")
+ modifier = new Accept_Recurse_25(pattern_size);
+ else if (std::string(args[2]) == "recurse_26")
+ modifier = new Accept_Recurse_26(pattern_size);
+ else if (std::string(args[2]) == "recurse_27")
+ modifier = new Accept_Recurse_27(pattern_size);
+ else if (std::string(args[2]) == "recurse_28")
+ modifier = new Accept_Recurse_28(pattern_size);
+ else if (std::string(args[2]) == "recurse_29")
+ modifier = new Accept_Recurse_29(pattern_size);
+ else if (std::string(args[2]) == "recurse_30")
+ modifier = new Accept_Recurse_30(pattern_size);
+ else if (std::string(args[2]) == "recurse_31")
+ modifier = new Accept_Recurse_31(pattern_size);
+ else if (std::string(args[2]) == "recurse_32")
+ modifier = new Accept_Recurse_29(pattern_size);
+ else if (std::string(args[2]) == "recurse_33")
+ modifier = new Accept_Recurse_30(pattern_size);
+ else if (std::string(args[2]) == "recurse_34")
+ modifier = new Accept_Recurse_34(pattern_size);
+ else if (std::string(args[2]) == "recurse_35")
+ modifier = new Accept_Recurse_35(pattern_size);
+ else if (std::string(args[2]) == "recurse_36")
+ modifier = new Accept_Recurse_36(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_1")
+ modifier = new Accept_Bbox_Query_1(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_2")
+ modifier = new Accept_Bbox_Query_2(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_3")
+ modifier = new Accept_Bbox_Query_3(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_4")
+ modifier = new Accept_Bbox_Query_4(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_5")
+ modifier = new Accept_Bbox_Query_5(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_6")
+ modifier = new Accept_Bbox_Query_6(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_7")
+ // bbox-query five and bboy-query seven shall both return an empty std::set.
+ modifier = new Accept_Bbox_Query_5(pattern_size);
+ else if (std::string(args[2]) == "bbox_query_8")
+ modifier = new Accept_Bbox_Query_8(pattern_size);
+ else if (std::string(args[2]) == "query_1")
+ modifier = new Accept_Query_1(pattern_size);
+ else if (std::string(args[2]) == "query_2")
+ modifier = new Accept_Query_2(pattern_size);
+ else if (std::string(args[2]) == "query_3")
+ modifier = new Accept_Query_3(pattern_size);
+ else if (std::string(args[2]) == "query_4")
+ modifier = new Accept_Query_4(pattern_size);
+ else if (std::string(args[2]) == "query_5")
+ modifier = new Accept_Query_5(pattern_size);
+ else if (std::string(args[2]) == "query_6")
+ modifier = new Accept_Query_6(pattern_size);
+ else if (std::string(args[2]) == "query_7")
+ modifier = new Accept_Query_7(pattern_size);
+ else if (std::string(args[2]) == "query_8")
+ modifier = new Accept_Query_8(pattern_size);
+ else if (std::string(args[2]) == "query_9")
+ modifier = new Accept_Query_9(pattern_size);
+ else if (std::string(args[2]) == "query_10")
+ modifier = new Accept_Query_10(pattern_size);
+ else if (std::string(args[2]) == "query_11")
+ modifier = new Accept_Query_11(pattern_size);
+ else if (std::string(args[2]) == "query_12")
+ modifier = new Accept_Query_12(pattern_size);
+ else if (std::string(args[2]) == "query_13")
+ modifier = new Accept_Query_13(pattern_size);
+ else if (std::string(args[2]) == "query_14")
+ modifier = new Accept_Query_14(pattern_size);
+ else if (std::string(args[2]) == "query_15")
+ modifier = new Accept_Query_15(pattern_size);
+ else if (std::string(args[2]) == "query_16")
+ // query 16 and query 5 shall both return an empty std::set.
+ modifier = new Accept_Query_5(pattern_size);
+ else if (std::string(args[2]) == "query_17")
+ modifier = new Accept_Query_17(pattern_size);
+ else if (std::string(args[2]) == "query_18")
+ modifier = new Accept_Query_18(pattern_size);
+ else if (std::string(args[2]) == "query_19")
+ modifier = new Accept_Query_19(pattern_size);
+ else if (std::string(args[2]) == "query_20")
+ modifier = new Accept_Query_20(pattern_size);
+ else if (std::string(args[2]) == "query_21")
+ modifier = new Accept_Query_21(pattern_size);
+ else if (std::string(args[2]) == "query_22")
+ modifier = new Accept_Query_22(pattern_size);
+ else if (std::string(args[2]) == "query_23")
+ modifier = new Accept_Query_23(pattern_size);
+ else if (std::string(args[2]) == "query_24")
+ // query 24 and query 5 shall both return an empty std::set.
+ modifier = new Accept_Query_5(pattern_size);
+ else if (std::string(args[2]) == "query_25")
+ modifier = new Accept_Query_25(pattern_size);
+ else if (std::string(args[2]) == "query_26")
+ modifier = new Accept_Around_1(pattern_size, 200.1, false, 11);
+ else if (std::string(args[2]) == "query_27")
+ modifier = new Accept_Around_1(pattern_size, 200.1, false, 7);
+ else if (std::string(args[2]) == "query_28")
+ modifier = new Accept_Query_28(pattern_size);
+ else if (std::string(args[2]) == "query_29")
+ modifier = new Accept_Query_29(pattern_size);
+ else if (std::string(args[2]) == "query_30")
+ modifier = new Accept_Query_30(pattern_size);
+ else if (std::string(args[2]) == "query_31")
+ modifier = new Accept_Query_31(pattern_size);
+ else if (std::string(args[2]) == "query_32")
+ modifier = new Accept_Query_1(pattern_size);
+ else if (std::string(args[2]) == "query_33")
+ modifier = new Accept_Query_1(pattern_size);
+ else if (std::string(args[2]) == "query_34")
+ modifier = new Accept_Query_25(pattern_size);
+ else if (std::string(args[2]) == "query_35")
+ modifier = new Accept_Query_25(pattern_size);
+ else if (std::string(args[2]) == "query_36")
+ modifier = new Accept_Query_17(pattern_size);
+ else if (std::string(args[2]) == "query_37")
+ modifier = new Accept_Query_37(pattern_size);
+ else if (std::string(args[2]) == "query_38")
+ modifier = new Accept_Query_38(pattern_size);
+ else if (std::string(args[2]) == "query_39")
+ modifier = new Accept_Query_39(pattern_size);
+ else if (std::string(args[2]) == "query_40")
+ modifier = new Accept_Query_40(pattern_size);
+ else if (std::string(args[2]) == "query_41")
+ modifier = new Accept_Query_41(pattern_size);
+ else if (std::string(args[2]) == "query_42")
+ modifier = new Accept_Query_42(pattern_size);
+ else if (std::string(args[2]) == "query_43")
+ modifier = new Accept_Query_43(pattern_size);
+ else if (std::string(args[2]) == "query_44")
+ modifier = new Accept_Query_44(pattern_size);
+ else if (std::string(args[2]) == "query_45")
+ modifier = new Accept_Query_45(pattern_size);
+ else if (std::string(args[2]) == "query_46")
+ modifier = new Accept_Query_46(pattern_size);
+ else if (std::string(args[2]) == "query_47")
+ modifier = new Accept_Query_47(pattern_size);
+ else if (std::string(args[2]) == "query_48")
+ modifier = new Accept_Query_45(pattern_size);
+ else if (std::string(args[2]) == "query_49")
+ modifier = new Accept_Query_46(pattern_size);
+ else if (std::string(args[2]) == "query_50")
+ modifier = new Accept_Query_47(pattern_size);
+ else if (std::string(args[2]) == "query_51")
+ modifier = new Accept_Query_51(pattern_size);
+ else if (std::string(args[2]) == "query_52")
+ modifier = new Accept_Query_52(pattern_size);
+ else if (std::string(args[2]) == "query_53")
+ modifier = new Accept_Query_53(pattern_size);
+ else if (std::string(args[2]) == "query_54")
+ modifier = new Accept_Query_54(pattern_size);
+ else if (std::string(args[2]) == "query_55")
+ modifier = new Accept_Query_55(pattern_size);
+ else if (std::string(args[2]) == "query_56")
+ modifier = new Accept_Query_56(pattern_size);
+ else if (std::string(args[2]) == "query_57")
+ modifier = new Accept_Query_57(pattern_size);
+ else if (std::string(args[2]) == "query_58")
+ modifier = new Accept_Query_58(pattern_size);
+ else if (std::string(args[2]) == "query_59")
+ modifier = new Accept_Query_59(pattern_size);
+ else if (std::string(args[2]) == "query_60")
+ modifier = new Accept_Query_60(pattern_size);
+ else if (std::string(args[2]) == "query_61")
+ modifier = new Accept_Query_61(pattern_size);
+ else if (std::string(args[2]) == "query_62")
+ modifier = new Accept_Query_62(pattern_size);
+ else if (std::string(args[2]) == "query_63")
+ modifier = new Accept_Query_63(pattern_size);
+ else if (std::string(args[2]) == "query_64")
+ modifier = new Accept_Query_64(pattern_size);
+ else if (std::string(args[2]) == "query_65")
+ modifier = new Accept_Query_65(pattern_size);
+ else if (std::string(args[2]) == "query_66")
+ modifier = new Accept_Query_66(pattern_size);
+ else if (std::string(args[2]) == "query_67")
+ modifier = new Accept_Query_67(pattern_size);
+ else if (std::string(args[2]) == "query_68")
+ modifier = new Accept_Query_68(pattern_size);
+ else if (std::string(args[2]) == "query_69")
+ modifier = new Accept_Query_69(pattern_size);
+ else if (std::string(args[2]) == "query_70")
+ modifier = new Accept_Query_70(pattern_size);
+ else if (std::string(args[2]) == "query_71")
+ modifier = new Accept_Query_71(pattern_size);
+ else if (std::string(args[2]) == "query_72")
+ modifier = new Accept_Query_72(pattern_size);
+ else if (std::string(args[2]) == "query_73")
+ modifier = new Accept_Query_73(pattern_size);
+ else if (std::string(args[2]) == "query_74")
+ modifier = new Accept_Query_74(pattern_size);
+ else if (std::string(args[2]) == "query_75")
+ modifier = new Accept_Query_75(pattern_size);
+ else if (std::string(args[2]) == "query_76")
+ modifier = new Accept_Query_76(pattern_size);
+ else if (std::string(args[2]) == "query_77")
+ modifier = new Accept_Query_77(pattern_size);
+ else if (std::string(args[2]) == "query_78")
+ modifier = new Accept_Query_78(pattern_size);
+ else if (std::string(args[2]) == "query_79")
+ modifier = new Accept_Query_79(pattern_size);
+ else if (std::string(args[2]) == "query_80")
+ modifier = new Accept_Query_80(pattern_size);
+ else if (std::string(args[2]) == "query_81")
+ modifier = new Accept_Query_81(pattern_size);
+ else if (std::string(args[2]) == "query_82")
+ modifier = new Accept_Query_82(pattern_size);
+ else if (std::string(args[2]) == "query_83")
+ modifier = new Accept_Query_83(pattern_size);
+ else if (std::string(args[2]) == "query_84")
+ modifier = new Accept_Query_84(pattern_size);
+ else if (std::string(args[2]) == "query_85")
+ modifier = new Accept_Query_85(pattern_size);
+ else if (std::string(args[2]) == "query_86")
+ modifier = new Accept_Query_86(pattern_size);
+ else if (std::string(args[2]) == "query_87")
+ modifier = new Accept_Query_87(pattern_size);
+ else if (std::string(args[2]) == "query_88")
+ modifier = new Accept_Query_88(pattern_size);
+ else if (std::string(args[2]) == "query_89")
+ modifier = new Accept_Query_89(pattern_size);
+ else if (std::string(args[2]) == "query_90")
+ modifier = new Accept_Query_90(pattern_size);
+ else if (std::string(args[2]) == "query_91")
+ modifier = new Accept_Query_91(pattern_size);
+ else if (std::string(args[2]) == "query_92")
+ modifier = new Accept_Query_92(pattern_size);
+ else if (std::string(args[2]) == "query_93")
+ modifier = new Accept_Query_93(pattern_size);
+ else if (std::string(args[2]) == "query_94")
+ modifier = new Accept_Query_94(pattern_size);
+ else if (std::string(args[2]) == "query_95")
+ modifier = new Accept_Query_95(pattern_size);
+ else if (std::string(args[2]) == "query_96")
+ modifier = new Accept_Query_96(pattern_size);
+ else if (std::string(args[2]) == "query_97")
+ modifier = new Accept_Query_97(pattern_size);
+ else if (std::string(args[2]) == "query_98")
+ modifier = new Accept_Query_98(pattern_size);
+ else if (std::string(args[2]) == "query_99")
+ modifier = new Accept_Query_99(pattern_size);
+ else if (std::string(args[2]) == "query_100")
+ modifier = new Accept_Query_100(pattern_size);
+ else if (std::string(args[2]) == "query_101")
+ modifier = new Accept_Query_101(pattern_size);
+ else if (std::string(args[2]) == "query_102")
+ modifier = new Accept_Query_102(pattern_size);
+ else if (std::string(args[2]) == "query_103")
+ modifier = new Accept_Query_103(pattern_size);
+ else if (std::string(args[2]) == "query_104")
+ modifier = new Accept_Query_104(pattern_size);
+ else if (std::string(args[2]) == "query_105")
+ modifier = new Accept_Query_105(pattern_size);
+ else if (std::string(args[2]) == "query_106")
+ modifier = new Accept_Query_106(pattern_size);
+ else if (std::string(args[2]) == "query_107")
+ modifier = new Accept_Query_107(pattern_size);
+ else if (std::string(args[2]) == "query_108")
+ modifier = new Accept_Query_108(pattern_size);
+ else if (std::string(args[2]) == "query_109")
+ modifier = new Accept_Query_109(pattern_size);
+ else if (std::string(args[2]) == "query_110")
+ modifier = new Accept_Query_110(pattern_size);
+ else if (std::string(args[2]) == "query_111")
+ modifier = new Accept_Query_111(pattern_size);
+ else if (std::string(args[2]) == "query_112")
+ // query 112 and query 5 shall both return an empty std::set.
+ modifier = new Accept_Query_5(pattern_size);
+ else if (std::string(args[2]) == "query_113")
+ modifier = new Accept_Query_113(pattern_size);
+ else if (std::string(args[2]) == "query_114")
+ modifier = new Accept_Query_114(pattern_size);
+ else if (std::string(args[2]) == "query_115")
+ // query 115 and query 5 shall both return an empty std::set.
+ modifier = new Accept_Query_5(pattern_size);
+ else if (std::string(args[2]) == "query_116")
+ // query 116 and 113 shall return the same result
+ modifier = new Accept_Query_113(pattern_size);
+ else if (std::string(args[2]) == "query_117")
+ modifier = new Accept_Query_117(pattern_size);
+ else if (std::string(args[2]) == "query_118")
+ modifier = new Accept_Query_118(pattern_size);
+ else if (std::string(args[2]) == "query_119")
+ modifier = new Accept_Query_119(pattern_size);
+ else if (std::string(args[2]) == "query_120")
+ modifier = new Accept_Query_118(pattern_size);
+ else if (std::string(args[2]) == "query_121")
+ modifier = new Accept_Query_118(pattern_size);
+ else if (std::string(args[2]) == "query_122")
+ modifier = new Accept_Query_122(pattern_size);
+ else if (std::string(args[2]) == "query_123")
+ modifier = new Accept_Query_122(pattern_size);
+ else if (std::string(args[2]) == "query_124")
+ modifier = new Accept_Query_124(pattern_size);
+ else if (std::string(args[2]) == "query_125")
+ modifier = new Accept_Query_125(pattern_size);
+ else if (std::string(args[2]) == "query_126")
+ modifier = new Accept_Query_125(pattern_size);
+ else if (std::string(args[2]) == "query_127")
+ modifier = new Accept_Around_1(pattern_size, 200.1, false, 11);
+ else if (std::string(args[2]) == "query_128")
+ modifier = new Accept_Around_1(pattern_size, 200.1, false, 7);
+ else if (std::string(args[2]) == "query_129")
+ modifier = new Accept_Query_37(pattern_size);
+ else if (std::string(args[2]) == "query_130")
+ modifier = new Accept_Query_38(pattern_size);
+ else if (std::string(args[2]) == "query_131")
+ modifier = new Accept_Query_39(pattern_size);
+ else if (std::string(args[2]) == "query_132")
+ modifier = new Accept_Query_40(pattern_size);
+ else if (std::string(args[2]) == "query_133")
+ modifier = new Accept_Recurse_23(pattern_size);
+ else if (std::string(args[2]) == "query_134")
+ modifier = new Accept_Recurse_25(pattern_size);
+ else if (std::string(args[2]) == "query_135")
+ modifier = new Accept_Recurse_27(pattern_size);
+ else if (std::string(args[2]) == "query_136")
+ modifier = new Accept_Recurse_24(pattern_size);
+ else if (std::string(args[2]) == "query_137")
+ modifier = new Accept_Recurse_26(pattern_size);
+ else if (std::string(args[2]) == "query_138")
+ modifier = new Accept_Recurse_28(pattern_size);
+ else if (std::string(args[2]) == "query_139")
+ modifier = new Accept_Query_139(pattern_size);
+ else if (std::string(args[2]) == "query_140")
+ modifier = new Accept_Query_140(pattern_size);
+ else if (std::string(args[2]) == "query_141")
+ modifier = new Accept_Query_141(pattern_size);
+ else if (std::string(args[2]) == "query_142")
+ modifier = new Accept_Query_142(pattern_size);
+ else if (std::string(args[2]) == "query_143")
+ modifier = new Accept_Query_143(pattern_size);
+ else if (std::string(args[2]) == "query_144")
+ modifier = new Accept_Query_144(pattern_size);
+ else if (std::string(args[2]) == "query_145")
+ modifier = new Accept_Query_145(pattern_size);
+ else if (std::string(args[2]) == "query_146")
+ modifier = new Accept_Query_146(pattern_size);
+ else if (std::string(args[2]) == "query_147")
+ modifier = new Accept_Query_147(pattern_size);
+ else if (std::string(args[2]) == "query_148")
+ modifier = new Accept_Query_148(pattern_size);
+ else if (std::string(args[2]) == "query_149")
+ modifier = new Accept_Query_149(pattern_size);
+ else if (std::string(args[2]) == "query_150")
+ modifier = new Accept_Query_150(pattern_size);
+ else if (std::string(args[2]) == "query_151")
+ modifier = new Accept_Query_151(pattern_size);
+ else if (std::string(args[2]) == "query_152")
+ modifier = new Accept_Query_28(pattern_size);
+ else if (std::string(args[2]) == "query_153")
+ modifier = new Accept_Query_153(pattern_size);
+ else if (std::string(args[2]) == "query_154")
+ modifier = new Accept_Query_154(pattern_size);
+ else if (std::string(args[2]) == "query_155")
+ modifier = new Accept_Query_155(pattern_size);
+ else if (std::string(args[2]) == "query_156")
+ modifier = new Accept_Query_156(pattern_size);
+ else if (std::string(args[2]) == "query_157")
+ modifier = new Accept_Query_157(pattern_size);
+ else if (std::string(args[2]) == "query_158")
+ modifier = new Accept_Query_158(pattern_size);
+ else if (std::string(args[2]) == "query_159")
+ modifier = new Accept_Query_159(pattern_size);
+ else if (std::string(args[2]) == "query_160")
+ modifier = new Accept_Query_160(pattern_size, true, true, true, true, true, true);
+ else if (std::string(args[2]) == "query_161")
+ modifier = new Accept_Query_160(pattern_size, false, true, true, false, false, false);
+ else if (std::string(args[2]) == "query_162")
+ modifier = new Accept_Query_160(pattern_size, false, false, false, true, false, true);
+ else if (std::string(args[2]) == "query_163")
+ modifier = new Accept_Query_160(pattern_size, true, true, true, true, false, false);
+ else if (std::string(args[2]) == "query_164")
+ modifier = new Accept_Query_160(pattern_size, false, true, true, false, false, false);
+ else if (std::string(args[2]) == "query_165")
+ modifier = new Accept_Query_160(pattern_size, false, false, true, true, true, true);
+ else if (std::string(args[2]) == "query_166")
+ modifier = new Accept_Query_160(pattern_size, false, false, false, true, false, true);
+ else if (std::string(args[2]) == "query_167")
+ modifier = new Accept_Query_160(pattern_size, true, true, false, false, true, true);
+ else if (std::string(args[2]) == "query_168")
+ modifier = new Accept_Query_160(pattern_size, true, false, false, false, false, false);
+ else if (std::string(args[2]) == "query_169")
+ modifier = new Accept_Query_160(pattern_size, false, false, false, false, true, false);
+ else if (std::string(args[2]) == "query_170")
+ modifier = new Accept_Query_170(pattern_size);
+ else if (std::string(args[2]) == "query_171")
+ modifier = new Accept_Query_171(pattern_size);
+ else if (std::string(args[2]) == "query_172")
+ modifier = new Accept_Query_172(pattern_size);
+ else if (std::string(args[2]) == "query_173")
+ modifier = new Accept_Query_173(pattern_size);
+ else if (std::string(args[2]) == "query_174")
+ modifier = new Accept_Query_174(pattern_size);
+ else if (std::string(args[2]) == "query_175")
+ modifier = new Accept_Query_175(pattern_size);
+ else if (std::string(args[2]) == "query_176")
+ modifier = new Accept_Query_175(pattern_size);
+ else if (std::string(args[2]) == "query_177")
+ modifier = new Accept_Query_177(pattern_size);
+ else if (std::string(args[2]) == "query_178")
+ modifier = new Accept_Query_178(pattern_size);
+ else if (std::string(args[2]) == "foreach_1")
+ modifier = new Accept_Foreach_1(pattern_size);
+ else if (std::string(args[2]) == "foreach_2")
+ modifier = new Accept_Foreach_2(pattern_size);
+ else if (std::string(args[2]) == "foreach_3")
+ // query 1 and 3 shall both return the same set.
+ modifier = new Accept_Foreach_1(pattern_size);
+ else if (std::string(args[2]) == "foreach_4")
+ // query 1 and 4 shall both return the same set.
+ modifier = new Accept_Foreach_1(pattern_size);
+ else if (std::string(args[2]) == "union_1")
+ modifier = new Accept_Union_1(pattern_size);
+ else if (std::string(args[2]) == "union_2")
+ modifier = new Accept_Union_2(pattern_size);
+ else if (std::string(args[2]) == "union_3")
+ // query 1 and 3 shall return the same result
+ modifier = new Accept_Union_1(pattern_size);
+ else if (std::string(args[2]) == "union_4")
+ modifier = new Accept_Union_4(pattern_size);
+ else if (std::string(args[2]) == "union_5")
+ modifier = new Accept_Union_5(pattern_size);
+ else if (std::string(args[2]) == "union_6")
+ modifier = new Accept_Union_6(pattern_size);
+ else if (std::string(args[2]) == "difference_1")
+ modifier = new Accept_Difference_1(pattern_size);
+ else if (std::string(args[2]) == "difference_2")
+ modifier = new Accept_Difference_2(pattern_size);
+ else if (std::string(args[2]) == "difference_3")
+ modifier = new Accept_Difference_1(pattern_size);
+ else if (std::string(args[2]) == "difference_4")
+ modifier = new Accept_Difference_4(pattern_size);
+ else if (std::string(args[2]) == "difference_5")
+ modifier = new Accept_Difference_5(pattern_size);
+ else if (std::string(args[2]) == "difference_6")
+ modifier = new Accept_Difference_6(pattern_size);
+ else if (std::string(args[2]) == "complete_1")
+ modifier = new Accept_Complete_1(pattern_size);
+ else if (std::string(args[2]) == "complete_2")
+ modifier = new Accept_Complete_1(pattern_size);
+ else if (std::string(args[2]) == "complete_3")
+ modifier = new Accept_Complete_1(pattern_size);
+ else if (std::string(args[2]) == "complete_4")
+ modifier = new Accept_Complete_1(pattern_size);
+ else if (std::string(args[2]) == "complete_5")
+ modifier = new Accept_Complete_1(pattern_size);
+ else if (std::string(args[2]) == "complete_6")
+ modifier = new Accept_Complete_6(pattern_size, false);
+ else if (std::string(args[2]) == "complete_7")
+ modifier = new Accept_Complete_7(pattern_size, 0);
+ else if (std::string(args[2]) == "if_1")
+ modifier = new Accept_If(2);
+ else if (std::string(args[2]) == "if_2")
+ modifier = new Accept_If(1);
+ else if (std::string(args[2]) == "if_3")
+ modifier = new Accept_If(2);
+ else if (std::string(args[2]) == "if_4")
+ modifier = new Accept_If(3);
+ else if (std::string(args[2]) == "if_5")
+ modifier = new Accept_If(2);
+ else if (std::string(args[2]) == "if_6")
+ modifier = new Accept_If(4);
+ else if (std::string(args[2]) == "around_1")
+ modifier = new Accept_Around_1(pattern_size, 20.01);
+ else if (std::string(args[2]) == "around_2")
+ modifier = new Accept_Around_1(pattern_size, 200.1);
+ else if (std::string(args[2]) == "around_3")
+ modifier = new Accept_Around_1(pattern_size, 2001);
+ else if (std::string(args[2]) == "around_4")
+ modifier = new Accept_Around_1(pattern_size, 200.1);
+ else if (std::string(args[2]) == "around_5")
+ modifier = new Accept_Around_1(pattern_size, 200.1);
+ else if (std::string(args[2]) == "around_6")
+ modifier = new Accept_Around_1(pattern_size, 200.1, true);
+ else if (std::string(args[2]) == "around_7")
+ modifier = new Accept_Around_1(pattern_size, 20.01);
+ else if (std::string(args[2]) == "around_8")
+ modifier = new Accept_Around_1(pattern_size, 200.1);
+ else if (std::string(args[2]) == "around_9")
+ modifier = new Accept_Around_1(pattern_size, 2001);
+ else if (std::string(args[2]) == "around_10" || std::string(args[2]) == "around_14"
+ || std::string(args[2]) == "around_15" || std::string(args[2]) == "around_16" )
+ modifier = new Accept_Around_10(pattern_size);
+ else if (std::string(args[2]) == "around_11" || std::string(args[2]) == "around_12"
+ || std::string(args[2]) == "around_13")
+ modifier = new Accept_Around_11(pattern_size);
+ else if (std::string(args[2]) == "around_17")
+ modifier = new Accept_Around_17(pattern_size);
+ else if (std::string(args[2]) == "around_18")
+ modifier = new Accept_Around_18(pattern_size);
+ else if (std::string(args[2]) == "around_19")
+ modifier = new Accept_Around_19(pattern_size);
+ else if (std::string(args[2]) == "polygon_query_1")
+ modifier = new Accept_Polygon_1(pattern_size);
+ else if (std::string(args[2]) == "polygon_query_2")
+ modifier = new Accept_Polygon_2(pattern_size);
+ else if (std::string(args[2]) == "polygon_query_3")
+ modifier = new Accept_Polygon_3(pattern_size);
+ else if (std::string(args[2]) == "polygon_query_4")
+ modifier = new Accept_Polygon_4(pattern_size);
+ else if (std::string(args[2]) == "polygon_query_5")
+ modifier = new Accept_Polygon_5(pattern_size);
+ else if (std::string(args[2]) == "diff_do")
+ modifier = new Accept_All;
+ else if (std::string(args[2]) == "diff_compare")
+ modifier = new Accept_All_But_5(pattern_size);
+ else if (std::string(args[2]) == "")
+ modifier = new Accept_All;
+ else
+ // return an empty osm file otherwise
+ modifier = new Accept_Bbox_Query_5(pattern_size);
+ }
+ else
+ modifier = new Accept_All;
+
+ if (argc > 3)
+ global_node_offset = atoll(args[3]);
+
+ if ((argc > 2) && (std::string(args[2]) == "diff_do"))
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+
+ std::cout<<"\n";
+ create_node_test_pattern(-10.0, 80.0, -15.0, 105.0, 1, pattern_size, global_node_offset, modifier);
+ std::cout<<"\n";
+
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+
+ std::cout<<"\n";
+ create_way_test_pattern(1, pattern_size, global_node_offset, modifier);
+ std::cout<<"\n";
+
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+
+ std::cout<<"\n";
+ create_relation_test_pattern(1, pattern_size, global_node_offset, modifier);
+ std::cout<<"\n";
+
+ std::cout<<"\n";
+ }
+ else if ((argc > 2) && (std::string(args[2]) == "diff_compare"))
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ create_node_test_pattern(51.0, 52.0, 7.0, 8.0, 0, pattern_size, global_node_offset, modifier);
+ create_node_test_pattern(47.9, 48.1, -0.2, 0.2, 2, pattern_size, global_node_offset, modifier);
+ create_node_test_pattern(30.0, 50.0, -120.0, -60.0, 3, pattern_size, global_node_offset, modifier);
+
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+
+ create_way_test_pattern(0, pattern_size, global_node_offset, modifier);
+ create_way_test_pattern(2, pattern_size, global_node_offset, modifier);
+
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+
+ create_relation_test_pattern(0, pattern_size, global_node_offset, modifier);
+ create_relation_test_pattern(2, pattern_size, global_node_offset, modifier);
+
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+
+ std::cout<<"\n";
+ }
+ else if ((argc > 2) && (std::string(args[2]).substr(0, 5) == "make_"))
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ if (std::string(args[2]) == "make_1")
+ std::cout<<" \n";
+ if (std::string(args[2]) == "make_2")
+ std::cout<<" \n";
+ if (std::string(args[2]) == "make_3")
+ std::cout<<" \n";
+ if (std::string(args[2]) == "make_4")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_5")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_6")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_7")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_8")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_9")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_10")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_11")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_12")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_13")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_14")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_15")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_16")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_17")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_18")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_19")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_20")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_21")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_22")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_23")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_24")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_25")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_26")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_27")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_28")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_29")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_30")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_31")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_32")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_33")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_34")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_35")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_36")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_37")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_38")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_39")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_40")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_41")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_42")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_43")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_44")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_45")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_46")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_47")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_48")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_49")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_50")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_51")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_52")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_53")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_54")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_55")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_56")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_57")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_58")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_59")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_60")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_61")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_62")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_63")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_64")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_65")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_66")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_67")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_68" || std::string(args[2]) == "make_69")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_70" || std::string(args[2]) == "make_71")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_72" || std::string(args[2]) == "make_73")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_74" || std::string(args[2]) == "make_75")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_76")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_77")
+ std::cout<<
+ " \n";
+ if (std::string(args[2]) == "make_78")
+ std::cout<<
+ " \n";
+ if (std::string(args[2]) == "make_79")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_80")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_81")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_82")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_83")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_84")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_85")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_86")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_87" || std::string(args[2]) == "make_88")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_89")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_90")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_91")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_92")
+ std::cout<<
+ " \n";
+ if (std::string(args[2]) == "make_93")
+ std::cout<<
+ " \n";
+ if (std::string(args[2]) == "make_94")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_95")
+ std::cout<<
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_96")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_97")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_98")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_99")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_100")
+ std::cout<<
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_101")
+ std::cout<<
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_102")
+ std::cout<<
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_103")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_104" || std::string(args[2]) == "make_105"
+ || std::string(args[2]) == "make_106")
+ {
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_106")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ std::cout<<
+ " \n";
+ }
+ if (std::string(args[2]) == "make_107")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_108")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_109")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_110")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_111")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_112")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_113")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_114")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_115")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_116")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_117")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_118")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_119")
+ std::cout<<
+ " \n";
+ if (std::string(args[2]) == "make_120")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_121")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_122")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_123")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_124")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_125")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_126")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_127")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_128")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_129")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_130")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_131")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_132")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "make_133")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+
+ std::cout<<"\n";
+ }
+ else if ((argc > 2) && (std::string(args[2]).substr(0, 8) == "convert_"))
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ if (std::string(args[2]) == "convert_1" || std::string(args[2]) == "convert_3")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_4" || std::string(args[2]) == "convert_5")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_6")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_7")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_8")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_9")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_10")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_11")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_12")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_13")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_14")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+ if (std::string(args[2]) == "convert_15")
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n"
+ " \n";
+
+ std::cout<<"\n";
+ }
+ else if ((argc > 2) && (std::string(args[2]) == "complete_6"))
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ create_node_test_pattern(51.0, 52.0, 7.0, 8.0, 0, pattern_size, global_node_offset, modifier);
+ create_way_test_pattern(0, pattern_size, global_node_offset, modifier);
+ create_relation_test_pattern(0, pattern_size, global_node_offset, modifier);
+
+ delete modifier;
+ modifier = new Accept_Complete_6(pattern_size, true);
+
+ create_node_test_pattern(51.0, 52.0, 7.0, 8.0, 0, pattern_size, global_node_offset, modifier);
+ create_way_test_pattern(0, pattern_size, global_node_offset, modifier);
+ create_relation_test_pattern(0, pattern_size, global_node_offset, modifier);
+
+ delete modifier;
+ modifier = new Accept_Complete_6(pattern_size, true);
+
+ create_node_test_pattern(51.0, 52.0, 7.0, 8.0, 0, pattern_size, global_node_offset, modifier);
+ create_way_test_pattern(0, pattern_size, global_node_offset, modifier);
+ create_relation_test_pattern(0, pattern_size, global_node_offset, modifier);
+
+ std::cout<<"\n";
+ }
+ else if ((argc > 2) && (std::string(args[2]) == "complete_7"))
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ for (uint i = 1; i <= 18; ++i)
+ {
+ create_node_test_pattern(51.0, 52.0, 7.0, 8.0, 0, pattern_size, global_node_offset, modifier);
+ create_way_test_pattern(0, pattern_size, global_node_offset, modifier);
+ create_relation_test_pattern(0, pattern_size, global_node_offset, modifier);
+
+ delete modifier;
+ modifier = new Accept_Complete_7(pattern_size, i);
+ }
+
+ std::cout<<"\n";
+ }
+ else
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ create_node_test_pattern(51.0, 52.0, 7.0, 8.0, 0, pattern_size, global_node_offset, modifier);
+ create_node_test_pattern(-10.0, 80.0, -15.0, 105.0, 1, pattern_size, global_node_offset, modifier);
+ create_node_test_pattern(47.9, 48.1, -0.2, 0.2, 2, pattern_size, global_node_offset, modifier);
+ create_node_test_pattern(30.0, 50.0, -120.0, -60.0, 3, pattern_size, global_node_offset, modifier);
+
+ for (uint i = 0; i < 3; ++i)
+ create_way_test_pattern(i, pattern_size, global_node_offset, modifier);
+
+ for (uint i = 0; i < 3; ++i)
+ create_relation_test_pattern(i, pattern_size, global_node_offset, modifier);
+
+ std::cout<<"\n";
+ }
+
+ delete modifier;
+}
diff --git a/src/overpass_api/osm-backend/generate_test_file_areas.cc b/src/overpass_api/osm-backend/generate_test_file_areas.cc
new file mode 100644
index 000000000..9457e1932
--- /dev/null
+++ b/src/overpass_api/osm-backend/generate_test_file_areas.cc
@@ -0,0 +1,618 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+typedef unsigned int uint;
+
+template < typename T >
+struct V : public std::vector< T >
+{
+ V(const T& t) : std::vector< T >(1, t) {}
+ V& operator()(const T& t)
+ {
+ this->push_back(t);
+ return *this;
+ }
+};
+
+struct Data_Modifier
+{
+ virtual bool admit_node(uint id) const = 0;
+ virtual bool admit_node_skeleton(uint id) const = 0;
+ virtual bool admit_node_tags(uint id) const = 0;
+ virtual bool admit_way(uint id) const = 0;
+ virtual bool admit_way_skeleton(uint id) const = 0;
+ virtual bool admit_way_tags(uint id) const = 0;
+ virtual bool admit_relation(uint id) const = 0;
+ virtual bool admit_relation_skeleton(uint id) const = 0;
+ virtual bool admit_relation_tags(uint id) const = 0;
+};
+
+struct Accept_All_Tags : public Data_Modifier
+{
+ virtual bool admit_node_skeleton(uint id) const { return true; }
+ virtual bool admit_node_tags(uint id) const { return true; }
+ virtual bool admit_way_skeleton(uint id) const { return true; }
+ virtual bool admit_way_tags(uint id) const { return true; }
+ virtual bool admit_relation_skeleton(uint id) const { return true; }
+ virtual bool admit_relation_tags(uint id) const { return true; }
+};
+
+struct Accept_All : public Accept_All_Tags
+{
+ virtual bool admit_node(uint id) const { return true; }
+ virtual bool admit_node_skeleton(uint id) const { return true; }
+ virtual bool admit_node_tags(uint id) const { return true; }
+ virtual bool admit_way(uint id) const { return true; }
+ virtual bool admit_way_skeleton(uint id) const { return true; }
+ virtual bool admit_way_tags(uint id) const { return true; }
+ virtual bool admit_relation(uint id) const { return true; }
+ virtual bool admit_relation_skeleton(uint id) const { return true; }
+ virtual bool admit_relation_tags(uint id) const { return true; }
+};
+
+std::vector< std::pair< std::string, std::string > > collect_tags(std::string prefix, uint id)
+{
+ std::vector< std::pair< std::string, std::string > > tags;
+ if (id < 100)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key", prefix + "_few"));
+ if (id % 11 == 0)
+ {
+ std::ostringstream buf;
+ buf<
+ (prefix + "_key_11", buf.str()));
+ }
+ if (id % 15 == 0)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_15", prefix + "_value_15"));
+ if ((id % 2 == 0) && ((prefix == "way") || (prefix == "relation")))
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_2/4", prefix + "_value_0"));
+ if ((id % 4 == 1) && ((prefix == "way") || (prefix == "relation")))
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_2/4", prefix + "_value_1"));
+ if (id % 5 == 0)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_key_5", prefix + "_value_5"));
+ if (id % 7 == 0)
+ {
+ std::ostringstream buf;
+ buf<
+ (prefix + "_key_7", buf.str()));
+ }
+ if (id == 2310)
+ tags.push_back(std::make_pair< std::string, std::string >
+ (prefix + "_unique", prefix + "_2310"));
+ return tags;
+}
+
+void create_node
+ (uint id, double lat, double lon)
+{
+ std::cout<<" \n";
+}
+
+void create_way
+ (uint id, uint start_node_ref, uint end_node_ref, uint stepping,
+ const std::vector< std::pair< std::string, std::string > >& tags)
+{
+ std::cout<<" \n";
+ if (start_node_ref < end_node_ref)
+ {
+ for (uint ref = start_node_ref; ref <= end_node_ref; ref += stepping)
+ std::cout<<" \n";
+ }
+ else
+ {
+ for (uint ref = start_node_ref; (int)ref >= (int)end_node_ref; ref -= stepping)
+ std::cout<<" \n";
+ }
+ for (std::vector< std::pair< std::string, std::string > >::const_iterator
+ it = tags.begin(); it != tags.end(); ++it)
+ std::cout<<" first<<"\" v=\""<second<<"\"/>\n";
+ std::cout<<" \n";
+}
+
+void create_way
+ (uint id, const std::vector< uint >& refs,
+ const std::vector< std::pair< std::string, std::string > >& tags)
+{
+ std::cout<<" \n";
+ for (std::vector< uint >::const_iterator it(refs.begin()); it != refs.end(); ++it)
+ std::cout<<" \n";
+ for (std::vector< std::pair< std::string, std::string > >::const_iterator
+ it = tags.begin(); it != tags.end(); ++it)
+ std::cout<<" first<<"\" v=\""<second<<"\"/>\n";
+ std::cout<<" \n";
+}
+
+void create_relation
+ (uint id, const std::vector< uint >& refs, const std::vector< uint >& types,
+ const std::vector< std::pair< std::string, std::string > >& tags)
+{
+ std::vector< std::string > roles = V< std::string >("zero")("one")("two")("three");
+ std::vector< std::string > typenames = V< std::string >("node")("way")("relation");
+
+ std::cout<<" \n";
+ for (uint i = 0; i < refs.size(); ++i)
+ {
+ std::cout<<" \n";
+ }
+ for (std::vector< std::pair< std::string, std::string > >::const_iterator
+ it = tags.begin(); it != tags.end(); ++it)
+ std::cout<<" first<<"\" v=\""<second<<"\"/>\n";
+ std::cout<<" \n";
+}
+
+void create_node_test_rectangle
+ (uint id, double south, double north, double west, double east)
+{
+ create_node(id, south, west);
+ create_node(id + 1, north, west);
+ create_node(id + 2, north, east);
+ create_node(id + 3, south, east);
+}
+
+void create_way_test_rectangle
+ (uint id, uint node_ref, const std::vector< std::pair< std::string, std::string > >& tags)
+{
+ create_way(id, node_ref, node_ref + 3, 1, tags);
+}
+
+void create_triangle_test_pattern_nodes
+ (uint id, double lat, double lon, double scale)
+{
+ create_node(id, lat + 1*scale, lon + 1*scale);
+ create_node(id + 1, lat + 5*scale, lon + 1*scale);
+ create_node(id + 2, lat + 1*scale, lon + 5*scale);
+
+ create_node(id + 3, lat + 1*scale, lon + 7*scale);
+ create_node(id + 4, lat + 1*scale, lon + 11*scale);
+ create_node(id + 5, lat + 5*scale, lon + 7*scale);
+
+ create_node(id + 6, lat + 1*scale, lon + 13*scale);
+ create_node(id + 7, lat + 1*scale, lon + 15*scale);
+ create_node(id + 8, lat + 5*scale, lon + 13*scale);
+
+ create_node(id + 9, lat + 1*scale, lon + 19*scale);
+ create_node(id + 10, lat + 1*scale, lon + 23*scale);
+ create_node(id + 11, lat + 3*scale, lon + 19*scale);
+
+ create_node(id + 12, lat + 1*scale, lon + 25*scale);
+ create_node(id + 13, lat + 5*scale, lon + 29*scale);
+ create_node(id + 14, lat + 1*scale, lon + 29*scale);
+
+ create_node(id + 15, lat + 1*scale, lon + 31*scale);
+ create_node(id + 16, lat + 1*scale, lon + 35*scale);
+ create_node(id + 17, lat + 5*scale, lon + 35*scale);
+
+ create_node(id + 18, lat + 1*scale, lon + 39*scale);
+ create_node(id + 19, lat + 1*scale, lon + 41*scale);
+ create_node(id + 20, lat + 5*scale, lon + 41*scale);
+
+ create_node(id + 21, lat + 1*scale, lon + 43*scale);
+ create_node(id + 22, lat + 1*scale, lon + 47*scale);
+ create_node(id + 23, lat + 3*scale, lon + 47*scale);
+}
+
+void create_triangle_test_pattern_ways(uint id, uint node_ref, double scale)
+{
+ for (uint i = 1; i <= 8; ++i)
+ {
+ std::vector< std::pair< std::string, std::string > > tags;
+ std::ostringstream v_dr, v_scale;
+ v_dr<("triangle", v_dr.str()));
+ v_scale<("scale", v_scale.str()));
+ create_way(id + i - 1,
+ V< uint >(node_ref + 3*i-3)(node_ref + 3*i-2)(node_ref + 3*i-1)
+ (node_ref + 3*i-3), tags);
+ }
+}
+
+void create_shapes_test_pattern_nodes
+ (uint id, double lat, double lon, double scale, bool restricted = false)
+{
+ create_node(id, lat + 1*scale, lon + 2*scale);
+ create_node(id + 1, lat + 2*scale, lon + 2*scale);
+ create_node(id + 2, lat + 2*scale, lon + 1*scale);
+ create_node(id + 3, lat + 3*scale, lon + 1*scale);
+ create_node(id + 4, lat + 3*scale, lon + 2*scale);
+ create_node(id + 5, lat + 4*scale, lon + 2*scale);
+ create_node(id + 6, lat + 4*scale, lon + 3*scale);
+ create_node(id + 7, lat + 3*scale, lon + 3*scale);
+ create_node(id + 8, lat + 3*scale, lon + 4*scale);
+ create_node(id + 9, lat + 2*scale, lon + 4*scale);
+ create_node(id + 10, lat + 2*scale, lon + 3*scale);
+ create_node(id + 11, lat + 1*scale, lon + 3*scale);
+
+ if (restricted)
+ return;
+
+ for (uint i = 0; i < 4; ++i)
+ {
+ create_node(id + 12 + 2*i, lat + 1*scale, lon + (6+i)*scale);
+ create_node(id + 13 + 2*i, lat + 2*scale, lon + (6+i)*scale);
+ }
+}
+
+void create_shapes_test_pattern_ways(uint id, uint node_ref, double scale)
+{
+ std::vector< std::pair< std::string, std::string > > tags;
+ std::ostringstream v_scale;
+ v_scale<("scale", v_scale.str()));
+
+ tags.push_back(std::make_pair< std::string, std::string >("shapes", "1"));
+ create_way(id, V< uint >(node_ref)(node_ref + 1)(node_ref + 2)
+ (node_ref + 3)(node_ref + 4)(node_ref + 5)(node_ref + 6)(node_ref + 7)
+ (node_ref + 8)(node_ref + 9)(node_ref + 10)(node_ref + 11)(node_ref), tags);
+ tags.pop_back();
+
+ tags.push_back(std::make_pair< std::string, std::string >("shapes", "2"));
+ create_way(id + 1, V< uint >(node_ref + 12)(node_ref + 14)(node_ref + 16)
+ (node_ref + 18)(node_ref + 19)(node_ref + 17)(node_ref + 15)(node_ref + 13)
+ (node_ref + 12), tags);
+}
+
+void create_area_way_ways(uint id, uint node_ref)
+{
+ std::vector< std::pair< std::string, std::string > > tags;
+ tags.push_back(std::make_pair< std::string, std::string >("shapes", "3"));
+
+ create_way(id, V< uint >(node_ref + 43)(node_ref + 45)(node_ref + 85)(node_ref + 47)
+ (node_ref + 208)(node_ref + 207)(node_ref + 204)(node_ref + 243)(node_ref + 43), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("inner_point", "middle"));
+
+ create_way(id + 1, V< uint >(node_ref + 121)(node_ref + 125)(node_ref + 129), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("inner_point", "first"));
+
+ create_way(id + 2, V< uint >(node_ref + 125)(node_ref + 129)(node_ref + 133), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("inner_point", "last"));
+
+ create_way(id + 3, V< uint >(node_ref + 121)(node_ref + 122)(node_ref + 125), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("inner_point", "total"));
+
+ create_way(id + 4, V< uint >(node_ref + 124)(node_ref + 125)(node_ref + 126), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("touch_point", "middle"));
+
+ create_way(id + 11, V< uint >(node_ref + 242)(node_ref + 243)(node_ref + 244), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("touch_point", "first"));
+
+ create_way(id + 12, V< uint >(node_ref + 205)(node_ref + 246)(node_ref + 285), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("touch_point", "last"));
+
+ create_way(id + 13, V< uint >(node_ref + 284)(node_ref + 281)(node_ref + 43), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("touch_point", "multiple_1"));
+
+ create_way(id + 14, V< uint >(node_ref + 4)(node_ref + 45)(node_ref + 47)(node_ref + 8), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("touch_point", "multiple_2"));
+
+ create_way(id + 15, V< uint >(node_ref + 201)(node_ref + 243)(node_ref + 208)(node_ref + 209), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "middle_segment"));
+
+ create_way(id + 21, V< uint >(node_ref + 81)(node_ref + 122)(node_ref + 88)(node_ref + 129), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "first_segment"));
+
+ create_way(id + 22, V< uint >(node_ref + 4)(node_ref + 244)(node_ref + 284), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "last_segment"));
+
+ create_way(id + 23, V< uint >(node_ref + 1)(node_ref + 2)(node_ref + 248), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "single_segment"));
+
+ create_way(id + 24, V< uint >(node_ref + 41)(node_ref + 49), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "lat_segment"));
+
+ create_way(id + 25, V< uint >(node_ref + 121)(node_ref + 129), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "lon_segment"));
+
+ create_way(id + 26, V< uint >(node_ref + 7)(node_ref + 287), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "lat_boundary"));
+
+ create_way(id + 27, V< uint >(node_ref + 204)(node_ref + 207), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("intersect", "lon_boundary"));
+
+ create_way(id + 28, V< uint >(node_ref + 43)(node_ref + 203), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("through", "first_segment"));
+
+ create_way(id + 31, V< uint >(node_ref + 43)(node_ref + 85)(node_ref + 6), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("through", "middle_segment"));
+
+ create_way(id + 32, V< uint >(node_ref + 6)(node_ref + 85)(node_ref + 208)(node_ref + 248), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("through", "last_segment"));
+
+ create_way(id + 33, V< uint >(node_ref + 281)(node_ref + 243)(node_ref + 85), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("through", "single_segment"));
+
+ create_way(id + 34, V< uint >(node_ref + 243)(node_ref + 85), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("touch_segment", "multiple_segments"));
+
+ create_way(id + 41, V< uint >(node_ref + 43)(node_ref + 45)(node_ref + 85)(node_ref + 47)
+ (node_ref + 208)(node_ref + 207)(node_ref + 204)(node_ref + 243)(node_ref + 43), tags);
+}
+
+
+void create_area_relation_relations(uint id, uint node_ref, uint way_ref)
+{
+ std::vector< std::pair< std::string, std::string > > tags;
+ tags.push_back(std::make_pair< std::string, std::string >("nodes", "outside"));
+
+ create_relation(id + 1, V< uint >(node_ref + 245), V< uint >(0), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("nodes", "inside"));
+
+ create_relation(id + 2, V< uint >(node_ref + 165), V< uint >(0), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("ways", "outside"));
+
+ create_relation(id + 11, V< uint >(way_ref + 11), V< uint >(1), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("ways", "inside"));
+
+ create_relation(id + 12, V< uint >(way_ref + 31), V< uint >(1), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("ways", "touch"));
+
+ create_relation(id + 13, V< uint >(way_ref + 41), V< uint >(1), tags);
+
+ tags.pop_back();
+ tags.push_back(std::make_pair< std::string, std::string >("multiple", "last_inside"));
+
+ create_relation(id + 21, V< uint >(node_ref + 245)(node_ref + 286)
+ (way_ref + 11)(way_ref + 11)(way_ref + 31), V< uint >(0)(0)(1)(1)(1), tags);
+}
+
+
+void create_multpolys_test_pattern_nodes
+ (uint id, double lat, double lon, double scale)
+{
+ for (uint i = 0; i < 4; ++i)
+ {
+ create_node(id + 2*i, lat + 1*scale, lon + (1+i)*scale);
+ create_node(id + 1 + 2*i, lat + 2*scale, lon + (1+i)*scale);
+ }
+
+ create_node(id + 11, lat + 1*scale, lon + 6*scale);
+ create_node(id + 12, lat + 1*scale, lon + 8*scale);
+ create_node(id + 13, lat + 3*scale, lon + 6*scale);
+ create_node(id + 14, lat + 3*scale, lon + 8*scale);
+ create_node(id + 15, lat + 2*scale, lon + 7*scale);
+}
+
+void create_multpolys_test_pattern_ways(uint id, uint node_ref, double scale)
+{
+ std::vector< std::pair< std::string, std::string > > tags;
+ for (uint i = 0; i < 3; ++i)
+ {
+ create_way(id + 2*i, V< uint >(node_ref + 2*i)(node_ref + 2 + 2*i), tags);
+ create_way(id + 2*i + 1, V< uint >(node_ref + 1 + 2*i)(node_ref + 3 + 2*i), tags);
+ }
+ create_way(id + 6, V< uint >(node_ref)(node_ref + 1), tags);
+ create_way(id + 7, V< uint >(node_ref + 6)(node_ref + 7), tags);
+
+ create_way(id + 11, V< uint >(node_ref + 11)(node_ref + 12)(node_ref + 14), tags);
+ create_way(id + 12, V< uint >(node_ref + 11)(node_ref + 13)(node_ref + 14), tags);
+ create_way(id + 13, V< uint >(node_ref + 11)(node_ref + 15), tags);
+ create_way(id + 14, V< uint >(node_ref + 15)(node_ref + 14), tags);
+}
+
+void create_multpolys_test_pattern_relations(uint id, uint way_ref, double scale)
+{
+ std::vector< std::pair< std::string, std::string > > tags;
+ std::ostringstream v_scale;
+ v_scale<("scale", v_scale.str()));
+
+ tags.push_back(std::make_pair< std::string, std::string >("multpoly", "1"));
+ create_relation(id, V< uint >(way_ref)(way_ref + 1)(way_ref + 2)(way_ref + 3)
+ (way_ref + 4)(way_ref + 5)(way_ref + 6)(way_ref + 7),
+ V< uint >(1)(1)(1)(1)(1)(1)(1)(1), tags);
+ tags.pop_back();
+
+ tags.push_back(std::make_pair< std::string, std::string >("multpoly", "2"));
+ create_relation(id + 1, V< uint >(way_ref + 11)(way_ref + 13)(way_ref + 14),
+ V< uint >(1)(1)(1), tags);
+ tags.pop_back();
+
+ tags.push_back(std::make_pair< std::string, std::string >("multpoly", "3"));
+ create_relation(id + 2, V< uint >(way_ref + 12)(way_ref + 13)(way_ref + 14),
+ V< uint >(1)(1)(1), tags);
+ tags.pop_back();
+
+ tags.push_back(std::make_pair< std::string, std::string >("multpoly", "4"));
+ create_relation(id + 3, V< uint >(way_ref + 11)(way_ref + 12), V< uint >(1)(1), tags);
+ tags.pop_back();
+}
+
+void create_node_grid
+ (uint id, double south, double north, double west, double east, int pattern_size)
+{
+ for (int i = 0; i <= pattern_size; ++i)
+ {
+ for (int j = 0; j <= pattern_size; ++j)
+ create_node(id + i*(pattern_size + 1) + j,
+ south + (north-south)/pattern_size*i,
+ west + (east-west)/pattern_size*j);
+ }
+}
+
+void create_node_grid_result
+(uint id, double south, double north, double west, double east, int pattern_size)
+{
+ create_shapes_test_pattern_nodes(1201, 11.0, 10.0, 0.01, true);
+
+ for (int i = 0; i <= pattern_size; ++i)
+ {
+ for (int j = 0; j <= pattern_size; ++j)
+ {
+ if (i < pattern_size/5)
+ continue;
+ else if (i < pattern_size*2/5)
+ {
+ if ((j < pattern_size*2/5) || (j > pattern_size*3/5))
+ continue;
+ }
+ else if (i <= pattern_size*3/5)
+ {
+ if ((j < pattern_size/5) || (j > pattern_size*4/5))
+ continue;
+ }
+ else if (i <= pattern_size*4/5)
+ {
+ if ((j < pattern_size*2/5) || (j > pattern_size*3/5))
+ continue;
+ }
+ else
+ continue;
+
+ create_node(id + i*(pattern_size + 1) + j,
+ south + (north-south)/pattern_size*i,
+ west + (east-west)/pattern_size*j);
+ }
+ }
+}
+
+int main(int argc, char* args[])
+{
+ std::string task;
+ uint pattern_size = 20;
+ if (argc > 2)
+ {
+ pattern_size = atoi(args[1]);
+ task = args[2];
+ }
+
+ if (task != "result")
+ {
+ std::cout<<
+ "\n"
+ "\n";
+
+ create_triangle_test_pattern_nodes( 1, 0.0, 0.0, 1.0);
+ create_triangle_test_pattern_nodes(101, 10.0, 0.0, 0.1);
+ create_triangle_test_pattern_nodes(201, 11.0, 0.0, 0.01);
+ create_triangle_test_pattern_nodes(301, 11.1, 0.0, 0.001);
+ create_triangle_test_pattern_nodes(401, 11.11, 0.0, 0.0001);
+ create_triangle_test_pattern_nodes(501, 11.111, 0.0, 0.00001);
+ create_triangle_test_pattern_nodes(601, 11.1111, 0.0, 0.000001);
+
+ create_shapes_test_pattern_nodes(1001, 0.0, 50.0, 1.0);
+ create_shapes_test_pattern_nodes(1101, 10.0, 10.0, 0.1);
+ create_shapes_test_pattern_nodes(1201, 11.0, 10.0, 0.01);
+ create_shapes_test_pattern_nodes(1301, 11.1, 10.0, 0.001);
+ create_shapes_test_pattern_nodes(1401, 11.11, 10.0, 0.0001);
+ create_shapes_test_pattern_nodes(1501, 11.111, 10.0, 0.00001);
+ create_shapes_test_pattern_nodes(1601, 11.1111, 10.0, 0.000001);
+
+ create_multpolys_test_pattern_nodes(2001, 10.0, 20.0, 0.1);
+
+ create_node_grid(10001, 11.0, 11.05, 10.0, 10.05, pattern_size);
+
+ create_node_grid(3000000001u, 30.0, 30.975, 0.0, 0.975, 39);
+
+ create_triangle_test_pattern_ways( 1, 1, 1.0);
+ create_triangle_test_pattern_ways(11, 101, 0.1);
+ create_triangle_test_pattern_ways(21, 201, 0.01);
+ create_triangle_test_pattern_ways(31, 301, 0.001);
+ create_triangle_test_pattern_ways(41, 401, 0.0001);
+ create_triangle_test_pattern_ways(51, 501, 0.00001);
+ create_triangle_test_pattern_ways(61, 601, 0.000001);
+
+ create_shapes_test_pattern_ways(101, 1001, 1.0);
+ create_shapes_test_pattern_ways(111, 1101, 0.1);
+ create_shapes_test_pattern_ways(121, 1201, 0.01);
+ create_shapes_test_pattern_ways(131, 1301, 0.001);
+ create_shapes_test_pattern_ways(141, 1401, 0.0001);
+ create_shapes_test_pattern_ways(151, 1501, 0.00001);
+ create_shapes_test_pattern_ways(161, 1601, 0.000001);
+
+ create_multpolys_test_pattern_ways(201, 2001, 0.1);
+
+ create_area_way_ways(300, 3000000000u);
+
+ create_multpolys_test_pattern_relations(1, 201, 0.1);
+
+ create_area_relation_relations(10, 3000000000u, 300);
+
+ std::cout<<"\n";
+ }
+ else
+ create_node_grid_result(10001, 11.0, 11.05, 10.0, 10.05, pattern_size);
+}
diff --git a/src/overpass_api/osm-backend/generate_test_file_interpreter.cc b/src/overpass_api/osm-backend/generate_test_file_interpreter.cc
new file mode 100644
index 000000000..7693cdc67
--- /dev/null
+++ b/src/overpass_api/osm-backend/generate_test_file_interpreter.cc
@@ -0,0 +1,1321 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include "../core/settings.h"
+
+#include
+#include
+#include
+
+
+double way_1_south(unsigned int pattern_size)
+{
+ return 51. + 1.5/pattern_size;
+}
+
+double way_1_north(unsigned int pattern_size)
+{
+ return 51. + 1.5/pattern_size;
+}
+
+double way_1_west(unsigned int pattern_size)
+{
+ return 7. + .5/pattern_size;
+}
+
+double way_1_east(unsigned int pattern_size)
+{
+ return 7. + 1.5/pattern_size;
+}
+
+unsigned int way_1_zoom(unsigned int pattern_size)
+{
+ if (pattern_size < 80)
+ return 13;
+ else if (pattern_size < 120)
+ return 14;
+ return 15;
+}
+
+double way_2_south(unsigned int pattern_size)
+{
+ return 51. + 1.5/pattern_size;
+}
+
+double way_2_north(unsigned int pattern_size)
+{
+ return 51. + 1.5/pattern_size;
+}
+
+double way_2_west(unsigned int pattern_size)
+{
+ return 7. + 1.5/pattern_size;
+}
+
+double way_2_east(unsigned int pattern_size)
+{
+ return 7. + 2.5/pattern_size;
+}
+
+unsigned int way_2_zoom(unsigned int pattern_size)
+{
+ if (pattern_size < 80)
+ return 13;
+ else if (pattern_size < 120)
+ return 14;
+ return 15;
+}
+
+double relation_1_south(unsigned int pattern_size)
+{
+ return 51. + .5 / pattern_size;
+}
+
+double relation_1_north(unsigned int pattern_size)
+{
+ return 51. + 1.5 / pattern_size;
+}
+
+double relation_1_west(unsigned int pattern_size)
+{
+ return 7. + .5 / pattern_size;
+}
+
+double relation_1_east(unsigned int pattern_size)
+{
+ return 7. + 1.5 / pattern_size;
+}
+
+unsigned int relation_1_zoom(unsigned int pattern_size)
+{
+ if (pattern_size < 80)
+ return 13;
+ else if (pattern_size < 120)
+ return 14;
+ return 15;
+}
+
+double way_meta_south(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 9.99752956;
+ else if (pattern_size > 120)
+ return 9.9909760;
+ else if (pattern_size > 60)
+ return 10.0040832;
+ else
+ return 9.9778688;
+}
+
+double way_meta_north(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 10.00408306;
+ else if (pattern_size > 120)
+ return 10.0171903;
+ else if (pattern_size > 60)
+ return 10.0302975;
+ else
+ return 10.0827263;
+}
+
+double way_meta_west(unsigned int pattern_size)
+{
+ return 0.9961472;
+}
+
+double way_meta_east(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 1.0027007;
+ else if (pattern_size > 60)
+ return 1.0223615;
+ else
+ return 1.1010047;
+}
+
+unsigned int way_meta_zoom(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 14;
+ else if (pattern_size > 60)
+ return 13;
+ else
+ return 11;
+}
+
+double relation_meta_south(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 9.99752956;
+ else if (pattern_size > 120)
+ return 9.9909760;
+ else if (pattern_size > 60)
+ return 10.0040832;
+ else
+ return 9.9778688;
+}
+
+double relation_meta_north(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 10.00408306;
+ else if (pattern_size > 120)
+ return 10.0171903;
+ else if (pattern_size > 60)
+ return 10.0302975;
+ else
+ return 10.0827263;
+}
+
+double relation_meta_west(unsigned int pattern_size)
+{
+ return 0.9961472;
+}
+
+double relation_meta_east(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 1.0027007;
+ else if (pattern_size > 60)
+ return 1.0223615;
+ else
+ return 1.1010047;
+}
+
+unsigned int relation_meta_zoom(unsigned int pattern_size)
+{
+ if (pattern_size > 440)
+ return 14;
+ else if (pattern_size > 60)
+ return 13;
+ else
+ return 11;
+}
+
+
+void print_applicable_tags(unsigned int id)
+{
+ bool frame_printed = false;
+
+ if (id % 11 == 0)
+ {
+ if (!frame_printed)
+ std::cout<<",\n \"tags\": {\n";
+ else
+ std::cout<<",\n";
+ frame_printed = true;
+
+ std::cout<<" \"way_key_11\": \"way_value_"<<(id / 11 + 1)<<"\"";
+ }
+ if (id % 15 == 0)
+ {
+ if (!frame_printed)
+ std::cout<<",\n \"tags\": {\n";
+ else
+ std::cout<<",\n";
+ frame_printed = true;
+
+ std::cout<<" \"way_key_15\": \"way_value_15\"";
+ }
+ if (id % 2 == 0)
+ {
+ if (!frame_printed)
+ std::cout<<",\n \"tags\": {\n";
+ else
+ std::cout<<",\n";
+ frame_printed = true;
+
+ std::cout<<" \"way_key_2/4\": \"way_value_0\"";
+ }
+ if (id % 4 == 1)
+ {
+ if (!frame_printed)
+ std::cout<<",\n \"tags\": {\n";
+ else
+ std::cout<<",\n";
+ frame_printed = true;
+
+ std::cout<<" \"way_key_2/4\": \"way_value_1\"";
+ }
+ if (id % 5 == 0)
+ {
+ if (!frame_printed)
+ std::cout<<",\n \"tags\": {\n";
+ else
+ std::cout<<",\n";
+ frame_printed = true;
+
+ std::cout<<" \"way_key_5\": \"way_value_5\"";
+ }
+ if (id % 7 == 0)
+ {
+ if (!frame_printed)
+ std::cout<<",\n \"tags\": {\n";
+ else
+ std::cout<<",\n";
+ frame_printed = true;
+
+ std::cout<<" \"way_key_7\": \"way_value_"<<(id % 21 / 7)<<"\"";
+ }
+
+ if (frame_printed)
+ std::cout<<"\n }";
+}
+
+
+int main(int argc, char* args[])
+{
+ if (argc < 3)
+ {
+ std::cout<<"Usage: "< 1)
+ pattern_size = atoi(args[1]);
+
+ if (std::string(args[2]) == "interpreter_1" || std::string(args[2]) == "interpreter_2")
+ std::cout<<
+ "Content-type: application/osm3s+xml\n"
+ "\n"
+ "\n"
+ "\n"
+ "The data included in this document is from www.openstreetmap.org. "
+ "The data is made available under ODbL.\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n";
+ else if (std::string(args[2]) == "interpreter_3" || std::string(args[2]) == "interpreter_4"
+ || std::string(args[2]) == "interpreter_5" || std::string(args[2]) == "interpreter_6"
+ || std::string(args[2]) == "interpreter_7" || std::string(args[2]) == "interpreter_8"
+ || std::string(args[2]) == "interpreter_9" || std::string(args[2]) == "interpreter_10")
+ {
+ std::cout<<
+ "Status: 400 Bad Request\n"
+ "Content-type: text/html; charset=utf-8\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ " \n"
+ " OSM3S Response\n"
+ "\n"
+ "\n"
+ "\n"
+ "The data included in this document is from www.openstreetmap.org. "
+ "The data is made available under ODbL.
\n";
+ if (std::string(args[2]) == "interpreter_3")
+ std::cout<<
+ "Error: line 1: parse error: Unknown type "foo"
\n"
+ "Error: line 1: parse error: An empty query is not allowed
\n";
+ else if (std::string(args[2]) == "interpreter_4")
+ std::cout<<
+ "Error: line 3: static error: Unknown tag "foo" in line 3.
\n";
+ else if (std::string(args[2]) == "interpreter_5")
+ std::cout<<
+ "Error: line 1: parse error: Unknown type "foo"
\n"
+ "Error: line 1: parse error: An empty query is not allowed
\n";
+ else if (std::string(args[2]) == "interpreter_6")
+ std::cout<<
+ "Error: line 2: parse error: Unknown type "foo"
\n"
+ "Error: line 2: parse error: An empty query is not allowed
\n";
+ else if (std::string(args[2]) == "interpreter_7")
+ std::cout<<
+ "Error: line 1: parse error: Unknown type "foo"
\n"
+ "Error: line 1: parse error: An empty query is not allowed
\n"
+ "Error: line 2: parse error: Unknown type "foo"
\n"
+ "Error: line 2: parse error: An empty query is not allowed
\n";
+ else if (std::string(args[2]) == "interpreter_8")
+ std::cout<<
+ "Error: line 3: static error: Unknown tag "foo" in line 3.
\n";
+ else if (std::string(args[2]) == "interpreter_9")
+ std::cout<<
+ "Error: line 4: static error: Unknown tag "foo" in line 4.
\n";
+ else if (std::string(args[2]) == "interpreter_10")
+ std::cout<<
+ "Error: line 3: static error: Unknown tag "foo" in line 3.
\n"
+ "Error: line 4: static error: Unknown tag "foo" in line 4.
\n";
+ std::cout<<
+ "\n"
+ "\n"
+ "\n";
+ }
+ else if (std::string(args[2]) == "interpreter_11" || std::string(args[2]) == "interpreter_12"
+ || std::string(args[2]) == "interpreter_13" || std::string(args[2]) == "interpreter_14"
+ || std::string(args[2]) == "interpreter_15" || std::string(args[2]) == "interpreter_16"
+ || std::string(args[2]) == "interpreter_17" || std::string(args[2]) == "interpreter_18"
+ || std::string(args[2]) == "interpreter_19" || std::string(args[2]) == "interpreter_20"
+ || std::string(args[2]) == "interpreter_21" || std::string(args[2]) == "interpreter_22"
+ || std::string(args[2]) == "interpreter_23" || std::string(args[2]) == "interpreter_38"
+ || std::string(args[2]) == "interpreter_45")
+ {
+ std::cout<<
+ "Content-type: application/json\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_38")
+ std::cout<<"foo(";
+ std::cout<<
+ "{\n"
+ " \"version\": 0.6,\n"
+ " \"generator\": \"Overpass API "< pattern_size*pattern_size/2; --i)
+ std::cout<<",\n "<\n"
+ "\n"
+ "\n"
+ "\n"
+ " \n"
+ " OSM3S Response\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_24")
+ std::cout<<"\n";
+ else
+ std::cout<<"\n";
+ std::cout<<
+ "\n"
+ "The data included in this document is from www.openstreetmap.org. "
+ "The data is made available under ODbL.
\n"
+ "Data included until: mock-up-init
\n";
+ if (std::string(args[2]) == "interpreter_24")
+ std::cout<<"No results found.
\n";
+ else
+ {
+ std::cout<<
+ " \n"
+ " \n"
+ " \n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_25" || std::string(args[2]) == "interpreter_27"
+ || std::string(args[2]) == "interpreter_29")
+ std::cout<<"1 results found
\n";
+ else if (std::string(args[2]) == "interpreter_26" || std::string(args[2]) == "interpreter_28"
+ || std::string(args[2]) == "interpreter_30" || std::string(args[2]) == "interpreter_31"
+ || std::string(args[2]) == "interpreter_32" || std::string(args[2]) == "interpreter_33")
+ std::cout<<"2 results found
\n";
+ else
+ std::cout<<"3 results found
\n";
+ std::cout<<
+ "\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_25" || std::string(args[2]) == "interpreter_26"
+ || std::string(args[2]) == "interpreter_31" || std::string(args[2]) == "interpreter_32"
+ || std::string(args[2]) == "interpreter_34" || std::string(args[2]) == "interpreter_36"
+ || std::string(args[2]) == "interpreter_37")
+ {
+ std::cout<<
+ "\n"
+ "\n"
+ "
\n"
+ "
Loading data ...
\n"
+ "
\n"
+ "
\n"
+ "\n"
+ "
Node 1, lat: "<\n";
+ if (std::string(args[2]) != "interpreter_36")
+ std::cout<<
+ "node_key = node_few
\n";
+ std::cout<<
+ "\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ }
+ if (std::string(args[2]) == "interpreter_35")
+ std::cout<<
+ "\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_26")
+ std::cout<<
+ "\n"
+ "\n"
+ "
\n"
+ "
Loading data ...
\n"
+ "
\n"
+ "
\n"
+ "\n"
+ "
Node "<<3*pattern_size + 3<<", lat: "<\n"
+ "\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ if (std::string(args[2]) == "interpreter_27" || std::string(args[2]) == "interpreter_28"
+ || std::string(args[2]) == "interpreter_31" || std::string(args[2]) == "interpreter_33"
+ || std::string(args[2]) == "interpreter_34")
+ {
+ std::cout<<
+ "\n"
+ "\n"
+ "
\n"
+ "
Loading data ...
\n"
+ "
\n"
+ "
\n"
+ "\n"
+ "
Way 1, bounding box south: "<\n";
+ if (std::string(args[2]) != "interpreter_36")
+ std::cout<<
+ "way_key = way_few
\n"
+ "way_key_2/4 = way_value_1
\n";
+ std::cout<<
+ " members: "<\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ }
+ if (std::string(args[2]) == "interpreter_35")
+ std::cout<<
+ "\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_36")
+ std::cout<<
+ "\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_37")
+ std::cout<<
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "
Way 1, no geographic reference
\n"
+ "way_key = way_few
\n"
+ "way_key_2/4 = way_value_1
\n"
+ " members: "<\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ if (std::string(args[2]) == "interpreter_28")
+ std::cout<<
+ "\n"
+ "\n"
+ "
\n"
+ "
Loading data ...
\n"
+ "
\n"
+ "
\n"
+ "\n"
+ "
Way 2, bounding box south: "<\n"
+ "way_key = way_few
\n"
+ "way_key_2/4 = way_value_0
\n"
+ " members: "<\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ if (std::string(args[2]) == "interpreter_30"
+ || std::string(args[2]) == "interpreter_32" || std::string(args[2]) == "interpreter_33"
+ || std::string(args[2]) == "interpreter_34")
+ {
+ std::cout<<
+ "\n"
+ "\n"
+ "
\n"
+ "
Loading data ...
\n"
+ "
\n"
+ "
\n"
+ "\n"
+ "
Relation 1, bounding box south: "<\n";
+ if (std::string(args[2]) != "interpreter_36")
+ std::cout<<
+ "relation_key = relation_few
\n"
+ "relation_key_2/4 = relation_value_1
\n";
+ std::cout<<
+ " members: node 1 "one", node "< "two"
\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ }
+ if (std::string(args[2]) == "interpreter_35")
+ std::cout<<
+ "\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_36")
+ std::cout<<
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "
Relation 1, no geographic reference
\n"
+ " members: node 1 "one", node "< "two"
\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ if (std::string(args[2]) == "interpreter_29" || std::string(args[2]) == "interpreter_37")
+ std::cout<<
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "
Relation 1, no geographic reference
\n"
+ "relation_key = relation_few
\n"
+ "relation_key_2/4 = relation_value_1
\n"
+ " members: node 1 "one", node "< "two"
\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ if (std::string(args[2]) == "interpreter_30")
+ std::cout<<
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "
Relation 9, no geographic reference
\n"
+ "relation_key = relation_few
\n"
+ "relation_key_2/4 = relation_value_1
\n"
+ " members: relation 1 "three", relation 2 "zero", relation 3 "one", relation 4 "two", relation 5 "three", relation 6 "zero"
\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n";
+ }
+ std::cout<<
+ "\n"
+ "\n"
+ "\n";
+ }
+ else if (std::string(args[2]) == "interpreter_42" || std::string(args[2]) == "interpreter_43"
+ || std::string(args[2]) == "interpreter_44")
+ {
+ std::cout<<
+ "Content-type: text/html; charset=utf-8\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ " \n"
+ " OSM3S Response\n"
+ "\n"
+ "\n"
+ "\n"
+ "The data included in this document is from www.openstreetmap.org. "
+ "The data is made available under ODbL.
\n"
+ "Data included until: mock-up-init
\n";
+ if (std::string(args[2]) == "interpreter_42")
+ std::cout<<"1 results found
\n";
+ else if (std::string(args[2]) == "interpreter_43")
+ std::cout<<"3 results found
\n";
+ if (std::string(args[2]) == "interpreter_44")
+ std::cout<<"6 results found
\n";
+ std::cout<<
+ "\n"
+ "\n"
+ "\n"
+ "Node 1, lat: "<\n"
+ "node_key = node_few
\n"
+ "\n"
+ "Browse on openstreetmap.org
\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_44")
+ std::cout<<
+ "Node "<<3*pattern_size + 3<<", lat: "<\n"
+ "\n"
+ "Browse on openstreetmap.org
\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_43" || std::string(args[2]) == "interpreter_44")
+ std::cout<<
+ "Way 1, bounding box south: "<\n"
+ "way_key = way_few
\n"
+ "way_key_2/4 = way_value_1
\n"
+ " members: "<\n"
+ "Browse on openstreetmap.org
\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_44")
+ std::cout<<
+ "Way 2, bounding box south: "<\n"
+ "way_key = way_few
\n"
+ "way_key_2/4 = way_value_0
\n"
+ " members: "<\n"
+ "Browse on openstreetmap.org
\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_43" || std::string(args[2]) == "interpreter_44")
+ std::cout<<
+ "Relation 1, bounding box south: "<\n"
+ "relation_key = relation_few
\n"
+ "relation_key_2/4 = relation_value_1
\n"
+ " members: node 1 "one", node "< "two"
\n"
+ "Browse on openstreetmap.org
\n"
+ "\n";
+ if (std::string(args[2]) == "interpreter_44")
+ std::cout<<
+ "Relation 9, no geographic reference
\n"
+ "relation_key = relation_few
\n"
+ "relation_key_2/4 = relation_value_1
\n"
+ " members: relation 1 "three", relation 2 "zero", relation 3 "one", relation 4 "two", relation 5 "three", relation 6 "zero"
\n"
+ "Browse on openstreetmap.org
\n"
+ "\n";
+ std::cout<<
+ "\n"
+ "\n";
+ }
+ else if (std::string(args[2]) == "interpreter_46")
+ {
+ std::cout<<
+ "Content-type: application/json\n"
+ "\n"
+ "{\n"
+ " \"version\": 0.6,\n"
+ " \"generator\": \"Overpass API "<\n"
+ "\n"
+ "\n"
+ "\n"
+ " \n"
+ " OSM3S Response\n"
+ "\n"
+ "\n"
+ "\n"
+ "The data included in this document is from www.openstreetmap.org. "
+ "The data is made available under ODbL.
\n"
+ "Data included until: mock-up-init
\n"
+ " \n"
+ " \n"
+ " \n"
+ "\n"
+ "3 results found
\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "
\n"
+ "
Loading data ...
\n"
+ "
\n"
+ "
\n"
+ "\n"
+ "
Node 7, lat: "<\n"
+ "foo = bar
\n"
+ "\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "\n"
+ "
Relation 1, no geographic reference
\n"
+ " members: node 1 "one", node 2 "two"
\n"
+ "Browse on openstreetmap.org
\n"
+ "
\n"
+ "\n"
+ "\n"
+ "\n";
+ }
+}
diff --git a/src/overpass_api/osm-backend/generate_test_file_meta.cc b/src/overpass_api/osm-backend/generate_test_file_meta.cc
new file mode 100644
index 000000000..1a3b2563e
--- /dev/null
+++ b/src/overpass_api/osm-backend/generate_test_file_meta.cc
@@ -0,0 +1,451 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include "../core/settings.h"
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+
+typedef unsigned int uint;
+
+template < typename T >
+struct V : public std::vector< T >
+{
+ V(const T& t) : std::vector< T >(1, t) {}
+ V& operator()(const T& t)
+ {
+ this->push_back(t);
+ return *this;
+ }
+};
+
+struct Print_Control
+{
+ Print_Control() : uid(0), tags_allowed_only(false) {}
+ Print_Control(uint pattern_size_, uint uid_, const std::string& timestamp_, bool tags_allowed_only_, bool bbox_limited_)
+ : pattern_size(pattern_size_), uid(uid_), timestamp(timestamp_),
+ tags_allowed_only(tags_allowed_only_), bbox_limited(bbox_limited_) {}
+
+ void meta_data(uint id, int variant) const;
+ bool print_allowed(uint id, int variant) const;
+
+ private:
+ uint pattern_size;
+ uint uid;
+ std::string timestamp;
+ bool tags_allowed_only;
+ bool bbox_limited;
+};
+
+void Print_Control::meta_data(uint id, int variant) const
+{
+ std::cout<<" version=\""<<((id + variant) % 256 + 1)<<"\""
+ " timestamp=\"20"< pattern_size*pattern_size/2 || (id-1) % pattern_size >= pattern_size/2)
+ return false;
+ }
+ else if (variant == 2 || variant == 5)
+ {
+ if (id > pattern_size*pattern_size/2 || id % pattern_size > pattern_size/2)
+ return false;
+ }
+ else if (variant == 3 || variant == 6)
+ {
+ if (id > pattern_size)
+ return false;
+ }
+ }
+
+ if (timestamp != "")
+ {
+ std::ostringstream buf;
+ buf<<"20"<= timestamp);
+ }
+
+ if (uid == 0)
+ return true;
+
+ return (uid == ((id/100 + variant) % 9990 + 10));
+}
+
+
+void create_node(uint id, double lat, double lon,
+ const Print_Control& print_control, bool after_altered = false, bool more_tags = false)
+{
+ std::cout<<" \n";
+ if (more_tags && id % 2 == 0)
+ tags += " \n";
+ if (more_tags && id % 100 == 0)
+ tags += " \n";
+
+ if (tags == "")
+ std::cout<<"/>\n";
+ else
+ std::cout<<">\n"<\n";
+}
+
+
+void fill_bbox_with_nodes
+ (double south, double north, double west, double east,
+ uint begin_id, uint end_id, const Print_Control& print_control,
+ bool after_altered = false, bool more_tags = false)
+{
+ int sqrt_ = sqrt(end_id - begin_id);
+ for (int i = 0; i < sqrt_; ++i)
+ {
+ for (int j = 0; j < sqrt_; ++j)
+ {
+ if (print_control.print_allowed(begin_id + i*sqrt_ + j, after_altered ? 4 : 1))
+ create_node(begin_id + i*sqrt_ + j,
+ (north - south)/sqrt_*(0.5 + i) + south,
+ (east - west)/sqrt_*(0.5 + j) + west,
+ print_control, after_altered, more_tags);
+ }
+ }
+}
+
+void create_way
+ (uint id, uint start_node_ref, uint end_node_ref, uint stepping,
+ const Print_Control& print_control, bool after_altered = false, bool more_tags = false)
+{
+ if (!print_control.print_allowed(id, after_altered ? 5 : 2))
+ return;
+
+ std::cout<<" \n";
+ if (start_node_ref < end_node_ref)
+ {
+ for (uint ref = start_node_ref; ref <= end_node_ref; ref += stepping)
+ std::cout<<" \n";
+ }
+ else
+ {
+ for (uint ref = start_node_ref; (int)ref >= (int)end_node_ref; ref -= stepping)
+ std::cout<<" \n";
+ }
+ if (id % 7 == 0)
+ std::cout<<" \n";
+ if (more_tags && id % 2 == 0)
+ std::cout<<" \n";
+ if (more_tags && id % 100 == 0)
+ std::cout<<" \n";
+ std::cout<<" \n";
+}
+
+void create_relation
+ (uint id, const std::vector< uint >& refs, const std::vector< uint >& types,
+ const Print_Control& print_control, bool after_altered = false, bool more_tags = false)
+{
+ if (!print_control.print_allowed(id, after_altered ? 6 : 3))
+ return;
+
+ std::vector< std::string > roles = V< std::string >("zero")("one")("two")("three");
+ std::vector< std::string > typenames = V< std::string >("node")("way")("relation");
+
+ std::cout<<" \n";
+ for (uint i = 0; i < refs.size(); ++i)
+ {
+ std::cout<<" \n";
+ }
+ if (id % 7 == 0)
+ std::cout<<" \n";
+ if (more_tags && id % 2 == 0)
+ std::cout<<" \n";
+ if (more_tags && id % 100 == 0)
+ std::cout<<" \n";
+ std::cout<<" \n";
+}
+
+void create_node_test_pattern
+ (double south, double north, double west, double east, uint id, uint size,
+ const Print_Control& print_control, bool after_altered = false, bool more_tags = false)
+{
+ fill_bbox_with_nodes
+ (south, north, west, east,
+ id*size*size + 1, (id+1)*size*size + 1, print_control, after_altered, more_tags);
+}
+
+void create_way_test_pattern(uint id, uint size,
+ const Print_Control& print_control,
+ bool pos_altered = false, bool after_altered = false, bool more_tags = false)
+{
+ if (pos_altered)
+ {
+ for (uint i = 0; i < size*size-1; ++i)
+ create_way(id*size*size + i+1, id*size*size + (i%size)+1, id*size*size + (i%size)+2, 1,
+ print_control, after_altered, more_tags);
+ }
+ else
+ {
+ for (uint i = id*size*size + 1; i < (id+1)*size*size; ++i)
+ create_way(i, i, i+1, 1, print_control, after_altered, more_tags);
+ }
+}
+
+void create_relation_test_pattern(uint id, uint size,
+ const Print_Control& print_control,
+ bool pos_altered = false, bool after_altered = false, bool more_tags = false)
+{
+ if (pos_altered)
+ {
+ create_relation(id*size + 1,
+ V< uint >((id+1)*size*size - 1)((id+1)*size*size - 2),
+ V< uint >(0)(0), print_control, after_altered, more_tags);
+ create_relation(id*size + 2,
+ V< uint >((id+1)*size*size - 1)((id+1)*size*size - 2),
+ V< uint >(1)(1), print_control, after_altered, more_tags);
+ create_relation(id*size + 3,
+ V< uint >((id+1)*size*size - 1)((id+1)*size*size - 2),
+ V< uint >(0)(1), print_control, after_altered, more_tags);
+ }
+ else
+ {
+ create_relation(id*size + 1,
+ V< uint >(id*size*size + 1)(id*size*size + 2),
+ V< uint >(0)(0), print_control, after_altered, more_tags);
+ create_relation(id*size + 2,
+ V< uint >(id*size*size + 1)(id*size*size + 2),
+ V< uint >(1)(1), print_control, after_altered, more_tags);
+ create_relation(id*size + 3,
+ V< uint >(id*size*size + 1)(id*size*size + 2),
+ V< uint >(0)(1), print_control, after_altered, more_tags);
+ }
+}
+
+int main(int argc, char* args[])
+{
+ uint pattern_size = 2;
+ uint uid = 0;
+ std::string timestamp;
+ bool tags_allowed_only = false;
+ bool bbox_limited = false;
+ bool more_tags = false;
+ if (argc > 1)
+ pattern_size = atoi(args[1]);
+ enum { before, diff, after, augmented } pattern = before;
+ if (argc > 2)
+ {
+ if (std::string(args[2]) == "diff")
+ pattern = diff;
+ else if (std::string(args[2]) == "after")
+ pattern = after;
+ else if (std::string(args[2]) == "augmented")
+ pattern = augmented;
+ else if (std::string(args[2]) == "more_tags")
+ more_tags = true;
+ }
+ if (argc > 3)
+ {
+ if (std::string(args[3]).substr(0, 4) == "uid=")
+ uid = atoll(args[3] + 4);
+ else if (std::string(args[3]).substr(0, 10) == "timestamp=")
+ timestamp = std::string(args[3] + 10);
+ }
+ if (argc > 4)
+ {
+ if (std::string(args[4]) == "tags")
+ tags_allowed_only = true;
+ if (std::string(args[4]) == "bbox")
+ bbox_limited = true;
+ if (std::string(args[4]) == "tags_bbox")
+ {
+ bbox_limited = true;
+ tags_allowed_only = true;
+ }
+ }
+
+ Print_Control print_control(pattern_size, uid, timestamp, tags_allowed_only, bbox_limited);
+
+ std::cout<<
+ "\n"
+ "\n"
+ "The data included in this document is from www.openstreetmap.org. "
+ "The data is made available under ODbL.\n"
+ "\n\n";
+
+ if (bbox_limited)
+ std::cout<<" \n\n";
+
+ if (pattern == before)
+ {
+ create_node_test_pattern(10.0, 11.0, 1.0, 2.0, 0, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 2.0, 3.0, 1, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 3.0, 4.0, 2, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 4.0, 5.0, 3, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 5.0, 6.0, 4, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 5, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 6, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 7, pattern_size, print_control, false, more_tags);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 8, pattern_size, print_control, false, more_tags);
+
+ for (uint i = 0; i < 6; ++i)
+ create_way_test_pattern(i, pattern_size, print_control, false, false, more_tags);
+
+ create_way(pattern_size*pattern_size*6,
+ 1, pattern_size*pattern_size*2 + 1, pattern_size*pattern_size*2, print_control,
+ false, more_tags);
+
+ for (uint i = 0; i < 6; ++i)
+ create_relation_test_pattern(i, pattern_size, print_control, false, false, more_tags);
+ }
+ else if (pattern == diff)
+ {
+ create_node_test_pattern(10.0, 11.0, 2.0, 3.0, 1, pattern_size, print_control, true);
+ create_node_test_pattern(11.0, 12.0, 3.0, 4.0, 2, pattern_size, print_control);
+ std::cout<<"\n";
+ create_node_test_pattern(10.0, 11.0, 4.0, 5.0, 3, pattern_size, print_control);
+ std::cout<<"\n";
+ create_node_test_pattern(10.0, 11.0, 5.0, 6.0, 4, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 5, pattern_size, print_control);
+ std::cout<<"\n";
+ create_node_test_pattern(10.0, 11.0, 7.0, 8.0, 6, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 8.0, 9.0, 7, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 9.0, 10.0, 8, pattern_size, print_control);
+ std::cout<<"\n";
+
+ create_way_test_pattern(1, pattern_size, print_control, false, true);
+ std::cout<<"\n";
+ create_way_test_pattern(3, pattern_size, print_control);
+ std::cout<<"\n";
+ create_way_test_pattern(4, pattern_size, print_control, true, false);
+
+ create_relation_test_pattern(1, pattern_size, print_control, false, true);
+ std::cout<<"\n";
+ create_relation_test_pattern(3, pattern_size, print_control);
+ std::cout<<"\n";
+ create_relation_test_pattern(5, pattern_size, print_control, true, false);
+ }
+ else if (pattern == after)
+ {
+ create_node_test_pattern(10.0, 11.0, 1.0, 2.0, 0, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 2.0, 3.0, 1, pattern_size, print_control, true);
+ create_node_test_pattern(11.0, 12.0, 3.0, 4.0, 2, pattern_size, print_control);
+ // nodes 3 deleted
+ create_node_test_pattern(10.0, 11.0, 5.0, 6.0, 4, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 5, pattern_size, print_control);
+ // nodes 6 to 8 deleted
+
+ create_way_test_pattern(0, pattern_size, print_control);
+ create_way_test_pattern(1, pattern_size, print_control, false, true);
+ create_way_test_pattern(2, pattern_size, print_control);
+ create_way_test_pattern(4, pattern_size, print_control, true, false);
+ create_way_test_pattern(5, pattern_size, print_control);
+
+ create_way(pattern_size*pattern_size*6,
+ 1, pattern_size*pattern_size*2 + 1, pattern_size*pattern_size*2, print_control);
+
+ create_relation_test_pattern(0, pattern_size, print_control);
+ create_relation_test_pattern(1, pattern_size, print_control, false, true);
+ create_relation_test_pattern(2, pattern_size, print_control);
+ create_relation_test_pattern(4, pattern_size, print_control);
+ create_relation_test_pattern(5, pattern_size, print_control, true, false);
+ }
+ else if (pattern == augmented)
+ {
+ std::cout<<"\n";
+ create_node_test_pattern(10.0, 11.0, 2.0, 3.0, 1, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 3.0, 4.0, 2, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 4.0, 5.0, 3, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 5.0, 6.0, 4, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 5, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 6, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 7, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 8, pattern_size, print_control);
+ std::cout<<"\n";
+ std::cout<<"\n";
+ create_node(1, 10.0 + 0.5/pattern_size, 1.0 + 0.5/pattern_size, print_control);
+ std::cout<<"\n";
+ std::cout<<"\n";
+ create_node_test_pattern(10.0, 11.0, 2.0, 3.0, 1, pattern_size, print_control, true);
+ create_node_test_pattern(11.0, 12.0, 3.0, 4.0, 2, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 5.0, 6.0, 4, pattern_size, print_control);
+ create_node_test_pattern(10.0, 11.0, 6.0, 7.0, 5, pattern_size, print_control);
+ std::cout<<"\n";
+
+ std::cout<<"\n";
+ create_way_test_pattern(1, pattern_size, print_control);
+ create_way_test_pattern(3, pattern_size, print_control);
+ create_way_test_pattern(4, pattern_size, print_control);
+ std::cout<<"\n";
+ std::cout<<"\n";
+ create_way_test_pattern(2, pattern_size, print_control);
+ create_way_test_pattern(5, pattern_size, print_control);
+ create_way(pattern_size*pattern_size*6,
+ 1, pattern_size*pattern_size*2 + 1, pattern_size*pattern_size*2, print_control);
+ std::cout<<"\n";
+ std::cout<<"\n";
+ create_way_test_pattern(1, pattern_size, print_control, false, true);
+ create_way_test_pattern(4, pattern_size, print_control, true, false);
+ std::cout<<"\n";
+
+ std::cout<<"\n";
+ create_relation_test_pattern(1, pattern_size, print_control);
+ create_relation_test_pattern(3, pattern_size, print_control);
+ create_relation_test_pattern(5, pattern_size, print_control);
+ std::cout<<"\n";
+ std::cout<<"\n";
+ create_relation_test_pattern(2, pattern_size, print_control);
+ create_relation_test_pattern(4, pattern_size, print_control);
+ std::cout<<"\n";
+ std::cout<<"\n";
+ create_relation_test_pattern(1, pattern_size, print_control, false, true);
+ create_relation_test_pattern(5, pattern_size, print_control, true, false);
+ std::cout<<"\n";
+ }
+
+ std::cout<<"\n\n";
+}
diff --git a/src/overpass_api/osm-backend/node_updater.test.cc b/src/overpass_api/osm-backend/node_updater.test.cc
new file mode 100644
index 000000000..bcb507ffd
--- /dev/null
+++ b/src/overpass_api/osm-backend/node_updater.test.cc
@@ -0,0 +1,218 @@
+/** Copyright 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018 Roland Olbricht et al.
+ *
+ * This file is part of Overpass_API.
+ *
+ * Overpass_API is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * Overpass_API is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Overpass_API. If not, see .
+ */
+
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "../../expat/expat_justparse_interface.h"
+#include "../../template_db/random_file.h"
+#include "../../template_db/transaction.h"
+#include "../core/settings.h"
+#include "../frontend/output.h"
+#include "node_updater.h"
+
+
+/**
+ * Tests the library node_updater with a sample OSM file
+ */
+
+Node_Updater* node_updater;
+Node current_node;
+//std::vector< std::pair< uint32, uint32 > > id_idxs;
+std::ofstream* coord_source_out;
+std::ofstream* tags_source_out;
+Osm_Backend_Callback* callback;
+uint32 DEBUG_nodes_count, DEBUG_update_count, DEBUG_nodes_8, DEBUG_nodes_64;
+
+uint32 osm_element_count;
+
+void start(const char *el, const char **attr)
+{
+ if (!strcmp(el, "tag"))
+ {
+ if (current_node.id.val() > 0)
+ {
+ std::string key(""), value("");
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "k"))
+ key = attr[i+1];
+ if (!strcmp(attr[i], "v"))
+ value = attr[i+1];
+ }
+ current_node.tags.push_back(std::make_pair(key, value));
+
+ *tags_source_out<set_node(current_node);
+
+ if (osm_element_count >= 4*1024*1024)
+ {
+ callback->node_elapsed(current_node.id);
+ node_updater->update(callback, 0, true);
+ callback->parser_started();
+ osm_element_count = 0;
+ }
+
+ current_node.id = Node::Id_Type();
+ }
+ ++osm_element_count;
+}
+
+void cleanup_files(const File_Properties& file_properties, std::string db_dir,
+ bool cleanup_map)
+{
+// remove((db_dir + file_properties.get_file_name_trunk() +
+// file_properties.get_data_suffix() +
+// file_properties.get_index_suffix()).c_str());
+// remove((db_dir + file_properties.get_file_name_trunk() +
+// file_properties.get_data_suffix()).c_str());
+// if (cleanup_map)
+// {
+// remove((db_dir + file_properties.get_file_name_trunk() +
+// file_properties.get_id_suffix()).c_str());
+// remove((db_dir + file_properties.get_file_name_trunk() +
+// file_properties.get_id_suffix() + file_properties.get_index_suffix()).c_str());
+// }
+}
+
+int main(int argc, char* args[])
+{
+ std::string db_dir("./");
+
+ try
+ {
+ std::ofstream coord_db_out((db_dir + "coord_db.csv").c_str());
+ std::ofstream tags_local_out((db_dir + "tags_local.csv").c_str());
+ std::ofstream tags_global_out((db_dir + "tags_global.csv").c_str());
+ {
+ Node_Updater node_updater_("./", Database_Meta_State::only_data);
+ node_updater = &node_updater_;
+
+ coord_source_out = new std::ofstream((db_dir + "coord_source.csv").c_str());
+ tags_source_out = new std::ofstream((db_dir + "tags_source.csv").c_str());
+
+ callback = get_verbatim_callback();
+
+ DEBUG_nodes_count = 0;
+ DEBUG_update_count = 0;
+ DEBUG_nodes_8 = 0;
+ DEBUG_nodes_64 = 0;
+ osm_element_count = 0;
+ //reading the main document
+ callback->parser_started();
+ parse(stdin, start, end);
+
+ callback->nodes_finished();
+ node_updater->update(callback, 0, false);
+
+ delete coord_source_out;
+ delete tags_source_out;
+ }
+
+ // check update_node_ids
+/* uint32 false_count(0);
+ Random_File< Uint32_Index > random(de_osm3s_file_ids::NODES, true);
+ for (std::vector< std::pair< uint32, uint32 > >::const_iterator it(id_idxs.begin());
+ it != id_idxs.end(); ++it)
+ {
+ if (it->second != random.get(it->first).val())
+ {
+ std::cout<first<<'\t'<second<<'\t'
+ <first).val()<<'\n';
+ ++false_count;
+ }
+ }
+ std::cout<<'('< nodes_db
+ (transaction.data_index(osm_base_settings().NODES));
+ for (Block_Backend< Uint32_Index, Node_Skeleton >::Flat_Iterator
+ it(nodes_db.flat_begin()); !(it == nodes_db.flat_end()); ++it)
+ {
+ coord_db_out< nodes_local_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(nodes_local_db.flat_begin()); !(it == nodes_local_db.flat_end()); ++it)
+ {
+ tags_local_out< > nodes_global_db
+ (transaction.data_index(osm_base_settings().NODE_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Node_Skeleton::Id_Type > >::Flat_Iterator
+ it(nodes_global_db.flat_begin()); !(it == nodes_global_db.flat_end()); ++it)
+ {
+ tags_global_out<.
+ */
+
+#include
+#include
+#include
+#include
+#include
+
+#include
+#include
+#include
+
+#include "../../expat/expat_justparse_interface.h"
+#include "../../template_db/random_file.h"
+#include "../core/settings.h"
+#include "../frontend/output.h"
+#include "node_updater.h"
+#include "relation_updater.h"
+#include "way_updater.h"
+
+
+/**
+ * Tests the library relation_updater with a sample OSM file
+ */
+
+Node_Updater* node_updater;
+Node current_node;
+Way_Updater* way_updater;
+Way current_way;
+Relation_Updater* relation_updater;
+Relation current_relation;
+int state;
+const int IN_NODES = 1;
+const int IN_WAYS = 2;
+const int IN_RELATIONS = 3;
+std::ofstream* member_source_out;
+std::ofstream* tags_source_out;
+Osm_Backend_Callback* callback;
+
+uint32 osm_element_count;
+
+void start(const char *el, const char **attr)
+{
+ if (!strcmp(el, "tag"))
+ {
+ std::string key(""), value("");
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "k"))
+ key = attr[i+1];
+ if (!strcmp(attr[i], "v"))
+ value = attr[i+1];
+ }
+ if (current_node.id.val() > 0)
+ current_node.tags.push_back(std::make_pair(key, value));
+ else if (current_way.id.val() > 0)
+ current_way.tags.push_back(std::make_pair(key, value));
+ else if (current_relation.id.val() > 0)
+ {
+ current_relation.tags.push_back(std::make_pair(key, value));
+ *tags_source_out< 0)
+ {
+ unsigned int ref(0);
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "ref"))
+ ref = atoll(attr[i+1]);
+ }
+ current_way.nds.push_back(ref);
+ }
+ }
+ else if (!strcmp(el, "member"))
+ {
+ if (current_relation.id.val() > 0)
+ {
+ unsigned int ref(0);
+ std::string type, role;
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "ref"))
+ ref = atoll(attr[i+1]);
+ if (!strcmp(attr[i], "type"))
+ type = attr[i+1];
+ if (!strcmp(attr[i], "role"))
+ role = attr[i+1];
+ }
+ Relation_Entry entry;
+ entry.ref = ref;
+ if (type == "node")
+ entry.type = Relation_Entry::NODE;
+ else if (type == "way")
+ entry.type = Relation_Entry::WAY;
+ else if (type == "relation")
+ entry.type = Relation_Entry::RELATION;
+ entry.role = relation_updater->get_role_id(role);
+ current_relation.members.push_back(entry);
+
+ *member_source_out<[nodes_finished();
+ node_updater->update(callback, 0, false);
+ callback->parser_started();
+ osm_element_count = 0;
+ state = IN_WAYS;
+ }
+
+ unsigned int id(0);
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "id"))
+ id = atoll(attr[i+1]);
+ }
+ current_way = Way(id);
+ }
+ else if (!strcmp(el, "relation"))
+ {
+ if (state == IN_NODES)
+ {
+ callback->nodes_finished();
+ node_updater->update(callback, 0, false);
+ callback->parser_started();
+ osm_element_count = 0;
+ state = IN_RELATIONS;
+ }
+ else if (state == IN_WAYS)
+ {
+ callback->ways_finished();
+ way_updater->update(callback, 0, false,
+ node_updater->get_new_skeletons(), node_updater->get_attic_skeletons(),
+ node_updater->get_new_attic_skeletons());
+ callback->parser_started();
+ osm_element_count = 0;
+ state = IN_RELATIONS;
+ }
+
+ unsigned int id(0);
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "id"))
+ id = atoll(attr[i+1]);
+ }
+ current_relation = Relation(id);
+
+ *member_source_out<set_node(current_node);
+
+ if (osm_element_count >= 4*1024*1024)
+ {
+ callback->node_elapsed(current_node.id);
+ node_updater->update(callback, 0, true);
+ callback->parser_started();
+ osm_element_count = 0;
+ }
+ current_node.id = Node::Id_Type();
+ }
+ else if (!strcmp(el, "way"))
+ {
+ way_updater->set_way(current_way);
+
+ if (osm_element_count >= 4*1024*1024)
+ {
+ callback->way_elapsed(current_way.id);
+ way_updater->update(callback, 0, false,
+ node_updater->get_new_skeletons(), node_updater->get_attic_skeletons(),
+ node_updater->get_new_attic_skeletons());
+ callback->parser_started();
+ osm_element_count = 0;
+ }
+ current_way.id = 0u;
+ }
+ else if (!strcmp(el, "relation"))
+ {
+ relation_updater->set_relation(current_relation);
+
+ *member_source_out<<'\n';
+
+ if (osm_element_count >= 4*1024*1024)
+ {
+ callback->relation_elapsed(current_relation.id);
+ relation_updater->update(callback, 0,
+ node_updater->get_new_skeletons(), node_updater->get_attic_skeletons(),
+ node_updater->get_new_attic_skeletons(),
+ way_updater->get_new_skeletons(), way_updater->get_attic_skeletons(),
+ way_updater->get_new_attic_skeletons());
+ callback->parser_started();
+ osm_element_count = 0;
+ }
+ current_relation.id = 0u;
+ }
+ ++osm_element_count;
+}
+
+void cleanup_files(const File_Properties& file_properties, std::string db_dir,
+ bool cleanup_map)
+{
+ remove((db_dir + file_properties.get_file_name_trunk() +
+ file_properties.get_data_suffix() + file_properties.get_index_suffix()).c_str());
+ remove((db_dir + file_properties.get_file_name_trunk() +
+ file_properties.get_data_suffix()).c_str());
+ if (cleanup_map)
+ {
+ remove((db_dir + file_properties.get_file_name_trunk() +
+ file_properties.get_id_suffix()).c_str());
+ remove((db_dir + file_properties.get_file_name_trunk() +
+ file_properties.get_id_suffix() + file_properties.get_index_suffix()).c_str());
+ }
+}
+
+int main(int argc, char* args[])
+{
+ std::string db_dir("./");
+
+ try
+ {
+ std::ofstream member_db_out((db_dir + "member_db.csv").c_str());
+ std::ofstream tags_local_out((db_dir + "tags_local.csv").c_str());
+ std::ofstream tags_global_out((db_dir + "tags_global.csv").c_str());
+ {
+ Node_Updater node_updater_("./", Database_Meta_State::only_data);
+ node_updater = &node_updater_;
+ Way_Updater way_updater_("./", Database_Meta_State::only_data);
+ way_updater = &way_updater_;
+ Relation_Updater relation_updater_("./", Database_Meta_State::only_data);
+ relation_updater = &relation_updater_;
+
+ member_source_out = new std::ofstream((db_dir + "member_source.csv").c_str());
+ tags_source_out = new std::ofstream((db_dir + "tags_source.csv").c_str());
+
+ callback = get_verbatim_callback();
+
+ osm_element_count = 0;
+ state = 0;
+ //reading the main document
+ callback->parser_started();
+ parse(stdin, start, end);
+
+ if (state == IN_NODES)
+ {
+ callback->nodes_finished();
+ node_updater->update(callback, 0, false);
+ }
+ else if (state == IN_WAYS)
+ {
+ callback->ways_finished();
+ way_updater->update(callback, 0, false,
+ node_updater->get_new_skeletons(), node_updater->get_attic_skeletons(),
+ node_updater->get_new_attic_skeletons());
+ }
+ else if (state == IN_RELATIONS)
+ {
+ callback->relations_finished();
+ relation_updater->update(callback, 0,
+ node_updater->get_new_skeletons(), node_updater->get_attic_skeletons(),
+ node_updater->get_new_attic_skeletons(),
+ way_updater->get_new_skeletons(), way_updater->get_attic_skeletons(),
+ way_updater->get_new_attic_skeletons());
+ }
+
+ delete member_source_out;
+ delete tags_source_out;
+ }
+
+ Nonsynced_Transaction transaction(Access_Mode::readonly, false, "./", "");
+
+ // prepare check update_members - load roles
+ std::map< uint32, std::string > roles;
+ Block_Backend< Uint32_Index, String_Object > roles_db
+ (transaction.data_index(osm_base_settings().RELATION_ROLES));
+ for (Block_Backend< Uint32_Index, String_Object >::Flat_Iterator
+ it(roles_db.flat_begin()); !(it == roles_db.flat_end()); ++it)
+ roles[it.index().val()] = it.object().val();
+
+ // check update_members - compare both files for the result
+ Block_Backend< Uint31_Index, Relation_Skeleton > relations_db
+ (transaction.data_index(osm_base_settings().RELATIONS));
+ for (Block_Backend< Uint31_Index, Relation_Skeleton >::Flat_Iterator
+ it(relations_db.flat_begin()); !(it == relations_db.flat_end()); ++it)
+ {
+ member_db_out< relations_local_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_LOCAL));
+ for (Block_Backend< Tag_Index_Local, Uint32_Index >::Flat_Iterator
+ it(relations_local_db.flat_begin());
+ !(it == relations_local_db.flat_end()); ++it)
+ {
+ tags_local_out< > relations_global_db
+ (transaction.data_index(osm_base_settings().RELATION_TAGS_GLOBAL));
+ for (Block_Backend< Tag_Index_Global, Tag_Object_Global< Relation_Skeleton::Id_Type > >::Flat_Iterator
+ it(relations_global_db.flat_begin());
+ !(it == relations_global_db.flat_end()); ++it)
+ {
+ tags_global_out<.
+ */
+
+#include
+#include
+#include
+#include ]
+
+#include
+
+#include "../../expat/expat_justparse_interface.h"
+#include "../../template_db/random_file.h"
+#include "../core/settings.h"
+#include "../frontend/output.h"
+#include "node_updater.h"
+#include "way_updater.h"
+
+
+/**
+ * Tests the library way_updater with a sample OSM file
+ */
+
+Node_Updater* node_updater;
+Node current_node;
+Way_Updater* way_updater;
+Way current_way;
+int state;
+const int IN_NODES = 1;
+const int IN_WAYS = 2;
+std::ofstream* member_source_out;
+std::ofstream* tags_source_out;
+Osm_Backend_Callback* callback;
+
+uint32 osm_element_count;
+
+void start(const char *el, const char **attr)
+{
+ if (!strcmp(el, "tag"))
+ {
+ std::string key(""), value("");
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "k"))
+ key = attr[i+1];
+ if (!strcmp(attr[i], "v"))
+ value = attr[i+1];
+ }
+ if (current_node.id.val() > 0)
+ current_node.tags.push_back(std::make_pair(key, value));
+ else if (current_way.id.val() > 0)
+ {
+ current_way.tags.push_back(std::make_pair(key, value));
+
+ *tags_source_out< 0)
+ {
+ unsigned int ref(0);
+ for (unsigned int i(0); attr[i]; i += 2)
+ {
+ if (!strcmp(attr[i], "ref"))
+ ref = atoll(attr[i+1]);
+ }
+ current_way.nds.push_back(ref);
+
+ *member_source_out<