|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r85724 - trunk/libs/geometry/extensions/example/gis/latlong
From: barend.gehrels_at_[hidden]
Date: 2013-09-17 12:08:08
Author: barendgehrels
Date: 2013-09-17 12:08:08 EDT (Tue, 17 Sep 2013)
New Revision: 85724
URL: http://svn.boost.org/trac/boost/changeset/85724
Log:
[geometry][extensions] Bugfixes: fixed distance strategies (w.r.t. changed template parameters) in latlong examples
Text files modified:
trunk/libs/geometry/extensions/example/gis/latlong/distance_example.cpp | 16 ++++++++--------
trunk/libs/geometry/extensions/example/gis/latlong/point_ll_example.cpp | 4 ++--
2 files changed, 10 insertions(+), 10 deletions(-)
Modified: trunk/libs/geometry/extensions/example/gis/latlong/distance_example.cpp
==============================================================================
--- trunk/libs/geometry/extensions/example/gis/latlong/distance_example.cpp Tue Sep 17 12:00:09 2013 (r85723)
+++ trunk/libs/geometry/extensions/example/gis/latlong/distance_example.cpp 2013-09-17 12:08:08 EDT (Tue, 17 Sep 2013) (r85724)
@@ -82,17 +82,17 @@
std::cout << "Distance " << city1_name << "-" << city2_name << ": " << std::endl;
std::cout << "haversine: " << 0.001 * distance(city1, city2) << " km" << std::endl;
std::cout << "haversine rad: " << 0.001 * distance(city1_rad, city2_rad) << " km" << std::endl;
- std::cout << "haversine other radius: " << distance(city1, city2, strategy::distance::haversine<latlon_point>(6371.0) ) << " km" << std::endl;
- std::cout << "andoyer: " << 0.001 * distance(city1, city2, strategy::distance::andoyer<latlon_point>() ) << " km" << std::endl;
- std::cout << "vincenty: " << 0.001 * distance(city1, city2, strategy::distance::vincenty<latlon_point>() ) << " km" << std::endl;
- std::cout << "vincenty rad: " << 0.001 * distance(city1_rad, city2_rad, strategy::distance::vincenty<model::ll::point<radian> >() ) << " km" << std::endl;
+ std::cout << "haversine other radius: " << distance(city1, city2, strategy::distance::haversine<double>(6371.0) ) << " km" << std::endl;
+ std::cout << "andoyer: " << 0.001 * distance(city1, city2, strategy::distance::andoyer<double>() ) << " km" << std::endl;
+ std::cout << "vincenty: " << 0.001 * distance(city1, city2, strategy::distance::vincenty<double>() ) << " km" << std::endl;
+ std::cout << "vincenty rad: " << 0.001 * distance(city1_rad, city2_rad, strategy::distance::vincenty<double>() ) << " km" << std::endl;
std::cout << "Projected, pythagoras: " << 0.001 * distance(city1_prj, city2_prj) << " km" << std::endl;
std::cout << std::endl;
std::cout << "Distance " << city1_name << "-" << city3_name << ": " << std::endl;
- std::cout << "andoyer: " << 0.001 * distance(city1, city3, strategy::distance::andoyer<latlon_point>()) << " km" << std::endl;
+ std::cout << "andoyer: " << 0.001 * distance(city1, city3, strategy::distance::andoyer<double>()) << " km" << std::endl;
std::cout << "Distance " << city2_name << "-" << city3_name << ": " << std::endl;
- std::cout << "andoyer: " << 0.001 * distance(city2, city3, strategy::distance::andoyer<latlon_point>()) << " km" << std::endl;
+ std::cout << "andoyer: " << 0.001 * distance(city2, city3, strategy::distance::andoyer<double>()) << " km" << std::endl;
// ------------------------------------------------------------------------------------------
// Distances to segments
@@ -119,7 +119,7 @@
// Compilation
// ------------------------------------------------------------------------------------------
// Next line does not compile because Vincenty cannot work on xy-points
- //std::cout << "vincenty on xy: " << 0.001 * distance(city1_prj, city2_prj, formulae::distance::vincenty<>() ) << " km" << std::endl;
+ //std::cout << "vincenty on xy: " << 0.001 * distance(city1_prj, city2_prj, formulae::distance::vincenty<double>() ) << " km" << std::endl;
// Next line does not compile because you cannot (yet) assign degree to radian directly
//ll::point<radian> a_rad2 = city1;
@@ -137,7 +137,7 @@
append(line1, city1);
append(line1, city2);
std::cout << "length: " << length(line1) << std::endl;
- std::cout << "length using Vincenty: " << length(line1, strategy::distance::vincenty<latlon_point>()) << std::endl;
+ std::cout << "length using Vincenty: " << length(line1, strategy::distance::vincenty<double>()) << std::endl;
model::linestring<xy_point> line2;
append(line2, city1_prj);
Modified: trunk/libs/geometry/extensions/example/gis/latlong/point_ll_example.cpp
==============================================================================
--- trunk/libs/geometry/extensions/example/gis/latlong/point_ll_example.cpp Tue Sep 17 12:00:09 2013 (r85723)
+++ trunk/libs/geometry/extensions/example/gis/latlong/point_ll_example.cpp 2013-09-17 12:08:08 EDT (Tue, 17 Sep 2013) (r85724)
@@ -89,13 +89,13 @@
<< " km" << std::endl;
std::cout << "Distance Paris-Lima, Vincenty "
- << 0.001 * distance(paris, lima, strategy::distance::vincenty<latlon_point>())
+ << 0.001 * distance(paris, lima, strategy::distance::vincenty<double>())
<< " km" << std::endl;
// Using great circle (=haversine), this is less precise because earth is not a sphere
double const average_earth_radius = 6372795.0;
std::cout << "Distance Paris-Lima, great circle "
- << 0.001 * distance(paris, lima, strategy::distance::haversine<latlon_point>(average_earth_radius))
+ << 0.001 * distance(paris, lima, strategy::distance::haversine<double>(average_earth_radius))
<< " km" << std::endl;
// Convert a latlong point to radians. This might be convenient, although algorithms
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