mirror of
https://github.com/boostorg/geometry.git
synced 2025-05-12 14:01:47 +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.
|
//` Calculate Similarity between two geometries as the discrete frechet distance between them.
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/geometry.hpp>
|
#include <boost/geometry.hpp>
|
||||||
|
#include <boost/geometry/algorithms/discrete_frechet_distance.hpp>
|
||||||
#include <boost/geometry/geometries/point_xy.hpp>
|
#include <boost/geometry/geometries/point_xy.hpp>
|
||||||
#include <boost/geometry/geometries/linestring.hpp>
|
#include <boost/geometry/geometries/linestring.hpp>
|
||||||
int main()
|
int main()
|
||||||
@ -18,9 +19,9 @@ int main()
|
|||||||
typedef boost::geometry::model::linestring<point_type> linestring_type;
|
typedef boost::geometry::model::linestring<point_type> linestring_type;
|
||||||
linestring_type linestring1,linestring2;
|
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(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;
|
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;
|
std::cout << "Discrete Frechet Distance: " << res << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -32,4 +33,4 @@ Output:
|
|||||||
Discrete Frechet Distance: 1.41421
|
Discrete Frechet Distance: 1.41421
|
||||||
]
|
]
|
||||||
*/
|
*/
|
||||||
//]
|
//]
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
//` Calculate Similarity between two geometries as the discrete hasdorff distance between them.
|
//` Calculate Similarity between two geometries as the discrete hasdorff distance between them.
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <boost/geometry.hpp>
|
#include <boost/geometry.hpp>
|
||||||
|
#include <boost/geometry/algorithms/discrete_hausdorff_distance.hpp>
|
||||||
#include <boost/geometry/geometries/point_xy.hpp>
|
#include <boost/geometry/geometries/point_xy.hpp>
|
||||||
#include <boost/geometry/geometries/linestring.hpp>
|
#include <boost/geometry/geometries/linestring.hpp>
|
||||||
int main()
|
int main()
|
||||||
@ -18,9 +19,9 @@ int main()
|
|||||||
typedef boost::geometry::model::linestring<point_type> linestring_type;
|
typedef boost::geometry::model::linestring<point_type> linestring_type;
|
||||||
linestring_type linestring1,linestring2;
|
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(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;
|
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;
|
std::cout << "Discrete Hausdorff Distance: " << res << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -32,4 +33,4 @@ Output:
|
|||||||
Discrete Hausdorff Distance: 1.0
|
Discrete Hausdorff Distance: 1.0
|
||||||
]
|
]
|
||||||
*/
|
*/
|
||||||
//]
|
//]
|
||||||
|
@ -79,7 +79,6 @@ build-project overlay ;
|
|||||||
build-project perimeter ;
|
build-project perimeter ;
|
||||||
build-project relate ;
|
build-project relate ;
|
||||||
build-project set_operations ;
|
build-project set_operations ;
|
||||||
build-project similarity;
|
build-project similarity ;
|
||||||
build-project touches ;
|
build-project touches ;
|
||||||
build-project within ;
|
build-project within ;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user