/* The code in this file is released into the Public Domain. */ #include #include #include #include #include #include typedef osmium::index::map::Map index_type; typedef osmium::handler::NodeLocationsForWays location_handler_type; int main(int argc, char* argv[]) { if (argc != 3) { std::cerr << "Usage: " << argv[0] << " OSMFILE FORMAT\n"; exit(1); } std::string input_filename = argv[1]; std::string location_store = argv[2]; osmium::io::Reader reader(input_filename); const auto& map_factory = osmium::index::MapFactory::instance(); std::unique_ptr index = map_factory.create_map(location_store); location_handler_type location_handler(*index); location_handler.ignore_errors(); osmium::apply(reader, location_handler); reader.close(); google::protobuf::ShutdownProtobufLibrary(); }