1 #ifndef OSMIUM_GEOM_WKT_HPP
2 #define OSMIUM_GEOM_WKT_HPP
50 class WKTFactoryImpl {
57 typedef std::string point_type;
58 typedef std::string linestring_type;
59 typedef std::string polygon_type;
60 typedef std::string multipolygon_type;
61 typedef std::string ring_type;
63 WKTFactoryImpl(
int precision = 7) :
64 m_precision(precision) {
70 std::string str {
"POINT"};
77 void linestring_start() {
78 m_str =
"LINESTRING(";
86 linestring_type linestring_finish(
size_t ) {
87 assert(!m_str.empty());
89 std::swap(str, m_str);
96 void multipolygon_start() {
97 m_str =
"MULTIPOLYGON(";
100 void multipolygon_polygon_start() {
104 void multipolygon_polygon_finish() {
108 void multipolygon_outer_ring_start() {
112 void multipolygon_outer_ring_finish() {
113 assert(!m_str.empty());
117 void multipolygon_inner_ring_start() {
121 void multipolygon_inner_ring_finish() {
122 assert(!m_str.empty());
131 multipolygon_type multipolygon_finish() {
132 assert(!m_str.empty());
134 std::swap(str, m_str);
143 template <
class TProjection = IdentityProjection>
150 #endif // OSMIUM_GEOM_WKT_HPP
Definition: factory.hpp:117
Namespace for everything in the Osmium library.
Definition: assembler.hpp:55
Definition: coordinates.hpp:47
void append_to_string(std::string &s, const char infix, int precision) const
Definition: coordinates.hpp:58