1 // Boost.Geometry (aka GGL, Generic Geometry Library)
2 // QuickBook Example
3
4 // Copyright (c) 2014 Barend Gehrels, Amsterdam, the Netherlands.
5
6 // Use, modification and distribution is subject to the Boost Software License,
7 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
8 // http://www.boost.org/LICENSE_1_0.txt)
9
10 //[read_wkt
11 //` Shows the usage of read_wkt
12
13 #include <boost/geometry.hpp>
14 #include <boost/geometry/geometries/point_xy.hpp>
15 #include <boost/geometry/geometries/linestring.hpp>
16 #include <boost/geometry/geometries/polygon.hpp>
17
main()18 int main()
19 {
20 typedef boost::geometry::model::d2::point_xy<double> point_type;
21
22 point_type a;
23 boost::geometry::model::linestring<point_type> b;
24 boost::geometry::model::polygon<point_type> c;
25 boost::geometry::model::box<point_type> d;
26 boost::geometry::model::segment<point_type> e;
27
28 boost::geometry::read_wkt("POINT(1 2)", a);
29 boost::geometry::read_wkt("LINESTRING(0 0,2 2,3 1)", b);
30 boost::geometry::read_wkt("POLYGON((0 0,0 7,4 2,2 0,0 0))", c);
31 boost::geometry::read_wkt("BOX(0 0,3 3)", d);
32 boost::geometry::read_wkt("SEGMENT(1 0,3 4)", e);
33
34 return 0;
35 }
36
37 //]
38
39