|
5 | 5 |
|
6 | 6 | static testing::db::import_t db; |
7 | 7 |
|
8 | | -TEST_CASE("bbox on nodes and ways") |
| 8 | +static char const *const conf_file = "test_output_flex_bbox.lua"; |
| 9 | + |
| 10 | +TEST_CASE("bbox on nodes and ways in 4326") |
9 | 11 | { |
10 | | - testing::opt_t options = testing::opt_t() |
11 | | - .flex("test_output_flex_bbox.lua") |
12 | | - .srs(PROJ_LATLONG); |
| 12 | + options_t const options = |
| 13 | + testing::opt_t().flex(conf_file).srs(PROJ_LATLONG); |
13 | 14 |
|
14 | 15 | REQUIRE_NOTHROW(db.run_import(options, |
15 | 16 | "n10 v1 dV Ta=b x10.0 y10.0\n" |
@@ -41,3 +42,29 @@ TEST_CASE("bbox on nodes and ways") |
41 | 42 | "abs(max_x - 10.2) < 0.01 AND abs(max_y - 10.2) < 0.01")); |
42 | 43 | } |
43 | 44 |
|
| 45 | +TEST_CASE("bbox on nodes and ways in 3857") |
| 46 | +{ |
| 47 | + options_t const options = testing::opt_t().flex(conf_file); |
| 48 | + |
| 49 | + REQUIRE_NOTHROW(db.run_import(options, |
| 50 | + "n10 v1 dV Ta=b x10.0 y10.0\n" |
| 51 | + "n11 v1 dV Ta=b x10.0 y10.2\n" |
| 52 | + "n12 v1 dV Ta=b x10.2 y10.2\n" |
| 53 | + "w20 v1 dV Thighway=primary Nn10,n11,n12\n")); |
| 54 | + |
| 55 | + auto conn = db.db().connect(); |
| 56 | + |
| 57 | + CHECK(3 == conn.get_count("osm2pgsql_test_points")); |
| 58 | + |
| 59 | + CHECK(1 == conn.get_count( |
| 60 | + "osm2pgsql_test_points", |
| 61 | + "abs(min_x - 10.0) < 0.01 AND abs(min_y - 10.0) < 0.01 AND " |
| 62 | + "abs(max_x - 10.0) < 0.01 AND abs(max_y - 10.0) < 0.01")); |
| 63 | + |
| 64 | + CHECK(1 == conn.get_count("osm2pgsql_test_highways")); |
| 65 | + |
| 66 | + CHECK(1 == conn.get_count( |
| 67 | + "osm2pgsql_test_highways", |
| 68 | + "abs(min_x - 10.0) < 0.01 AND abs(min_y - 10.0) < 0.01 AND " |
| 69 | + "abs(max_x - 10.2) < 0.01 AND abs(max_y - 10.2) < 0.01")); |
| 70 | +} |
0 commit comments