mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-11 13:34:10 +00:00
Updated
This commit is contained in:
parent
f526bb8f54
commit
5aa539d58e
@ -10,6 +10,7 @@
|
||||
//` Calculate Similarity between two geometries as the discrete frechet distance between them.
|
||||
#include <iostream>
|
||||
#include <boost/geometry.hpp>
|
||||
#include <boost/geometry/algorithms/discrete_frechet_distance.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
int main()
|
||||
@ -18,9 +19,9 @@ int main()
|
||||
typedef boost::geometry::model::linestring<point_type> linestring_type;
|
||||
linestring_type linestring1,linestring2;
|
||||
boost::geometry::read_wkt("LINESTRING(0 0,1 1,1 2,2 1,2 2)", linestring1);
|
||||
boost::geometry::read_wkt("LINESTRING(1 0,0 1,1 1,2 1,3 1)", linestring2);
|
||||
boost::geometry::read_wkt("LINESTRING(1 0,0 1,1 1,2 1,3 1)", linestring2);
|
||||
double res;
|
||||
res = boost::geometry::frechet_distance(linestring1,linestrign2);
|
||||
res = boost::geometry::discrete_frechet_distance(linestring1,linestring2);
|
||||
std::cout << "Discrete Frechet Distance: " << res << std::endl;
|
||||
return 0;
|
||||
}
|
||||
@ -32,4 +33,4 @@ Output:
|
||||
Discrete Frechet Distance: 1.41421
|
||||
]
|
||||
*/
|
||||
//]
|
||||
//]
|
||||
|
@ -10,6 +10,7 @@
|
||||
//` Calculate Similarity between two geometries as the discrete hasdorff distance between them.
|
||||
#include <iostream>
|
||||
#include <boost/geometry.hpp>
|
||||
#include <boost/geometry/algorithms/discrete_hausdorff_distance.hpp>
|
||||
#include <boost/geometry/geometries/point_xy.hpp>
|
||||
#include <boost/geometry/geometries/linestring.hpp>
|
||||
int main()
|
||||
@ -18,9 +19,9 @@ int main()
|
||||
typedef boost::geometry::model::linestring<point_type> linestring_type;
|
||||
linestring_type linestring1,linestring2;
|
||||
boost::geometry::read_wkt("LINESTRING(0 0,1 1,1 2,2 1,2 2)", linestring1);
|
||||
boost::geometry::read_wkt("LINESTRING(1 0,0 1,1 1,2 1,3 1)", linestring2);
|
||||
boost::geometry::read_wkt("LINESTRING(1 0,0 1,1 1,2 1,3 1)", linestring2);
|
||||
double res;
|
||||
res = boost::geometry::hausdorff_distance(linestring1,linestring2);
|
||||
res = boost::geometry::discrete_hausdorff_distance(linestring1,linestring2);
|
||||
std::cout << "Discrete Hausdorff Distance: " << res << std::endl;
|
||||
return 0;
|
||||
}
|
||||
@ -32,4 +33,4 @@ Output:
|
||||
Discrete Hausdorff Distance: 1.0
|
||||
]
|
||||
*/
|
||||
//]
|
||||
//]
|
||||
|
@ -79,7 +79,6 @@ build-project overlay ;
|
||||
build-project perimeter ;
|
||||
build-project relate ;
|
||||
build-project set_operations ;
|
||||
build-project similarity;
|
||||
build-project similarity ;
|
||||
build-project touches ;
|
||||
build-project within ;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user