Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75977 - in trunk/boost/geometry: . algorithms algorithms/detail/overlay domains/gis extensions/algorithms/detail/overlay extensions/gis/io/shapelib extensions/gis/io/wkb/detail extensions/gis/io/wkt io io/dsv io/wkt io/wkt/detail multi/io multi/io/wkt multi/io/wkt/detail
From: mateusz_at_[hidden]
Date: 2011-12-15 20:28:39


Author: mloskot
Date: 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
New Revision: 75977
URL: http://svn.boost.org/trac/boost/changeset/75977

Log:
Boost.Geometry:
* Introducing new layout of IO formats in geometry/io/<FORMAT>/ with unified set of public headers: <FORMAT>.hpp, read.hpp, write.hpp and iomanip.hpp
* Moved OGC Well-Known-Text (WKT) format from geometry/extensions/gis/io/wkt to geometry/io
* Renamed stream_wkt.hpp to iomanip.hpp to reflect what it defines: manipulators for streams.
* Removed deprecated headers and updated other headers to use the new locations.
Added:
   trunk/boost/geometry/io/io.hpp
      - copied, changed from r75832, /trunk/boost/geometry/domains/gis/io/io.hpp
   trunk/boost/geometry/io/wkt/
      - copied from r75832, /trunk/boost/geometry/domains/gis/io/wkt/
   trunk/boost/geometry/io/wkt/detail/prefix.hpp
      - copied, changed from r75832, /trunk/boost/geometry/domains/gis/io/wkt/detail/wkt.hpp
   trunk/boost/geometry/io/wkt/iomanip.hpp (contents, props changed)
   trunk/boost/geometry/multi/io/ (props changed)
   trunk/boost/geometry/multi/io/wkt/ (props changed)
   trunk/boost/geometry/multi/io/wkt/detail/ (props changed)
   trunk/boost/geometry/multi/io/wkt/detail/prefix.hpp (contents, props changed)
   trunk/boost/geometry/multi/io/wkt/read.hpp (contents, props changed)
   trunk/boost/geometry/multi/io/wkt/wkt.hpp (contents, props changed)
   trunk/boost/geometry/multi/io/wkt/write.hpp (contents, props changed)
Removed:
   trunk/boost/geometry/domains/gis/
   trunk/boost/geometry/extensions/gis/io/wkt/
   trunk/boost/geometry/io/wkt/detail/wkt.hpp
   trunk/boost/geometry/io/wkt/read_multi.hpp
   trunk/boost/geometry/io/wkt/write_multi.hpp
Text files modified:
   trunk/boost/geometry/algorithms/assign.hpp | 8 ++------
   trunk/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp | 23 +++++------------------
   trunk/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp | 16 +++-------------
   trunk/boost/geometry/algorithms/detail/overlay/traverse.hpp | 15 +++------------
   trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp | 26 ++++----------------------
   trunk/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp | 21 +++++----------------
   trunk/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp | 5 +++++
   trunk/boost/geometry/geometry.hpp | 4 +---
   trunk/boost/geometry/io/dsv/write.hpp | 21 ---------------------
   trunk/boost/geometry/io/io.hpp | 28 ++++++++++------------------
   trunk/boost/geometry/io/wkt/detail/prefix.hpp | 11 +++--------
   trunk/boost/geometry/io/wkt/read.hpp | 15 ++++-----------
   trunk/boost/geometry/io/wkt/wkt.hpp | 14 ++++++--------
   trunk/boost/geometry/io/wkt/write.hpp | 26 ++++----------------------
   14 files changed, 55 insertions(+), 178 deletions(-)

Modified: trunk/boost/geometry/algorithms/assign.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/assign.hpp (original)
+++ trunk/boost/geometry/algorithms/assign.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -29,22 +29,18 @@
 #include <boost/geometry/algorithms/detail/assign_indexed_point.hpp>
 #include <boost/geometry/algorithms/detail/assign_values.hpp>
 #include <boost/geometry/algorithms/convert.hpp>
-
-#include <boost/geometry/arithmetic/arithmetic.hpp>
 #include <boost/geometry/algorithms/append.hpp>
 #include <boost/geometry/algorithms/clear.hpp>
+#include <boost/geometry/arithmetic/arithmetic.hpp>
 #include <boost/geometry/core/access.hpp>
 #include <boost/geometry/core/exterior_ring.hpp>
 #include <boost/geometry/core/tags.hpp>
 
 #include <boost/geometry/geometries/concepts/check.hpp>
 
-
 #include <boost/geometry/util/for_each_coordinate.hpp>
 
-
-namespace boost { namespace geometry
-{
+namespace boost { namespace geometry{
 
 /*!
 \brief Assign a range of points to a linestring, ring or polygon

Modified: trunk/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/backtrack_check_si.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -9,33 +9,23 @@
 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_BACKTRACK_CHECK_SI_HPP
 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_BACKTRACK_CHECK_SI_HPP
 
-
 #include <cstddef>
-
 #include <string>
 
 #include <boost/range.hpp>
 
-#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
 #include <boost/geometry/core/access.hpp>
-
-# include <boost/geometry/algorithms/detail/has_self_intersections.hpp>
-
-
+#include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
+#include <boost/geometry/algorithms/detail/has_self_intersections.hpp>
 #if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) || defined(BOOST_GEOMETRY_OVERLAY_REPORT_WKT)
 # include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
-# include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
+# include <boost/geometry/io/wkt/wkt.hpp>
 #endif
 
-
-namespace boost { namespace geometry
-{
-
+namespace boost { namespace geometry {
 
 #ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace overlay
-{
-
+namespace detail { namespace overlay {
 
 template <typename Turns>
 inline void clear_visit_info(Turns& turns)
@@ -170,12 +160,9 @@
 };
 #endif // BOOST_GEOMETRY_OVERLAY_REPORT_WKT
 
-
 }} // namespace detail::overlay
 #endif // DOXYGEN_NO_DETAIL
 
-
 }} // namespace boost::geometry
 
-
 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_BACKTRACK_CHECK_SI_HPP

Modified: trunk/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/enrich_intersection_points.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -9,7 +9,6 @@
 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICH_HPP
 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICH_HPP
 
-
 #include <cstddef>
 #include <algorithm>
 #include <map>
@@ -19,32 +18,25 @@
 #ifdef BOOST_GEOMETRY_DEBUG_ENRICH
 # include <iostream>
 # include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
-# include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
+# include <boost/geometry/io/wkt/wkt.hpp>
 # define BOOST_GEOMETRY_DEBUG_IDENTIFIER
 #endif
 
 #include <boost/assert.hpp>
 #include <boost/range.hpp>
 
-
-
 #include <boost/geometry/algorithms/detail/ring_identifier.hpp>
 #include <boost/geometry/algorithms/detail/overlay/copy_segment_point.hpp>
 #include <boost/geometry/algorithms/detail/overlay/get_relative_order.hpp>
-
 #include <boost/geometry/algorithms/detail/overlay/handle_tangencies.hpp>
-
 #ifdef BOOST_GEOMETRY_DEBUG_ENRICH
 # include <boost/geometry/algorithms/detail/overlay/check_enrich.hpp>
 #endif
 
-
-namespace boost { namespace geometry
-{
+namespace boost { namespace geometry {
 
 #ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace overlay
-{
+namespace detail { namespace overlay {
 
 // Wraps "turn_operation" from turn_info.hpp,
 // giving it extra information
@@ -524,8 +516,6 @@
 
 }
 
-
 }} // namespace boost::geometry
 
-
 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_ENRICH_HPP

Modified: trunk/boost/geometry/algorithms/detail/overlay/traverse.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/overlay/traverse.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/overlay/traverse.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -9,7 +9,6 @@
 #ifndef BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_TRAVERSE_HPP
 #define BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_TRAVERSE_HPP
 
-
 #include <cstddef>
 
 #include <boost/range.hpp>
@@ -22,24 +21,18 @@
 #include <boost/geometry/core/coordinate_dimension.hpp>
 #include <boost/geometry/geometries/concepts/check.hpp>
 
-
 #if defined(BOOST_GEOMETRY_DEBUG_INTERSECTION) \
     || defined(BOOST_GEOMETRY_OVERLAY_REPORT_WKT) \
     || defined(BOOST_GEOMETRY_DEBUG_TRAVERSE)
 # include <string>
 # include <boost/geometry/algorithms/detail/overlay/debug_turn_info.hpp>
-# include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
+# include <boost/geometry/io/wkt/wkt.hpp>
 #endif
 
-
-
-namespace boost { namespace geometry
-{
-
+namespace boost { namespace geometry {
 
 #ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace overlay
-{
+namespace detail { namespace overlay {
 
 template <typename Turn, typename Operation>
 inline void debug_traverse(Turn const& turn, Operation op,
@@ -391,8 +384,6 @@
 }} // namespace detail::overlay
 #endif // DOXYGEN_NO_DETAIL
 
-
 }} // namespace boost::geometry
 
-
 #endif // BOOST_GEOMETRY_ALGORITHMS_DETAIL_OVERLAY_TRAVERSE_HPP

Modified: trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp
==============================================================================
--- trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp (original)
+++ trunk/boost/geometry/extensions/algorithms/detail/overlay/split_rings.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -11,40 +11,30 @@
 
 #define BOOST_GEOMETRY_CHECK_SPLIT_RINGS
 
-
 #include <deque>
 #include <string>
 
 #include <boost/range.hpp>
 #include <boost/typeof/typeof.hpp>
 
-#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
-
 #include <boost/geometry/core/point_type.hpp>
 #include <boost/geometry/core/ring_type.hpp>
 #include <boost/geometry/core/exterior_ring.hpp>
 #include <boost/geometry/core/interior_rings.hpp>
 #include <boost/geometry/util/math.hpp>
-
 #include <boost/geometry/algorithms/intersects.hpp>
 #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
+#include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
 #include <boost/geometry/geometries/concepts/check.hpp>
 
-
 #if defined(BOOST_GEOMETRY_DEBUG_SPLIT_RINGS) || defined(BOOST_GEOMETRY_CHECK_SPLIT_RINGS)
-# include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
+# include <boost/geometry/io/wkt/wkt.hpp>
 #endif
 
-
-
-namespace boost { namespace geometry
-{
-
+namespace boost { namespace geometry {
 
 #ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace split_rings
-{
-
+namespace detail { namespace split_rings {
 
 template <typename Range>
 struct split_range
@@ -272,7 +262,6 @@
 };
 
 
-
 template <typename Range, typename RingCollection>
 class range_split_rings
 {
@@ -345,9 +334,6 @@
     }
 
 
-
-
-
     static void call(Range range, RingCollection& ring_collection)
     {
         typedef split_turn_info<point_type> turn_info;
@@ -394,7 +380,6 @@
         std::sort(turns.begin(), turns.end(), sorter<turn_info>());
         //report(turns, "sorted");
 
-
         while(turns.size() > 0)
         {
             // Process first turn
@@ -473,7 +458,6 @@
         insert_rings<ring_tag, RingCollection, Range>::apply(ring_collection, range);
     }
 
-
 public :
     // Copy by value of range is intentional, copy is modified here
     static inline void apply(Range range, RingCollection& ring_collection)
@@ -482,7 +466,6 @@
     }
 };
 
-
 template <typename Polygon, typename RingCollection>
 struct polygon_split_rings
 {
@@ -559,5 +542,4 @@
 
 }} // namespace boost::geometry
 
-
 #endif // BOOST_GEOMETRY_EXTENSIONS_ALGORITHMS_DETAIL_OVERLAY_SPLIT_RINGS_HPP

Modified: trunk/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp
==============================================================================
--- trunk/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp (original)
+++ trunk/boost/geometry/extensions/gis/io/shapelib/shape_creator.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -12,21 +12,16 @@
 #include <fstream>
 #include "shapefil.h"
 
-
 #include <boost/noncopyable.hpp>
 #include <boost/type_traits/promote.hpp>
 
-#include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
+#include <boost/geometry/io/wkt/wkt.hpp>
 
 #include <boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp>
 #include <boost/geometry/extensions/gis/io/shapelib/shp_create_object_multi.hpp>
 #include <boost/geometry/extensions/gis/io/shapelib/dbf_write_attribute.hpp>
 
-
-namespace boost { namespace geometry
-{
-
-
+namespace boost { namespace geometry {
 
 class shapelib_file_create_exception : public geometry::exception
 {
@@ -44,9 +39,7 @@
     std::string m_filename;
 };
 
-
-namespace detail
-{
+namespace detail {
 
 template <typename Tag>
 struct SHPType
@@ -64,7 +57,7 @@
 template <> struct SHPType<multi_linestring_tag> { static int const value = SHPT_ARC; };
 template <> struct SHPType<multi_polygon_tag> { static int const value = SHPT_POLYGON; };
 
-}
+} // namespace detail
 
 template
 <
@@ -88,13 +81,13 @@
             throw shapelib_file_create_exception(name);
         }
     }
+
     virtual ~shape_creator()
     {
         if (m_shp) ::SHPClose(m_shp);
         if (m_dbf) ::DBFClose(m_dbf);
     }
 
-
     // Returns: index in shapefile
     inline int AddShape(Geometry const& geometry)
     {
@@ -105,7 +98,6 @@
         return result;
     }
 
-
     template <typename T>
     inline void AddField(std::string const& name, int width = 16, int decimals = 0)
     {
@@ -148,7 +140,6 @@
         }
     }
 
-
 private :
     ::SHPHandle m_shp;
     ::DBFHandle m_dbf;
@@ -156,8 +147,6 @@
 
 };
 
-
 }} // namespace boost::geometry
 
-
 #endif // BOOST_GEOMETRY_EXT_GIS_IO_SHAPELIB_SHAPE_CREATOR_HPP

Modified: trunk/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp
==============================================================================
--- trunk/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp (original)
+++ trunk/boost/geometry/extensions/gis/io/wkb/detail/parser.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -15,6 +15,7 @@
 #include <iterator>
 #include <limits>
 
+#include <boost/concept_check.hpp>
 #include <boost/cstdint.hpp>
 #include <boost/type_traits/is_integral.hpp>
 #include <boost/type_traits/is_same.hpp>
@@ -154,6 +155,10 @@
     static void run(Iterator& it, Iterator end, P& point, byte_order_type::enum_t order)
     {
         // terminate
+ boost::ignore_unused_variable_warning(it);
+ boost::ignore_unused_variable_warning(end);
+ boost::ignore_unused_variable_warning(point);
+ boost::ignore_unused_variable_warning(order);
     }
 };
 

Modified: trunk/boost/geometry/geometry.hpp
==============================================================================
--- trunk/boost/geometry/geometry.hpp (original)
+++ trunk/boost/geometry/geometry.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -16,7 +16,6 @@
 
 // Shortcut to include all header files
 
-
 #include <boost/geometry/core/cs.hpp>
 #include <boost/geometry/core/tag.hpp>
 #include <boost/geometry/core/tag_cast.hpp>
@@ -81,7 +80,6 @@
 #include <boost/geometry/views/box_view.hpp>
 #include <boost/geometry/views/segment_view.hpp>
 
-#include <boost/geometry/domains/gis/io/wkt/wkt.hpp>
-
+#include <boost/geometry/io/io.hpp>
 
 #endif // BOOST_GEOMETRY_GEOMETRY_HPP

Modified: trunk/boost/geometry/io/dsv/write.hpp
==============================================================================
--- trunk/boost/geometry/io/dsv/write.hpp (original)
+++ trunk/boost/geometry/io/dsv/write.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -14,7 +14,6 @@
 #ifndef BOOST_GEOMETRY_IO_DSV_WRITE_HPP
 #define BOOST_GEOMETRY_IO_DSV_WRITE_HPP
 
-
 #include <cstddef>
 #include <ostream>
 #include <string>
@@ -30,7 +29,6 @@
 
 #include <boost/geometry/geometries/concepts/check.hpp>
 
-
 namespace boost { namespace geometry
 {
 
@@ -38,7 +36,6 @@
 namespace detail { namespace dsv
 {
 
-
 struct dsv_settings
 {
     std::string coordinate_separator;
@@ -99,7 +96,6 @@
     }
 };
 
-
 /*!
 \brief Stream indexed coordinate of a box/segment as \ref DSV
 */
@@ -136,8 +132,6 @@
     }
 };
 
-
-
 /*!
 \brief Stream points as \ref DSV
 */
@@ -201,7 +195,6 @@
 \note Used in polygon, all multi-geometries
 */
 
-
 template <typename Polygon>
 struct dsv_poly
 {
@@ -246,7 +239,6 @@
     }
 };
 
-
 template <typename Geometry>
 struct dsv_indexed
 {
@@ -268,7 +260,6 @@
 }} // namespace detail::dsv
 #endif // DOXYGEN_NO_DETAIL
 
-
 #ifndef DOXYGEN_NO_DISPATCH
 namespace dispatch
 {
@@ -276,19 +267,16 @@
 template <typename Tag, typename Geometry>
 struct dsv {};
 
-
 template <typename Point>
 struct dsv<point_tag, Point>
     : detail::dsv::dsv_point<Point>
 {};
 
-
 template <typename Linestring>
 struct dsv<linestring_tag, Linestring>
     : detail::dsv::dsv_range<Linestring>
 {};
 
-
 template <typename Box>
 struct dsv<box_tag, Box>
     : detail::dsv::dsv_indexed<Box>
@@ -299,28 +287,23 @@
     : detail::dsv::dsv_indexed<Segment>
 {};
 
-
 template <typename Ring>
 struct dsv<ring_tag, Ring>
     : detail::dsv::dsv_range<Ring>
 {};
 
-
 template <typename Polygon>
 struct dsv<polygon_tag, Polygon>
     : detail::dsv::dsv_poly<Polygon>
 {};
 
-
 } // namespace dispatch
 #endif // DOXYGEN_NO_DISPATCH
 
-
 #ifndef DOXYGEN_NO_DETAIL
 namespace detail { namespace dsv
 {
 
-
 // FIXME: This class is not copyable/assignable but it is used as such --mloskot
 template <typename Geometry>
 class dsv_manipulator
@@ -356,11 +339,9 @@
     dsv_settings m_settings;
 };
 
-
 }} // namespace detail::dsv
 #endif // DOXYGEN_NO_DETAIL
 
-
 /*!
 \brief Main DSV-streaming function
 \details DSV stands for Delimiter Separated Values. Geometries can be streamed
@@ -389,8 +370,6 @@
             list_open, list_close, list_separator));
 }
 
-
 }} // namespace boost::geometry
 
-
 #endif // BOOST_GEOMETRY_IO_DSV_WRITE_HPP

Copied: trunk/boost/geometry/io/io.hpp (from r75832, /trunk/boost/geometry/domains/gis/io/io.hpp)
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/io.hpp (original)
+++ trunk/boost/geometry/io/io.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -11,27 +11,21 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_HPP
+#ifndef BOOST_GEOMETRY_IO_HPP
+#define BOOST_GEOMETRY_IO_HPP
 
+#include <boost/geometry/io/wkt/read.hpp>
+#include <boost/geometry/io/wkt/write.hpp>
 
-#include <boost/geometry/domains/gis/io/wkt/read.hpp>
-#include <boost/geometry/domains/gis/io/wkt/write.hpp>
-
-#include <boost/geometry/domains/gis/io/wkt/read_multi.hpp>
-#include <boost/geometry/domains/gis/io/wkt/write_multi.hpp>
-
-namespace boost { namespace geometry
-{
+namespace boost { namespace geometry {
 
 struct format_wkt {};
-struct format_wkb {};
-struct format_dsv {};
+struct format_wkb {}; // TODO
+struct format_dsv {}; // TODO
 
 #ifndef DOXYGEN_NO_DISPATCH
 namespace dispatch
 {
-
 template <typename Tag, typename Geometry>
 struct read
 {
@@ -46,12 +40,9 @@
     }
 };
 
-
 } // namespace dispatch
 #endif // DOXYGEN_NO_DISPATCH
 
-
-
 template <typename Format, typename Geometry>
 inline void read(Geometry& geometry, std::string const& wkt)
 {
@@ -59,7 +50,8 @@
     dispatch::read<Format, Geometry>::apply(geometry, wkt);
 }
 
-}} // namespace boost::geometry
+// TODO: wriite
 
+}} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_HPP
+#endif // BOOST_GEOMETRY_IO_HPP

Copied: trunk/boost/geometry/io/wkt/detail/prefix.hpp (from r75832, /trunk/boost/geometry/domains/gis/io/wkt/detail/wkt.hpp)
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/wkt/detail/wkt.hpp (original)
+++ trunk/boost/geometry/io/wkt/detail/prefix.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -11,9 +11,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_DETAIL_WKT_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_DETAIL_WKT_HPP
-
+#ifndef BOOST_GEOMETRY_IO_WKT_DETAIL_PREFIX_HPP
+#define BOOST_GEOMETRY_IO_WKT_DETAIL_PREFIX_HPP
 
 namespace boost { namespace geometry
 {
@@ -21,7 +20,6 @@
 #ifndef DOXYGEN_NO_DETAIL
 namespace detail { namespace wkt {
 
-
 struct prefix_point
 {
     static inline const char* apply() { return "POINT"; }
@@ -37,13 +35,10 @@
     static inline const char* apply() { return "LINESTRING"; }
 };
 
-
-
 }} // namespace wkt::impl
 #endif
 
 
 }} // namespace boost::geometry
 
-
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_DETAIL_WKT_HPP
+#endif // BOOST_GEOMETRY_IO_WKT_DETAIL_PREFIX_HPP

Deleted: /trunk/boost/geometry/domains/gis/io/wkt/detail/wkt.hpp
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/wkt/detail/wkt.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
+++ (empty file)
@@ -1,49 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-
-// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
-// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
-
-// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
-// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
-
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_DETAIL_WKT_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_DETAIL_WKT_HPP
-
-
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace wkt {
-
-
-struct prefix_point
-{
- static inline const char* apply() { return "POINT"; }
-};
-
-struct prefix_polygon
-{
- static inline const char* apply() { return "POLYGON"; }
-};
-
-struct prefix_linestring
-{
- static inline const char* apply() { return "LINESTRING"; }
-};
-
-
-
-}} // namespace wkt::impl
-#endif
-
-
-}} // namespace boost::geometry
-
-
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_DETAIL_WKT_HPP

Added: trunk/boost/geometry/io/wkt/iomanip.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/io/wkt/iomanip.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -0,0 +1,46 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP
+#define BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP
+
+#include <boost/geometry/io/wkt/write.hpp>
+
+// This short file contains only one manipulator, streaming as WKT
+// Don't move contents to as_wkt, developers must be able to choose how to stream
+
+// Don't use namespace boost::geometry, to enable the library to stream custom geometries which
+// are living outside the namespace boost { namespace geometry
+
+//namespace boost { namespace geometry
+//{
+
+
+/*!
+\brief Streams a geometry as Well-Known Text
+\ingroup wkt
+*/
+template<typename Char, typename Traits, typename Geometry>
+inline std::basic_ostream<Char,Traits>& operator<<
+ (
+ std::basic_ostream<Char,Traits> &os,
+ Geometry const& geom
+ )
+{
+ os << boost::geometry::wkt(geom);
+ return os;
+}
+
+//}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_IO_WKT_IOMANIP_HPP

Modified: trunk/boost/geometry/io/wkt/read.hpp
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/wkt/read.hpp (original)
+++ trunk/boost/geometry/io/wkt/read.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -11,8 +11,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_READ_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_READ_HPP
+#ifndef BOOST_GEOMETRY_IO_WKT_READ_HPP
+#define BOOST_GEOMETRY_IO_WKT_READ_HPP
 
 #include <string>
 
@@ -23,10 +23,8 @@
 #include <boost/mpl/if.hpp>
 #include <boost/range.hpp>
 
-
 #include <boost/type_traits.hpp>
 
-
 #include <boost/geometry/algorithms/assign.hpp>
 #include <boost/geometry/algorithms/append.hpp>
 #include <boost/geometry/algorithms/clear.hpp>
@@ -43,13 +41,11 @@
 
 #include <boost/geometry/util/coordinate_cast.hpp>
 
-#include <boost/geometry/domains/gis/io/wkt/detail/wkt.hpp>
+#include <boost/geometry/io/wkt/detail/prefix.hpp>
 
 namespace boost { namespace geometry
 {
 
-
-
 /*!
 \brief Exception showing things wrong with WKT parsing
 \ingroup wkt
@@ -92,7 +88,6 @@
 };
 
 
-
 #ifndef DOXYGEN_NO_DETAIL
 // (wkt: Well Known Text, defined by OGC for all geometries and implemented by e.g. databases (MySQL, PostGIS))
 namespace detail { namespace wkt {
@@ -652,7 +647,6 @@
 } // namespace dispatch
 #endif // DOXYGEN_NO_DISPATCH
 
-
 /*!
 \brief Parses OGC Well-Known Text (\ref WKT) into a geometry (any geometry)
 \ingroup wkt
@@ -688,5 +682,4 @@
 
 }} // namespace boost::geometry
 
-
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_READ_HPP
+#endif // BOOST_GEOMETRY_IO_WKT_READ_HPP

Deleted: /trunk/boost/geometry/domains/gis/io/wkt/read_multi.hpp
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/wkt/read_multi.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
+++ (empty file)
@@ -1,112 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-
-// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
-// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
-
-// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
-// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
-
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_READ_MULTI_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_READ_MULTI_HPP
-
-#include <string>
-
-#include <boost/geometry/core/mutable_range.hpp>
-#include <boost/geometry/multi/core/tags.hpp>
-#include <boost/geometry/multi/core/point_type.hpp>
-
-#include <boost/geometry/domains/gis/io/wkt/read.hpp>
-#include <boost/geometry/domains/gis/io/wkt/detail/wkt_multi.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-namespace detail { namespace wkt {
-
-template <typename MultiGeometry, template<typename> class Parser, typename PrefixPolicy>
-struct multi_parser
-{
- static inline void apply(std::string const& wkt, MultiGeometry& geometry)
- {
- traits::clear<MultiGeometry>::apply(geometry);
-
- tokenizer tokens(wkt, boost::char_separator<char>(" ", ",()"));
- tokenizer::iterator it;
- if (initialize<MultiGeometry>(tokens, PrefixPolicy::apply(), wkt, it))
- {
- handle_open_parenthesis(it, tokens.end(), wkt);
-
- // Parse sub-geometries
- while(it != tokens.end() && *it != ")")
- {
- traits::resize<MultiGeometry>::apply(geometry, boost::size(geometry) + 1);
- Parser
- <
- typename boost::range_value<MultiGeometry>::type
- >::apply(it, tokens.end(), wkt, geometry.back());
- if (it != tokens.end() && *it == ",")
- {
- // Skip "," after multi-element is parsed
- ++it;
- }
- }
-
- handle_close_parenthesis(it, tokens.end(), wkt);
- }
- }
-};
-
-
-
-
-}} // namespace detail::wkt
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-template <typename MultiGeometry>
-struct read_wkt<multi_point_tag, MultiGeometry>
- : detail::wkt::multi_parser
- <
- MultiGeometry,
- detail::wkt::point_parser,
- detail::wkt::prefix_multipoint
- >
-{};
-
-
-template <typename MultiGeometry>
-struct read_wkt<multi_linestring_tag, MultiGeometry>
- : detail::wkt::multi_parser
- <
- MultiGeometry,
- detail::wkt::linestring_parser,
- detail::wkt::prefix_multilinestring
- >
-{};
-
-
-template <typename MultiGeometry>
-struct read_wkt<multi_polygon_tag, MultiGeometry>
- : detail::wkt::multi_parser
- <
- MultiGeometry,
- detail::wkt::polygon_parser,
- detail::wkt::prefix_multipolygon
- >
-{};
-
-
-} // namespace dispatch
-#endif // DOXYGEN_NO_DISPATCH
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_READ_MULTI_HPP

Modified: trunk/boost/geometry/io/wkt/wkt.hpp
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/wkt/wkt.hpp (original)
+++ trunk/boost/geometry/io/wkt/wkt.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -11,13 +11,11 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WKT_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WKT_HPP
+#ifndef BOOST_GEOMETRY_IO_WKT_WKT_HPP
+#define BOOST_GEOMETRY_IO_WKT_WKT_HPP
 
-#include <boost/geometry/domains/gis/io/wkt/read.hpp>
-#include <boost/geometry/domains/gis/io/wkt/write.hpp>
+#include <boost/geometry/io/wkt/read.hpp>
+#include <boost/geometry/io/wkt/write.hpp>
+#include <boost/geometry/io/wkt/iomanip.hpp>
 
-#include <boost/geometry/domains/gis/io/wkt/read_multi.hpp>
-#include <boost/geometry/domains/gis/io/wkt/write_multi.hpp>
-
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WKT_HPP
+#endif // BOOST_GEOMETRY_IO_WKT_WKT_HPP

Modified: trunk/boost/geometry/io/wkt/write.hpp
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/wkt/write.hpp (original)
+++ trunk/boost/geometry/io/wkt/write.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -11,8 +11,8 @@
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WRITE_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WRITE_HPP
+#ifndef BOOST_GEOMETRY_IO_WKT_WRITE_HPP
+#define BOOST_GEOMETRY_IO_WKT_WRITE_HPP
 
 #include <ostream>
 #include <string>
@@ -22,7 +22,6 @@
 #include <boost/range.hpp>
 #include <boost/typeof/typeof.hpp>
 
-
 #include <boost/geometry/algorithms/assign.hpp>
 #include <boost/geometry/algorithms/convert.hpp>
 #include <boost/geometry/core/exterior_ring.hpp>
@@ -32,8 +31,7 @@
 #include <boost/geometry/geometries/concepts/check.hpp>
 #include <boost/geometry/geometries/ring.hpp>
 
-#include <boost/geometry/domains/gis/io/wkt/detail/wkt.hpp>
-
+#include <boost/geometry/io/wkt/detail/prefix.hpp>
 
 namespace boost { namespace geometry
 {
@@ -87,9 +85,6 @@
     static inline const char* apply() { return "))"; }
 };
 
-
-
-
 /*!
 \brief Stream points as \ref WKT
 */
@@ -147,9 +142,6 @@
 \brief Stream sequence of points as WKT-part, e.g. (1 2),(3 4)
 \note Used in polygon, all multi-geometries
 */
-
-
-
 template <typename Range>
 struct wkt_sequence
     : wkt_range
@@ -160,7 +152,6 @@
>
 {};
 
-
 template <typename Polygon, typename PrefixPolicy>
 struct wkt_poly
 {
@@ -186,7 +177,6 @@
     }
 };
 
-
 template <typename Box>
 struct wkt_box
 {
@@ -246,7 +236,6 @@
 }} // namespace detail::wkt
 #endif // DOXYGEN_NO_DETAIL
 
-
 #ifndef DOXYGEN_NO_DISPATCH
 namespace dispatch
 {
@@ -261,7 +250,6 @@
         );
 };
 
-
 template <typename Point>
 struct wkt<point_tag, Point>
     : detail::wkt::wkt_point
@@ -271,7 +259,6 @@
>
 {};
 
-
 template <typename Linestring>
 struct wkt<linestring_tag, Linestring>
     : detail::wkt::wkt_range
@@ -282,7 +269,6 @@
>
 {};
 
-
 /*!
 \brief Specialization to stream a box as WKT
 \details A "box" does not exist in WKT.
@@ -298,7 +284,6 @@
     : detail::wkt::wkt_segment<Segment>
 {};
 
-
 /*!
 \brief Specialization to stream a ring as WKT
 \details A ring or "linear_ring" does not exist in WKT.
@@ -315,7 +300,6 @@
>
 {};
 
-
 /*!
 \brief Specialization to stream polygon as WKT
 */
@@ -328,11 +312,9 @@
>
 {};
 
-
 } // namespace dispatch
 #endif // DOXYGEN_NO_DISPATCH
 
-
 /*!
 \brief Generic geometry template manipulator class, takes corresponding output class from traits class
 \ingroup wkt
@@ -391,4 +373,4 @@
 
 }} // namespace boost::geometry
 
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WRITE_HPP
+#endif // BOOST_GEOMETRY_IO_WKT_WRITE_HPP

Deleted: /trunk/boost/geometry/domains/gis/io/wkt/write_multi.hpp
==============================================================================
--- /trunk/boost/geometry/domains/gis/io/wkt/write_multi.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
+++ (empty file)
@@ -1,115 +0,0 @@
-// Boost.Geometry (aka GGL, Generic Geometry Library)
-
-// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
-// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
-// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
-
-// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
-// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
-
-// Use, modification and distribution is subject to the Boost Software License,
-// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WRITE_MULTI_HPP
-#define BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WRITE_MULTI_HPP
-
-#include <boost/geometry/multi/core/tags.hpp>
-
-#include <boost/geometry/domains/gis/io/wkt/write.hpp>
-#include <boost/geometry/domains/gis/io/wkt/detail/wkt_multi.hpp>
-
-
-namespace boost { namespace geometry
-{
-
-#ifndef DOXYGEN_NO_DETAIL
-namespace detail { namespace wkt
-{
-
-
-template <typename Multi, typename StreamPolicy, typename PrefixPolicy>
-struct wkt_multi
-{
- template <typename Char, typename Traits>
- static inline void apply(std::basic_ostream<Char, Traits>& os,
- Multi const& geometry)
- {
- os << PrefixPolicy::apply();
- // TODO: check EMPTY here
- os << "(";
-
- for (typename boost::range_iterator<Multi const>::type
- it = boost::begin(geometry);
- it != boost::end(geometry);
- ++it)
- {
- if (it != boost::begin(geometry))
- {
- os << ",";
- }
- StreamPolicy::apply(os, *it);
- }
-
- os << ")";
- }
-};
-
-}} // namespace wkt::impl
-#endif
-
-
-#ifndef DOXYGEN_NO_DISPATCH
-namespace dispatch
-{
-
-
-template <typename Multi>
-struct wkt<multi_point_tag, Multi>
- : detail::wkt::wkt_multi
- <
- Multi,
- detail::wkt::wkt_point
- <
- typename boost::range_value<Multi>::type,
- detail::wkt::prefix_null
- >,
- detail::wkt::prefix_multipoint
- >
-{};
-
-
-template <typename Multi>
-struct wkt<multi_linestring_tag, Multi>
- : detail::wkt::wkt_multi
- <
- Multi,
- detail::wkt::wkt_sequence
- <
- typename boost::range_value<Multi>::type
- >,
- detail::wkt::prefix_multilinestring
- >
-{};
-
-
-template <typename Multi>
-struct wkt<multi_polygon_tag, Multi>
- : detail::wkt::wkt_multi
- <
- Multi,
- detail::wkt::wkt_poly
- <
- typename boost::range_value<Multi>::type,
- detail::wkt::prefix_null
- >,
- detail::wkt::prefix_multipolygon
- >
-{};
-
-} // namespace dispatch
-#endif
-
-}} // namespace boost::geometry
-
-#endif // BOOST_GEOMETRY_DOMAINS_GIS_IO_WKT_WRITE_MULTI_HPP

Added: trunk/boost/geometry/multi/io/wkt/detail/prefix.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/multi/io/wkt/detail/prefix.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -0,0 +1,49 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_MULTI_IO_WKT_DETAIL_PREFIX_HPP
+#define BOOST_GEOMETRY_MULTI_IO_WKT_DETAIL_PREFIX_HPP
+
+#include <boost/geometry/multi/core/tags.hpp>
+
+namespace boost { namespace geometry {
+
+#ifndef DOXYGEN_NO_DETAIL
+namespace detail { namespace wkt {
+
+struct prefix_null
+{
+ static inline const char* apply() { return ""; }
+};
+
+struct prefix_multipoint
+{
+ static inline const char* apply() { return "MULTIPOINT"; }
+};
+
+struct prefix_multilinestring
+{
+ static inline const char* apply() { return "MULTILINESTRING"; }
+};
+
+struct prefix_multipolygon
+{
+ static inline const char* apply() { return "MULTIPOLYGON"; }
+};
+
+}} // namespace wkt::impl
+#endif
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_MULTI_IO_WKT_DETAIL_PREFIX_HPP

Added: trunk/boost/geometry/multi/io/wkt/read.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/multi/io/wkt/read.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -0,0 +1,103 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_MULTI_IO_WKT_READ_MULTI_HPP
+#define BOOST_GEOMETRY_MULTI_IO_WKT_READ_MULTI_HPP
+
+#include <string>
+
+#include <boost/geometry/core/mutable_range.hpp>
+#include <boost/geometry/multi/core/tags.hpp>
+#include <boost/geometry/multi/core/point_type.hpp>
+#include <boost/geometry/multi/io/wkt/detail/prefix.hpp>
+#include <boost/geometry/io/wkt/read.hpp>
+
+namespace boost { namespace geometry {
+
+namespace detail { namespace wkt {
+
+template <typename MultiGeometry, template<typename> class Parser, typename PrefixPolicy>
+struct multi_parser
+{
+ static inline void apply(std::string const& wkt, MultiGeometry& geometry)
+ {
+ traits::clear<MultiGeometry>::apply(geometry);
+
+ tokenizer tokens(wkt, boost::char_separator<char>(" ", ",()"));
+ tokenizer::iterator it;
+ if (initialize<MultiGeometry>(tokens, PrefixPolicy::apply(), wkt, it))
+ {
+ handle_open_parenthesis(it, tokens.end(), wkt);
+
+ // Parse sub-geometries
+ while(it != tokens.end() && *it != ")")
+ {
+ traits::resize<MultiGeometry>::apply(geometry, boost::size(geometry) + 1);
+ Parser
+ <
+ typename boost::range_value<MultiGeometry>::type
+ >::apply(it, tokens.end(), wkt, geometry.back());
+ if (it != tokens.end() && *it == ",")
+ {
+ // Skip "," after multi-element is parsed
+ ++it;
+ }
+ }
+
+ handle_close_parenthesis(it, tokens.end(), wkt);
+ }
+ }
+};
+
+}} // namespace detail::wkt
+
+#ifndef DOXYGEN_NO_DISPATCH
+namespace dispatch
+{
+
+template <typename MultiGeometry>
+struct read_wkt<multi_point_tag, MultiGeometry>
+ : detail::wkt::multi_parser
+ <
+ MultiGeometry,
+ detail::wkt::point_parser,
+ detail::wkt::prefix_multipoint
+ >
+{};
+
+template <typename MultiGeometry>
+struct read_wkt<multi_linestring_tag, MultiGeometry>
+ : detail::wkt::multi_parser
+ <
+ MultiGeometry,
+ detail::wkt::linestring_parser,
+ detail::wkt::prefix_multilinestring
+ >
+{};
+
+template <typename MultiGeometry>
+struct read_wkt<multi_polygon_tag, MultiGeometry>
+ : detail::wkt::multi_parser
+ <
+ MultiGeometry,
+ detail::wkt::polygon_parser,
+ detail::wkt::prefix_multipolygon
+ >
+{};
+
+} // namespace dispatch
+#endif // DOXYGEN_NO_DISPATCH
+
+}} // namespace boost::geometry
+
+#endif // BOOST_GEOMETRY_MULTI_IO_WKT_READ_MULTI_HPP

Added: trunk/boost/geometry/multi/io/wkt/wkt.hpp
==============================================================================
--- (empty file)
+++ trunk/boost/geometry/multi/io/wkt/wkt.hpp 2011-12-15 20:28:37 EST (Thu, 15 Dec 2011)
@@ -0,0 +1,20 @@
+// Boost.Geometry (aka GGL, Generic Geometry Library)
+
+// Copyright (c) 2007-2011 Barend Gehrels, Amsterdam, the Netherlands.
+// Copyright (c) 2008-2011 Bruno Lalande, Paris, France.
+// Copyright (c) 2009-2011 Mateusz Loskot, London, UK.
+
+// Parts of Boost.Geometry are redesigned from Geodan's Geographic Library
+// (geolib/GGL), copyright (c) 1995-2010 Geodan, Amsterdam, the Netherlands.
+
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef BOOST_GEOMETRY_MULTI_IO_WKT_WKT_HPP
+#define BOOST_GEOMETRY_MULTI_IO_WKT_WKT_HPP
+
+#include <boost/geometry/multi/io/wkt/read.hpp>
+#include <boost/geometry/multi/io/wkt/write.hpp>
+
+#endif // BOOST_GEOMETRY_MULTI_IO_WKT_WKT_HPP

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


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk