1414#include " osmdata.hpp"
1515#include " output-multi.hpp"
1616#include " output.hpp"
17- #include " parse-osmium.hpp"
1817#include " taginfo-impl.hpp"
1918
2019#include " common-pg.hpp"
@@ -30,31 +29,19 @@ inline void parse_file(options_t const &options,
3029 osmdata_t osmdata{std::move (dependency_manager), mid, outs, options};
3130
3231 osmdata.start ();
33- parse_osmium_t parser{options.bbox , options.append , &osmdata};
3432
35- std::string filep{TESTDATA_DIR};
36- filep += filename ? filename : options.input_files [0 ];
37-
38- parser.stream_file (filep, " " );
33+ std::string filepath{TESTDATA_DIR};
34+ if (filename) {
35+ filepath += filename;
36+ } else {
37+ filepath += options.input_files [0 ];
38+ }
39+ osmium::io::File file{filepath};
40+ osmdata.process_file (file, options.bbox );
3941
4042 osmdata.stop ();
4143}
4244
43- class test_parse_t : public parse_osmium_t
44- {
45- public:
46- using parse_osmium_t ::parse_osmium_t ;
47-
48- void stream_buffer (char const *buf, std::string const &fmt)
49- {
50- osmium::io::File infile{buf, std::strlen (buf), fmt};
51-
52- osmium::io::Reader reader{infile};
53- osmium::apply (reader, *this );
54- reader.close ();
55- }
56- };
57-
5845namespace db {
5946
6047/* *
@@ -65,7 +52,7 @@ class import_t
6552{
6653public:
6754 void run_import (options_t options, char const *data,
68- std::string const &fmt = " opl" )
55+ std::string const &format = " opl" )
6956 {
7057 options.database_options = m_db.db_options ();
7158
@@ -96,9 +83,8 @@ class import_t
9683
9784 osmdata.start ();
9885
99- test_parse_t parser (options.bbox , options.append , &osmdata);
100-
101- parser.stream_buffer (data, fmt);
86+ osmium::io::File file{data, std::strlen (data), format};
87+ osmdata.process_file (file, options.bbox );
10288
10389 osmdata.stop ();
10490 }
0 commit comments