1#ifndef OSMIUM_GEOM_GEOJSON_HPP
2#define OSMIUM_GEOM_GEOJSON_HPP
50 class GeoJSONFactoryImpl {
57 using point_type = std::string;
58 using linestring_type = std::string;
59 using polygon_type = std::string;
60 using multipolygon_type = std::string;
61 using ring_type = std::string;
63 explicit GeoJSONFactoryImpl(
int ,
int precision = 7) :
64 m_precision(precision) {
71 std::string str{
"{\"type\":\"Point\",\"coordinates\":"};
80 void linestring_start() {
81 m_str =
"{\"type\":\"LineString\",\"coordinates\":[";
89 linestring_type linestring_finish(
size_t ) {
90 assert(!m_str.empty());
102 void polygon_start() {
103 m_str =
"{\"type\":\"Polygon\",\"coordinates\":[[";
111 polygon_type polygon_finish(
size_t ) {
112 assert(!m_str.empty());
125 void multipolygon_start() {
126 m_str =
"{\"type\":\"MultiPolygon\",\"coordinates\":[";
129 void multipolygon_polygon_start() {
133 void multipolygon_polygon_finish() {
137 void multipolygon_outer_ring_start() {
141 void multipolygon_outer_ring_finish() {
142 assert(!m_str.empty());
146 void multipolygon_inner_ring_start() {
150 void multipolygon_inner_ring_finish() {
151 assert(!m_str.empty());
160 multipolygon_type multipolygon_finish() {
161 assert(!m_str.empty());
176 template <
typename TProjection = IdentityProjection>
Definition: factory.hpp:149
Namespace for everything in the Osmium library.
Definition: assembler.hpp:53
Definition: coordinates.hpp:48
void append_to_string(std::string &s, const char infix, int precision) const
Definition: coordinates.hpp:100