SlideShare a Scribd company logo
1 of 28
Download to read offline
Spatial trajectories in Boost Geometry
Vissarion Fisikopoulos
FOSDEM 2020
Boost.Geometry
Part of Boost C++ Libraries
Header-only
C++03 (conditionally C++11, C++14)
Metaprogramming, Tags dispatching
Primitives, Algorithms, Spatial Index
Standards: OGC SFA
used by MySQL for GIS
How to Get Started?
Documentation: www.boost.org/libs/geometry
Mailing list: lists.boost.org/geometry
GitHub: github.com/boostorg/geometry
Who is Boost.Geometry?
Boost.Geometry is an open source project (as any other Boost
library)
Anybody can, and is welcome, to contribute
Core development team:
Barend Gehrels
Bruno Lalande
Mateusz Loskot
Adam Wulkiewicz
Menelaos Karavelas
Vissarion Fysikopoulos
Contributions from about a dozen of other developers
See Boost.Geometry website for credits and GitHub
repositorys history
Boost.Geometry &
MySQL (since 5.7) relies on Boost geometry for GIS support
(geographic support since 8)
no homegrown set of GIS functions for MySQL
both aim in OGC standard compliance
compatible licences
MySQL benefit from BG open source community
(maintenance, bug fixing, gsoc)
BG is C++/header only → no problems with versions of a
shared library on different platforms for MySQL
Hello, world!
#include <boost/geometry.hpp >
#include <boost/geometry/geometries/geometries.hpp >
#include <iostream >
namespace bg = boost :: geometry;
int main () {
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
std :: cout << bg:: distance(
point(23.725750, 37.971536), //Athens , Acropolis
point(4.3826169, 50.8119483)); // Brussels , ULB
}
Hello, world!
#include <boost/geometry.hpp >
#include <boost/geometry/geometries/geometries.hpp >
#include <iostream >
namespace bg = boost :: geometry;
int main () {
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
std :: cout << bg:: distance(
point(23.725750, 37.971536), //Athens , Acropolis
point(4.3826169, 50.8119483)); // Brussels , ULB
}
result=2088.389 km
Hello strategies!
#include <boost/geometry.hpp >
#include <boost/geometry/geometries/geometries.hpp >
#include <iostream >
namespace bg = boost :: geometry;
int main () {
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
std :: cout << bg:: distance(
point(23.725750, 37.971536), //Athens , Acropolis
point(4.3826169, 50.8119483) // Brussels , ULB
bg::strategy::distance::vincenty<>() );
}
Hello strategies!
#include <boost/geometry.hpp >
#include <boost/geometry/geometries/geometries.hpp >
#include <iostream >
namespace bg = boost :: geometry;
int main () {
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
std :: cout << bg:: distance(
point(23.725750, 37.971536), //Athens , Acropolis
point(4.3826169, 50.8119483) // Brussels , ULB
bg::strategy::distance::vincenty<>() );
}
result=2088389 m
result with strategy=2088384 m
Boost Geometry Algorithms= CS-independent part + CS-specific
part (strategies)
Models of the earth and coordinate systems
Flat
boost::geometry::cs::cartesian
Models of the earth and coordinate systems
Flat
boost::geometry::cs::cartesian
Sphere (Widely used e.g. google.maps)
boost::geometry::cs::spherical equatorial<bg::degree>
boost::geometry::cs::spherical equatorial<bg::radian>
Models of the earth and coordinate systems
Flat
boost::geometry::cs::cartesian
Sphere (Widely used e.g. google.maps)
boost::geometry::cs::spherical equatorial<bg::degree>
boost::geometry::cs::spherical equatorial<bg::radian>
Ellipsoid of revolution (geographic GIS state-of-the-art)
boost::geometry::cs::geogrphic<bg::degree>
boost::geometry::cs::geogrphic<bg::radian>
Models of the earth and coordinate systems
Flat
boost::geometry::cs::cartesian
Sphere (Widely used e.g. google.maps)
boost::geometry::cs::spherical equatorial<bg::degree>
boost::geometry::cs::spherical equatorial<bg::radian>
Ellipsoid of revolution (geographic GIS state-of-the-art)
boost::geometry::cs::geogrphic<bg::degree>
boost::geometry::cs::geogrphic<bg::radian>
Geoid (Special applications, geophysics etc)
Spatial trajectories
trajectories are sequencies of time-stamped locations
generated by GPS, smartphones, infrastructure, computer
games, natural phenomena, etc
here we study only the spatial and not the temporal
information, i.e. trajectories are modelled as linestrings
Trajetories of major huricanes in Atlantic [Wang et al.’17]
Trajectories data-set
GeoLife GPS Trajectories dataset [download]
https://www.microsoft.com/en-us/research/wp-content/
uploads/2016/02/User20Guide-1.2.pdf
Two trajectories
Simple operations: size, length, distance
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
bg:: model :: linestring <point > ls1, ls2;
std :: ifstream myfile1 (" Geolife_Trajectories_ 1.3/Data/000/
Trajectory/20090516091038.plt");
std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/
Trajectory/20081224011945.plt");
read_linestring (myfile1, ls1);
read_linestring (myfile2, ls2);
std :: cout << boost :: size(ls1) << std:: endl;
std :: cout << boost :: size(ls2) << std:: endl;
std :: cout << bg:: length(ls1) << std :: endl;
std :: cout << bg:: length(ls2) << std :: endl;
std :: cout << bg:: distance(ls1, ls2) << std :: endl;
317
75
2196.14
718.456
369.504
Note: distances in meters, result by use of non default strategies neglectable
Closest points
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
using linestring = bg:: model :: linestring <point >;
linestring ls1, ls2;
std :: ifstream myfile1 (" Geolife_Trajectories_ 1.3/Data/000/
Trajectory/20090516091038.plt");
std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/
Trajectory/20081224011945.plt");
read_linestring (myfile1, ls1);
read_linestring (myfile2, ls2);
bg:: model :: segment <point > sout;
bg:: closest_points (ls1, ls2, sout );
Closest points
Simplification of trajectories
simplification using Douglas-Peucker algorithm
quadratic worst case complexity [Hershberger et.al’92]
line interpolate: interpolate points on linestring at a fixed
distance
sampling points on linestrings
(https://github.com/boostorg/geometry/pull/618)
Simplify and line interpolate
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
using linestring = bg:: model :: linestring <point >;
linestring ls;
std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/
Trajectory/20081224011945.plt");
read_linestring (myfile2, ls);
std :: cout << "#points in ls = " << boost :: size(ls2) << std :: endl;
std :: cout << "ls length (m) = " << bg:: length(ls2) << std:: endl;
linestring ls_simplified ;
bg:: simplify(ls2, ls_simplified , 20);
std :: cout << "#points in simplified = " << boost :: size( ls_simplif
using multipoint_type = bg:: model :: multi_point <point >;
multipoint_type mp;
bg:: line_interpolate (ls2, 70, mp);
std :: cout << "#points interpolated = " << boost :: size(mp) << std::
#points in ls = 75
ls length (m) = 718.456
#points in simplified = 6
#points interpolated = 9
Simplification and line interpolate
Measuring similarity of trajectories
Hausdorff distance
H(f, g) = max
a∈f
{ min
b∈g
{ dist(a, b) } }
Fr´echet distance
F(f, g) = min { ||L|| L is a coupling between f and g }
coupling is a sequence of pairs from f, g that respect the order
Three trajectories
l1: red, l2: green, l3: blue
Hausdorff & Fr´echet distance
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
bg:: model :: linestring <point > ls1, ls2, ls3;
std :: ifstream myfile1 (" Geolife_Trajectories_ 1.3/Data/000/
Trajectory/20090516091038.plt");
std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/
Trajectory/20081224011945.plt");
std :: ifstream myfile3 (" Geolife_Trajectories_ 1.3/Data/000/
Trajectory/20081026134407.plt");
read_linestring (myfile1, ls1);
read_linestring (myfile2, ls2);
read_linestring (myfile3, ls3);
std :: cout << bg:: discrete_hausdorff_distance (ls1, ls2) << ","
<< bg:: discrete_hausdorff_distance (ls2, ls3) << ","
<< bg:: discrete_hausdorff_distance (ls1, ls3)
<< std:: endl;
std :: cout << bg:: discrete_frechet_distance (ls1, ls2) << ","
<< bg:: discrete_frechet_distance (ls2, ls3) << ","
<< bg:: discrete_frechet_distance (ls1, ls3)
<< std:: endl;
919.467, 7266.3, 8175.84
1260.76, 12601.7, 12837.9
Hausdorff & Fr´echet distance
Comparing similarity of 160 pairs of trajectories
namespace bf = boost :: filesystem;
using point = bg:: model :: point
<double , 2, bg::cs:: geographic <bg:: degree >>;
linestring = bg:: model :: linestring <point > ls1, ls2;
bf:: path p{" Geolife_Trajectories_ 1.3/Data/000/Trajectory/"};
bf:: directory_iterator it1{p};
double min_frechet = 10000000;
bf:: directory_iterator it2{bf:: path{" Geolife_Trajectories_ 1.3/
Data/010/Trajectory/"}};
for (; it2 != bf:: directory_iterator {}; it2++)
{
std :: ifstream myfile1((* it1). path (). string ());
std :: ifstream myfile2((* it2). path (). string ());
read_linestring (myfile1, ls1);
read_linestring (myfile2, ls2);
double frechet = bg:: discrete_frechet_distance (ls1, ls2);
min_frechet = frechet < min_frechet ? frechet : min_frechet ;
}
cartesian: 9.97[sec]
spherical: 28.47[sec]
geographic: 52.30[sec]
Most similar trajectories
Same result for cartesian, spherical, geographic
Thank you! Questions?

More Related Content

What's hot

Scalable Online Betweenness Centrality in Evolving Graphs
Scalable Online Betweenness Centrality in Evolving GraphsScalable Online Betweenness Centrality in Evolving Graphs
Scalable Online Betweenness Centrality in Evolving GraphsNicolas Kourtellis
 
Tao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingTao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingFayan TAO
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocityabidraza88
 
Geopy module in python
Geopy module in pythonGeopy module in python
Geopy module in pythonAshmita Dhakal
 
Modeling of heat transfer in 2 d slab
Modeling of heat transfer in 2 d slabModeling of heat transfer in 2 d slab
Modeling of heat transfer in 2 d slabAlexander Decker
 
Iii min i sem q.bank 2016 17
Iii min i sem q.bank 2016 17Iii min i sem q.bank 2016 17
Iii min i sem q.bank 2016 17Amit Kumar Jha
 
359 me-2009-gate-question-paper
359 me-2009-gate-question-paper359 me-2009-gate-question-paper
359 me-2009-gate-question-paperdrmbalu
 
Computer Vision Pertemuan 05
Computer  Vision Pertemuan 05Computer  Vision Pertemuan 05
Computer Vision Pertemuan 05soe sumijan
 
An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...
An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...
An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...CSCJournals
 

What's hot (14)

Scalable Online Betweenness Centrality in Evolving Graphs
Scalable Online Betweenness Centrality in Evolving GraphsScalable Online Betweenness Centrality in Evolving Graphs
Scalable Online Betweenness Centrality in Evolving Graphs
 
Dataflow Analysis
Dataflow AnalysisDataflow Analysis
Dataflow Analysis
 
Tao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume renderingTao Fayan_Iso and Full_volume rendering
Tao Fayan_Iso and Full_volume rendering
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocity
 
Geopy module in python
Geopy module in pythonGeopy module in python
Geopy module in python
 
Modeling of heat transfer in 2 d slab
Modeling of heat transfer in 2 d slabModeling of heat transfer in 2 d slab
Modeling of heat transfer in 2 d slab
 
Iii min i sem q.bank 2016 17
Iii min i sem q.bank 2016 17Iii min i sem q.bank 2016 17
Iii min i sem q.bank 2016 17
 
W+charm poster
W+charm posterW+charm poster
W+charm poster
 
359 me-2009-gate-question-paper
359 me-2009-gate-question-paper359 me-2009-gate-question-paper
359 me-2009-gate-question-paper
 
SBMF
SBMFSBMF
SBMF
 
Computer Vision Pertemuan 05
Computer  Vision Pertemuan 05Computer  Vision Pertemuan 05
Computer Vision Pertemuan 05
 
Pixel rf
Pixel rfPixel rf
Pixel rf
 
Hardcore functional programming
Hardcore functional programmingHardcore functional programming
Hardcore functional programming
 
An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...
An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...
An Efficient Algorithm for Contact Angle Estimation in Molecular Dynamics Sim...
 

Similar to Working with spatial trajectories in Boost Geometry

Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1Chris Hill
 
Geolocation on Rails
Geolocation on RailsGeolocation on Rails
Geolocation on Railsnebirhos
 
C++ 11 Features
C++ 11 FeaturesC++ 11 Features
C++ 11 FeaturesJan Rüegg
 
Opensource gis development - part 2
Opensource gis development - part 2Opensource gis development - part 2
Opensource gis development - part 2Andrea Antonello
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeMd Swawibe Ul Alam
 
COMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHM
COMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHMCOMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHM
COMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHMsipij
 
Comparison of GPU and FPGA Hardware Acceleration of Lane Detection Algorithm
Comparison of GPU and FPGA Hardware Acceleration of Lane Detection AlgorithmComparison of GPU and FPGA Hardware Acceleration of Lane Detection Algorithm
Comparison of GPU and FPGA Hardware Acceleration of Lane Detection Algorithmsipij
 
Designing of Adders and Vedic Multiplier using Gate Diffusion Input
Designing of Adders and Vedic Multiplier using Gate Diffusion InputDesigning of Adders and Vedic Multiplier using Gate Diffusion Input
Designing of Adders and Vedic Multiplier using Gate Diffusion InputIRJET Journal
 
Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...
Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...
Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...VLSICS Design
 
Griffon Topic2 Presentation (Tia)
Griffon Topic2 Presentation (Tia)Griffon Topic2 Presentation (Tia)
Griffon Topic2 Presentation (Tia)Nat Weerawan
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008xilinus
 
FPGA based BCH Decoder
FPGA based BCH DecoderFPGA based BCH Decoder
FPGA based BCH Decoderijsrd.com
 
A practical work of matlab
A practical work of matlabA practical work of matlab
A practical work of matlabSalanSD
 
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...Zalando adtech lab
 
4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)PROIDEA
 

Similar to Working with spatial trajectories in Boost Geometry (20)

Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
Chris hill rps_postgis_threeoutoffouraintbad_20150505_1
 
Geolocation on Rails
Geolocation on RailsGeolocation on Rails
Geolocation on Rails
 
C++ 11 Features
C++ 11 FeaturesC++ 11 Features
C++ 11 Features
 
50120130406025 2
50120130406025 250120130406025 2
50120130406025 2
 
Opensource gis development - part 2
Opensource gis development - part 2Opensource gis development - part 2
Opensource gis development - part 2
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
COMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHM
COMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHMCOMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHM
COMPARISON OF GPU AND FPGA HARDWARE ACCELERATION OF LANE DETECTION ALGORITHM
 
Comparison of GPU and FPGA Hardware Acceleration of Lane Detection Algorithm
Comparison of GPU and FPGA Hardware Acceleration of Lane Detection AlgorithmComparison of GPU and FPGA Hardware Acceleration of Lane Detection Algorithm
Comparison of GPU and FPGA Hardware Acceleration of Lane Detection Algorithm
 
Designing of Adders and Vedic Multiplier using Gate Diffusion Input
Designing of Adders and Vedic Multiplier using Gate Diffusion InputDesigning of Adders and Vedic Multiplier using Gate Diffusion Input
Designing of Adders and Vedic Multiplier using Gate Diffusion Input
 
sheet6.pdf
sheet6.pdfsheet6.pdf
sheet6.pdf
 
doc6.pdf
doc6.pdfdoc6.pdf
doc6.pdf
 
paper6.pdf
paper6.pdfpaper6.pdf
paper6.pdf
 
lecture5.pdf
lecture5.pdflecture5.pdf
lecture5.pdf
 
Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...
Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...
Concurrent Ternary Galois-based Computation using Nano-apex Multiplexing Nibs...
 
Griffon Topic2 Presentation (Tia)
Griffon Topic2 Presentation (Tia)Griffon Topic2 Presentation (Tia)
Griffon Topic2 Presentation (Tia)
 
Gmaps Railscamp2008
Gmaps Railscamp2008Gmaps Railscamp2008
Gmaps Railscamp2008
 
FPGA based BCH Decoder
FPGA based BCH DecoderFPGA based BCH Decoder
FPGA based BCH Decoder
 
A practical work of matlab
A practical work of matlabA practical work of matlab
A practical work of matlab
 
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
06.09.2017 Computer Science, Machine Learning & Statistiks Meetup - MULTI-GPU...
 
4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)4Developers 2018: Beyond c++17 (Mateusz Pusz)
4Developers 2018: Beyond c++17 (Mateusz Pusz)
 

More from Vissarion Fisikopoulos

"Mesh of Periodic Minimal Surfaces in CGAL."
"Mesh of Periodic Minimal Surfaces in CGAL.""Mesh of Periodic Minimal Surfaces in CGAL."
"Mesh of Periodic Minimal Surfaces in CGAL."Vissarion Fisikopoulos
 
"Regular triangularions and resultant polytopes."
"Regular triangularions and resultant polytopes." "Regular triangularions and resultant polytopes."
"Regular triangularions and resultant polytopes." Vissarion Fisikopoulos
 
"Exact and approximate algorithms for resultant polytopes."
"Exact and approximate algorithms for resultant polytopes." "Exact and approximate algorithms for resultant polytopes."
"Exact and approximate algorithms for resultant polytopes." Vissarion Fisikopoulos
 
"An output-sensitive algorithm for computing projections of resultant polytop...
"An output-sensitive algorithm for computing projections of resultant polytop..."An output-sensitive algorithm for computing projections of resultant polytop...
"An output-sensitive algorithm for computing projections of resultant polytop...Vissarion Fisikopoulos
 
"Faster Geometric Algorithms via Dynamic Determinant Computation."
"Faster Geometric Algorithms via Dynamic Determinant Computation." "Faster Geometric Algorithms via Dynamic Determinant Computation."
"Faster Geometric Algorithms via Dynamic Determinant Computation." Vissarion Fisikopoulos
 
Oracle-based algorithms for high-dimensional polytopes.
Oracle-based algorithms for high-dimensional polytopes.Oracle-based algorithms for high-dimensional polytopes.
Oracle-based algorithms for high-dimensional polytopes.Vissarion Fisikopoulos
 
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesEfficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesVissarion Fisikopoulos
 
"Combinatorics of 4-dimensional resultant polytopes"
"Combinatorics of 4-dimensional resultant polytopes""Combinatorics of 4-dimensional resultant polytopes"
"Combinatorics of 4-dimensional resultant polytopes"Vissarion Fisikopoulos
 
Efficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by OraclesEfficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by OraclesVissarion Fisikopoulos
 
High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...Vissarion Fisikopoulos
 
High-dimensional sampling and volume computation
High-dimensional sampling and volume computationHigh-dimensional sampling and volume computation
High-dimensional sampling and volume computationVissarion Fisikopoulos
 
Conctructing Polytopes via a Vertex Oracle
Conctructing Polytopes via a Vertex OracleConctructing Polytopes via a Vertex Oracle
Conctructing Polytopes via a Vertex OracleVissarion Fisikopoulos
 
High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...Vissarion Fisikopoulos
 
Polyhedral computations in computational algebraic geometry and optimization
Polyhedral computations in computational algebraic geometry and optimizationPolyhedral computations in computational algebraic geometry and optimization
Polyhedral computations in computational algebraic geometry and optimizationVissarion Fisikopoulos
 
The Newton polytope of the sparse resultant
The Newton polytope of the sparse resultantThe Newton polytope of the sparse resultant
The Newton polytope of the sparse resultantVissarion Fisikopoulos
 
Volume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensionsVolume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensionsVissarion Fisikopoulos
 
Efficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope VolumeEfficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope VolumeVissarion Fisikopoulos
 
A new practical algorithm for volume estimation using annealing of convex bodies
A new practical algorithm for volume estimation using annealing of convex bodiesA new practical algorithm for volume estimation using annealing of convex bodies
A new practical algorithm for volume estimation using annealing of convex bodiesVissarion Fisikopoulos
 

More from Vissarion Fisikopoulos (20)

"Mesh of Periodic Minimal Surfaces in CGAL."
"Mesh of Periodic Minimal Surfaces in CGAL.""Mesh of Periodic Minimal Surfaces in CGAL."
"Mesh of Periodic Minimal Surfaces in CGAL."
 
"Regular triangularions and resultant polytopes."
"Regular triangularions and resultant polytopes." "Regular triangularions and resultant polytopes."
"Regular triangularions and resultant polytopes."
 
"Exact and approximate algorithms for resultant polytopes."
"Exact and approximate algorithms for resultant polytopes." "Exact and approximate algorithms for resultant polytopes."
"Exact and approximate algorithms for resultant polytopes."
 
"An output-sensitive algorithm for computing projections of resultant polytop...
"An output-sensitive algorithm for computing projections of resultant polytop..."An output-sensitive algorithm for computing projections of resultant polytop...
"An output-sensitive algorithm for computing projections of resultant polytop...
 
"Faster Geometric Algorithms via Dynamic Determinant Computation."
"Faster Geometric Algorithms via Dynamic Determinant Computation." "Faster Geometric Algorithms via Dynamic Determinant Computation."
"Faster Geometric Algorithms via Dynamic Determinant Computation."
 
Oracle-based algorithms for high-dimensional polytopes.
Oracle-based algorithms for high-dimensional polytopes.Oracle-based algorithms for high-dimensional polytopes.
Oracle-based algorithms for high-dimensional polytopes.
 
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by OraclesEfficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
Efficient Volume and Edge-Skeleton Computation for Polytopes Given by Oracles
 
"Combinatorics of 4-dimensional resultant polytopes"
"Combinatorics of 4-dimensional resultant polytopes""Combinatorics of 4-dimensional resultant polytopes"
"Combinatorics of 4-dimensional resultant polytopes"
 
Efficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by OraclesEfficient Edge-Skeleton Computation for Polytopes Defined by Oracles
Efficient Edge-Skeleton Computation for Polytopes Defined by Oracles
 
High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...
 
High-dimensional sampling and volume computation
High-dimensional sampling and volume computationHigh-dimensional sampling and volume computation
High-dimensional sampling and volume computation
 
Conctructing Polytopes via a Vertex Oracle
Conctructing Polytopes via a Vertex OracleConctructing Polytopes via a Vertex Oracle
Conctructing Polytopes via a Vertex Oracle
 
High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...High-dimensional polytopes defined by oracles: algorithms, computations and a...
High-dimensional polytopes defined by oracles: algorithms, computations and a...
 
Enumeration of 2-level polytopes
Enumeration of 2-level polytopesEnumeration of 2-level polytopes
Enumeration of 2-level polytopes
 
Polyhedral computations in computational algebraic geometry and optimization
Polyhedral computations in computational algebraic geometry and optimizationPolyhedral computations in computational algebraic geometry and optimization
Polyhedral computations in computational algebraic geometry and optimization
 
The Newton polytope of the sparse resultant
The Newton polytope of the sparse resultantThe Newton polytope of the sparse resultant
The Newton polytope of the sparse resultant
 
Volume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensionsVolume and edge skeleton computation in high dimensions
Volume and edge skeleton computation in high dimensions
 
Efficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope VolumeEfficient Random-Walk Methods forApproximating Polytope Volume
Efficient Random-Walk Methods forApproximating Polytope Volume
 
A new practical algorithm for volume estimation using annealing of convex bodies
A new practical algorithm for volume estimation using annealing of convex bodiesA new practical algorithm for volume estimation using annealing of convex bodies
A new practical algorithm for volume estimation using annealing of convex bodies
 
Volume computation and applications
Volume computation and applications Volume computation and applications
Volume computation and applications
 

Recently uploaded

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyFrank van der Linden
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number SystemsJheuzeDellosa
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 

Recently uploaded (20)

Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Engage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The UglyEngage Usergroup 2024 - The Good The Bad_The Ugly
Engage Usergroup 2024 - The Good The Bad_The Ugly
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
What is Binary Language? Computer Number Systems
What is Binary Language?  Computer Number SystemsWhat is Binary Language?  Computer Number Systems
What is Binary Language? Computer Number Systems
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 

Working with spatial trajectories in Boost Geometry

  • 1. Spatial trajectories in Boost Geometry Vissarion Fisikopoulos FOSDEM 2020
  • 2. Boost.Geometry Part of Boost C++ Libraries Header-only C++03 (conditionally C++11, C++14) Metaprogramming, Tags dispatching Primitives, Algorithms, Spatial Index Standards: OGC SFA used by MySQL for GIS
  • 3. How to Get Started? Documentation: www.boost.org/libs/geometry Mailing list: lists.boost.org/geometry GitHub: github.com/boostorg/geometry
  • 4. Who is Boost.Geometry? Boost.Geometry is an open source project (as any other Boost library) Anybody can, and is welcome, to contribute Core development team: Barend Gehrels Bruno Lalande Mateusz Loskot Adam Wulkiewicz Menelaos Karavelas Vissarion Fysikopoulos Contributions from about a dozen of other developers See Boost.Geometry website for credits and GitHub repositorys history
  • 5. Boost.Geometry & MySQL (since 5.7) relies on Boost geometry for GIS support (geographic support since 8) no homegrown set of GIS functions for MySQL both aim in OGC standard compliance compatible licences MySQL benefit from BG open source community (maintenance, bug fixing, gsoc) BG is C++/header only → no problems with versions of a shared library on different platforms for MySQL
  • 6. Hello, world! #include <boost/geometry.hpp > #include <boost/geometry/geometries/geometries.hpp > #include <iostream > namespace bg = boost :: geometry; int main () { using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; std :: cout << bg:: distance( point(23.725750, 37.971536), //Athens , Acropolis point(4.3826169, 50.8119483)); // Brussels , ULB }
  • 7. Hello, world! #include <boost/geometry.hpp > #include <boost/geometry/geometries/geometries.hpp > #include <iostream > namespace bg = boost :: geometry; int main () { using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; std :: cout << bg:: distance( point(23.725750, 37.971536), //Athens , Acropolis point(4.3826169, 50.8119483)); // Brussels , ULB } result=2088.389 km
  • 8. Hello strategies! #include <boost/geometry.hpp > #include <boost/geometry/geometries/geometries.hpp > #include <iostream > namespace bg = boost :: geometry; int main () { using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; std :: cout << bg:: distance( point(23.725750, 37.971536), //Athens , Acropolis point(4.3826169, 50.8119483) // Brussels , ULB bg::strategy::distance::vincenty<>() ); }
  • 9. Hello strategies! #include <boost/geometry.hpp > #include <boost/geometry/geometries/geometries.hpp > #include <iostream > namespace bg = boost :: geometry; int main () { using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; std :: cout << bg:: distance( point(23.725750, 37.971536), //Athens , Acropolis point(4.3826169, 50.8119483) // Brussels , ULB bg::strategy::distance::vincenty<>() ); } result=2088389 m result with strategy=2088384 m Boost Geometry Algorithms= CS-independent part + CS-specific part (strategies)
  • 10. Models of the earth and coordinate systems Flat boost::geometry::cs::cartesian
  • 11. Models of the earth and coordinate systems Flat boost::geometry::cs::cartesian Sphere (Widely used e.g. google.maps) boost::geometry::cs::spherical equatorial<bg::degree> boost::geometry::cs::spherical equatorial<bg::radian>
  • 12. Models of the earth and coordinate systems Flat boost::geometry::cs::cartesian Sphere (Widely used e.g. google.maps) boost::geometry::cs::spherical equatorial<bg::degree> boost::geometry::cs::spherical equatorial<bg::radian> Ellipsoid of revolution (geographic GIS state-of-the-art) boost::geometry::cs::geogrphic<bg::degree> boost::geometry::cs::geogrphic<bg::radian>
  • 13. Models of the earth and coordinate systems Flat boost::geometry::cs::cartesian Sphere (Widely used e.g. google.maps) boost::geometry::cs::spherical equatorial<bg::degree> boost::geometry::cs::spherical equatorial<bg::radian> Ellipsoid of revolution (geographic GIS state-of-the-art) boost::geometry::cs::geogrphic<bg::degree> boost::geometry::cs::geogrphic<bg::radian> Geoid (Special applications, geophysics etc)
  • 14. Spatial trajectories trajectories are sequencies of time-stamped locations generated by GPS, smartphones, infrastructure, computer games, natural phenomena, etc here we study only the spatial and not the temporal information, i.e. trajectories are modelled as linestrings Trajetories of major huricanes in Atlantic [Wang et al.’17]
  • 15. Trajectories data-set GeoLife GPS Trajectories dataset [download] https://www.microsoft.com/en-us/research/wp-content/ uploads/2016/02/User20Guide-1.2.pdf
  • 17. Simple operations: size, length, distance using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; bg:: model :: linestring <point > ls1, ls2; std :: ifstream myfile1 (" Geolife_Trajectories_ 1.3/Data/000/ Trajectory/20090516091038.plt"); std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/ Trajectory/20081224011945.plt"); read_linestring (myfile1, ls1); read_linestring (myfile2, ls2); std :: cout << boost :: size(ls1) << std:: endl; std :: cout << boost :: size(ls2) << std:: endl; std :: cout << bg:: length(ls1) << std :: endl; std :: cout << bg:: length(ls2) << std :: endl; std :: cout << bg:: distance(ls1, ls2) << std :: endl; 317 75 2196.14 718.456 369.504 Note: distances in meters, result by use of non default strategies neglectable
  • 18. Closest points using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; using linestring = bg:: model :: linestring <point >; linestring ls1, ls2; std :: ifstream myfile1 (" Geolife_Trajectories_ 1.3/Data/000/ Trajectory/20090516091038.plt"); std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/ Trajectory/20081224011945.plt"); read_linestring (myfile1, ls1); read_linestring (myfile2, ls2); bg:: model :: segment <point > sout; bg:: closest_points (ls1, ls2, sout );
  • 20. Simplification of trajectories simplification using Douglas-Peucker algorithm quadratic worst case complexity [Hershberger et.al’92] line interpolate: interpolate points on linestring at a fixed distance sampling points on linestrings (https://github.com/boostorg/geometry/pull/618)
  • 21. Simplify and line interpolate using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; using linestring = bg:: model :: linestring <point >; linestring ls; std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/ Trajectory/20081224011945.plt"); read_linestring (myfile2, ls); std :: cout << "#points in ls = " << boost :: size(ls2) << std :: endl; std :: cout << "ls length (m) = " << bg:: length(ls2) << std:: endl; linestring ls_simplified ; bg:: simplify(ls2, ls_simplified , 20); std :: cout << "#points in simplified = " << boost :: size( ls_simplif using multipoint_type = bg:: model :: multi_point <point >; multipoint_type mp; bg:: line_interpolate (ls2, 70, mp); std :: cout << "#points interpolated = " << boost :: size(mp) << std:: #points in ls = 75 ls length (m) = 718.456 #points in simplified = 6 #points interpolated = 9
  • 23. Measuring similarity of trajectories Hausdorff distance H(f, g) = max a∈f { min b∈g { dist(a, b) } } Fr´echet distance F(f, g) = min { ||L|| L is a coupling between f and g } coupling is a sequence of pairs from f, g that respect the order
  • 24. Three trajectories l1: red, l2: green, l3: blue
  • 25. Hausdorff & Fr´echet distance using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; bg:: model :: linestring <point > ls1, ls2, ls3; std :: ifstream myfile1 (" Geolife_Trajectories_ 1.3/Data/000/ Trajectory/20090516091038.plt"); std :: ifstream myfile2 (" Geolife_Trajectories_ 1.3/Data/010/ Trajectory/20081224011945.plt"); std :: ifstream myfile3 (" Geolife_Trajectories_ 1.3/Data/000/ Trajectory/20081026134407.plt"); read_linestring (myfile1, ls1); read_linestring (myfile2, ls2); read_linestring (myfile3, ls3); std :: cout << bg:: discrete_hausdorff_distance (ls1, ls2) << "," << bg:: discrete_hausdorff_distance (ls2, ls3) << "," << bg:: discrete_hausdorff_distance (ls1, ls3) << std:: endl; std :: cout << bg:: discrete_frechet_distance (ls1, ls2) << "," << bg:: discrete_frechet_distance (ls2, ls3) << "," << bg:: discrete_frechet_distance (ls1, ls3) << std:: endl; 919.467, 7266.3, 8175.84 1260.76, 12601.7, 12837.9
  • 26. Hausdorff & Fr´echet distance Comparing similarity of 160 pairs of trajectories namespace bf = boost :: filesystem; using point = bg:: model :: point <double , 2, bg::cs:: geographic <bg:: degree >>; linestring = bg:: model :: linestring <point > ls1, ls2; bf:: path p{" Geolife_Trajectories_ 1.3/Data/000/Trajectory/"}; bf:: directory_iterator it1{p}; double min_frechet = 10000000; bf:: directory_iterator it2{bf:: path{" Geolife_Trajectories_ 1.3/ Data/010/Trajectory/"}}; for (; it2 != bf:: directory_iterator {}; it2++) { std :: ifstream myfile1((* it1). path (). string ()); std :: ifstream myfile2((* it2). path (). string ()); read_linestring (myfile1, ls1); read_linestring (myfile2, ls2); double frechet = bg:: discrete_frechet_distance (ls1, ls2); min_frechet = frechet < min_frechet ? frechet : min_frechet ; } cartesian: 9.97[sec] spherical: 28.47[sec] geographic: 52.30[sec]
  • 27. Most similar trajectories Same result for cartesian, spherical, geographic