diff --git a/include/mapnik/util/geometry_to_wkt.hpp b/include/mapnik/util/geometry_to_wkt.hpp index e49423ece..5f6ca4bc6 100644 --- a/include/mapnik/util/geometry_to_wkt.hpp +++ b/include/mapnik/util/geometry_to_wkt.hpp @@ -24,34 +24,14 @@ #define MAPNIK_GEOMETRY_TO_WKT_HPP // mapnik -#include +#include #include -#include - -// boost -#include namespace mapnik { namespace util { -namespace karma = boost::spirit::karma; +MAPNIK_DECL bool to_wkt(std::string & wkt, mapnik::geometry_type const& geom); -bool to_wkt(std::string & wkt, mapnik::geometry_type const& geom) -{ - typedef std::back_insert_iterator sink_type; - sink_type sink(wkt); - wkt_generator generator(true); - bool result = karma::generate(sink, generator, geom); - return result; -} - -bool to_wkt(std::string & wkt, mapnik::geometry_container const& geom) -{ - typedef std::back_insert_iterator sink_type; - sink_type sink(wkt); - wkt_multi_generator generator; - bool result = karma::generate(sink, generator, geom); - return result; -} +MAPNIK_DECL bool to_wkt(std::string & wkt, mapnik::geometry_container const& geom); }} diff --git a/src/wkt/wkt_generator.cpp b/src/wkt/wkt_generator.cpp index 03900ee4e..67ca61295 100644 --- a/src/wkt/wkt_generator.cpp +++ b/src/wkt/wkt_generator.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include @@ -156,6 +157,23 @@ wkt_multi_generator::wkt_multi_generator() template struct mapnik::util::wkt_generator, mapnik::geometry_type>; template struct mapnik::util::wkt_multi_generator, mapnik::geometry_container >; +bool to_wkt(std::string & wkt, mapnik::geometry_type const& geom) +{ + typedef std::back_insert_iterator sink_type; + sink_type sink(wkt); + wkt_generator generator(true); + bool result = karma::generate(sink, generator, geom); + return result; +} + +bool to_wkt(std::string & wkt, mapnik::geometry_container const& geom) +{ + typedef std::back_insert_iterator sink_type; + sink_type sink(wkt); + wkt_multi_generator generator; + bool result = karma::generate(sink, generator, geom); + return result; +} }}