Ticket #6584: test2.cpp

File test2.cpp, 619 bytes (added by aleksey.tulinov@…, 11 years ago)

Test application

Line 
1
2#include <boost/geometry.hpp>
3#include <boost/geometry/geometries/geometries.hpp>
4
5namespace bg = boost::geometry;
6
7typedef bg::model::point<double, 2, bg::cs::cartesian> point_t;
8typedef bg::model::linestring<point_t> linestring_t;
9
10int main()
11{
12 point_t p;
13 bg::read_wkt("POINT(5000000 5000000)", p);
14
15 linestring_t l1;
16 bg::read_wkt("LINESTRING(5000000 4000000, 4000000 5000000)", l1);
17
18 linestring_t l2;
19 bg::read_wkt("LINESTRING(5000000 4000000, 4000000 5000000, 0 9000000)", l2);
20
21 std::cout << bg::distance(p, l1) << std::endl;
22 std::cout << bg::distance(p, l2) << std::endl;
23}
24