#include #include namespace bg = boost::geometry; typedef bg::model::point point_t; typedef bg::model::linestring linestring_t; int main() { point_t p; bg::read_wkt("POINT(5000000 5000000)", p); linestring_t l1; bg::read_wkt("LINESTRING(5000000 4000000, 4000000 5000000)", l1); linestring_t l2; bg::read_wkt("LINESTRING(5000000 4000000, 4000000 5000000, 0 9000000)", l2); std::cout << bg::distance(p, l1) << std::endl; std::cout << bg::distance(p, l2) << std::endl; }