Chris@16: // Boost.Geometry (aka GGL, Generic Geometry Library) Chris@16: Chris@16: // Copyright (c) 2007-2012 Barend Gehrels, Amsterdam, the Netherlands. Chris@16: // Copyright (c) 2008-2012 Bruno Lalande, Paris, France. Chris@16: // Copyright (c) 2009-2012 Mateusz Loskot, London, UK. Chris@16: Chris@16: // Parts of Boost.Geometry are redesigned from Geodan's Geographic Library Chris@16: // (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands. Chris@16: Chris@16: // Use, modification and distribution is subject to the Boost Software License, Chris@16: // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: #ifndef BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP Chris@16: #define BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace geometry Chris@16: { Chris@16: Chris@16: #ifndef DOXYGEN_NO_DETAIL Chris@16: namespace detail { namespace wkt Chris@16: { Chris@16: Chris@16: template Chris@16: struct wkt_multi Chris@16: { Chris@16: template Chris@16: static inline void apply(std::basic_ostream& os, Chris@16: Multi const& geometry) Chris@16: { Chris@16: os << PrefixPolicy::apply(); Chris@16: // TODO: check EMPTY here Chris@16: os << "("; Chris@16: Chris@16: for (typename boost::range_iterator::type Chris@16: it = boost::begin(geometry); Chris@16: it != boost::end(geometry); Chris@16: ++it) Chris@16: { Chris@16: if (it != boost::begin(geometry)) Chris@16: { Chris@16: os << ","; Chris@16: } Chris@16: StreamPolicy::apply(os, *it); Chris@16: } Chris@16: Chris@16: os << ")"; Chris@16: } Chris@16: }; Chris@16: Chris@16: }} // namespace wkt::impl Chris@16: #endif Chris@16: Chris@16: #ifndef DOXYGEN_NO_DISPATCH Chris@16: namespace dispatch Chris@16: { Chris@16: Chris@16: template Chris@16: struct wkt Chris@16: : detail::wkt::wkt_multi Chris@16: < Chris@16: Multi, Chris@16: detail::wkt::wkt_point Chris@16: < Chris@16: typename boost::range_value::type, Chris@16: detail::wkt::prefix_null Chris@16: >, Chris@16: detail::wkt::prefix_multipoint Chris@16: > Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct wkt Chris@16: : detail::wkt::wkt_multi Chris@16: < Chris@16: Multi, Chris@16: detail::wkt::wkt_sequence Chris@16: < Chris@16: typename boost::range_value::type Chris@16: >, Chris@16: detail::wkt::prefix_multilinestring Chris@16: > Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct wkt Chris@16: : detail::wkt::wkt_multi Chris@16: < Chris@16: Multi, Chris@16: detail::wkt::wkt_poly Chris@16: < Chris@16: typename boost::range_value::type, Chris@16: detail::wkt::prefix_null Chris@16: >, Chris@16: detail::wkt::prefix_multipolygon Chris@16: > Chris@16: {}; Chris@16: Chris@16: } // namespace dispatch Chris@16: #endif Chris@16: Chris@16: }} // namespace boost::geometry Chris@16: Chris@16: #endif // BOOST_GEOMETRY_MULTI_IO_WKT_WRITE_HPP