1 #ifndef OSMIUM_GEOM_GEOJSON_HPP
2 #define OSMIUM_GEOM_GEOJSON_HPP
49 class GeoJSONFactoryImpl {
56 typedef std::string point_type;
57 typedef std::string linestring_type;
58 typedef std::string polygon_type;
59 typedef std::string multipolygon_type;
60 typedef std::string ring_type;
62 GeoJSONFactoryImpl(
int precision = 7) :
63 m_precision(precision) {
70 std::string str {
"{\"type\":\"Point\",\"coordinates\":"};
79 void linestring_start() {
80 m_str =
"{\"type\":\"LineString\",\"coordinates\":[";
88 linestring_type linestring_finish(
size_t ) {
89 assert(!m_str.empty());
102 void multipolygon_start() {
103 m_str =
"{\"type\":\"MultiPolygon\",\"coordinates\":[";
106 void multipolygon_polygon_start() {
110 void multipolygon_polygon_finish() {
114 void multipolygon_outer_ring_start() {
118 void multipolygon_outer_ring_finish() {
119 assert(!m_str.empty());
123 void multipolygon_inner_ring_start() {
127 void multipolygon_inner_ring_finish() {
128 assert(!m_str.empty());
137 multipolygon_type multipolygon_finish() {
138 assert(!m_str.empty());
153 template <
typename TProjection = IdentityProjection>
160 #endif // OSMIUM_GEOM_GEOJSON_HPP
Definition: factory.hpp:146
Namespace for everything in the Osmium library.
Definition: assembler.hpp:59
Definition: coordinates.hpp:46
void append_to_string(std::string &s, const char infix, int precision) const
Definition: coordinates.hpp:57