File: tagtransform.cpp

package info (click to toggle)
osm2pgsql 0.96.0%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 2,304 kB
  • sloc: cpp: 11,462; python: 543; sh: 98; makefile: 17
file content (30 lines) | stat: -rw-r--r-- 955 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "tagtransform.hpp"
#include "config.h"
#include "options.hpp"
#include "tagtransform-c.hpp"

#ifdef HAVE_LUA
#include "tagtransform-lua.hpp"
#endif

std::unique_ptr<tagtransform_t>
tagtransform_t::make_tagtransform(options_t const *options)
{
    if (options->tag_transform_script) {
#ifdef HAVE_LUA
        fprintf(stderr,
                "Using lua based tag processing pipeline with script %s\n",
                options->tag_transform_script->c_str());
        return std::unique_ptr<tagtransform_t>(new lua_tagtransform_t(options));
#else
        throw std::runtime_error("Error: Could not init lua tag transform, as "
                                 "lua support was not compiled into this "
                                 "version");
#endif
    }

    fprintf(stderr, "Using built-in tag processing pipeline\n");
    return std::unique_ptr<tagtransform_t>(new c_tagtransform_t(options));
}

tagtransform_t::~tagtransform_t() = default;