File: processor-line.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 (24 lines) | stat: -rw-r--r-- 750 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
#include "processor-line.hpp"

processor_line::processor_line(std::shared_ptr<reprojection> const &proj)
: geometry_processor(proj->target_srs(), "LINESTRING",
                     interest_way | interest_relation)
{
}

geometry_processor::wkb_t
processor_line::process_way(osmium::Way const &way,
                            geom::osmium_builder_t *builder)
{
    auto wkbs = builder->get_wkb_line(way.nodes(), 1000000);

    return wkbs.empty() ? wkb_t() : wkbs[0];
}

geometry_processor::wkbs_t
processor_line::process_relation(osmium::Relation const &,
                                 osmium::memory::Buffer const &ways,
                                 geom::osmium_builder_t *builder)
{
    return builder->get_wkb_multiline(ways, 1000000);
}