SlideShare a Scribd company logo
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 Graphs
Nicolas Kourtellis
 
Dataflow Analysis
Dataflow AnalysisDataflow Analysis
Dataflow Analysis
Eelco Visser
 
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
Fayan TAO
 
Plotting position and velocity
Plotting position and velocityPlotting position and velocity
Plotting position and velocity
abidraza88
 
Geopy module in python
Geopy module in pythonGeopy module in python
Geopy module in python
Ashmita 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 slab
Alexander 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 17
Amit Kumar Jha
 
W+charm poster
W+charm posterW+charm poster
W+charm poster
Giacomo Snidero
 
359 me-2009-gate-question-paper
359 me-2009-gate-question-paper359 me-2009-gate-question-paper
359 me-2009-gate-question-paper
drmbalu
 
SBMF
SBMFSBMF
Computer Vision Pertemuan 05
Computer  Vision Pertemuan 05Computer  Vision Pertemuan 05
Computer Vision Pertemuan 05
soe sumijan
 
Pixel rf
Pixel rfPixel rf
Pixel rf
Medical UNSA
 
Hardcore functional programming
Hardcore functional programmingHardcore functional programming
Hardcore functional programming
Leonardo Andres Garcia Crespo
 
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_1
Chris Hill
 
Geolocation on Rails
Geolocation on RailsGeolocation on Rails
Geolocation on Rails
nebirhos
 
C++ 11 Features
C++ 11 FeaturesC++ 11 Features
C++ 11 Features
Jan Rüegg
 
50120130406025 2
50120130406025 250120130406025 2
50120130406025 2
IAEME Publication
 
Opensource gis development - part 2
Opensource gis development - part 2Opensource gis development - part 2
Opensource gis development - part 2
Andrea Antonello
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Md 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 ALGORITHM
sipij
 
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
sipij
 
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
IRJET Journal
 
sheet6.pdf
sheet6.pdfsheet6.pdf
sheet6.pdf
aminasouyah
 
doc6.pdf
doc6.pdfdoc6.pdf
doc6.pdf
aminasouyah
 
paper6.pdf
paper6.pdfpaper6.pdf
paper6.pdf
aminasouyah
 
lecture5.pdf
lecture5.pdflecture5.pdf
lecture5.pdf
aminasouyah
 
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 Railscamp2008
xilinus
 
FPGA based BCH Decoder
FPGA based BCH DecoderFPGA based BCH Decoder
FPGA based BCH Decoder
ijsrd.com
 
A practical work of matlab
A practical work of matlabA practical work of matlab
A practical work of matlab
SalanSD
 
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 Oracles
Vissarion 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 Oracles
Vissarion 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 computation
Vissarion Fisikopoulos
 
Conctructing Polytopes via a Vertex Oracle
Conctructing Polytopes via a Vertex OracleConctructing Polytopes via a Vertex Oracle
Conctructing Polytopes via a Vertex Oracle
Vissarion 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
 
Enumeration of 2-level polytopes
Enumeration of 2-level polytopesEnumeration of 2-level polytopes
Enumeration of 2-level polytopes
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 optimization
Vissarion 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 resultant
Vissarion 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 dimensions
Vissarion 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 Volume
Vissarion 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 bodies
Vissarion Fisikopoulos
 
Volume computation and applications
Volume computation and applications Volume computation and applications
Volume computation and applications
Vissarion 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

How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
Rakesh Kumar R
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
timtebeek1
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
kalichargn70th171
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
aymanquadri279
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
Sven Peters
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
Green Software Development
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
Shane Coughlan
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
lorraineandreiamcidl
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
Ayan Halder
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
mz5nrf0n
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
Patrick Weigel
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
ICS
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
Remote DBA Services
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
ToXSL Technologies
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
Grant Fritchey
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
Rakesh Kumar R
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Envertis Software Solutions
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
Philip Schwarz
 

Recently uploaded (20)

How to write a program in any programming language
How to write a program in any programming languageHow to write a program in any programming language
How to write a program in any programming language
 
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdfAutomated software refactoring with OpenRewrite and Generative AI.pptx.pdf
Automated software refactoring with OpenRewrite and Generative AI.pptx.pdf
 
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf8 Best Automated Android App Testing Tool and Framework in 2024.pdf
8 Best Automated Android App Testing Tool and Framework in 2024.pdf
 
What is Master Data Management by PiLog Group
What is Master Data Management by PiLog GroupWhat is Master Data Management by PiLog Group
What is Master Data Management by PiLog Group
 
Microservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we workMicroservice Teams - How the cloud changes the way we work
Microservice Teams - How the cloud changes the way we work
 
Energy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina JonuziEnergy consumption of Database Management - Florina Jonuzi
Energy consumption of Database Management - Florina Jonuzi
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
openEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain SecurityopenEuler Case Study - The Journey to Supply Chain Security
openEuler Case Study - The Journey to Supply Chain Security
 
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOMLORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
LORRAINE ANDREI_LEQUIGAN_HOW TO USE ZOOM
 
Using Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional SafetyUsing Xen Hypervisor for Functional Safety
Using Xen Hypervisor for Functional Safety
 
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
原版定制美国纽约州立大学奥尔巴尼分校毕业证学位证书原版一模一样
 
WWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders AustinWWDC 2024 Keynote Review: For CocoaCoders Austin
WWDC 2024 Keynote Review: For CocoaCoders Austin
 
Webinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for EmbeddedWebinar On-Demand: Using Flutter for Embedded
Webinar On-Demand: Using Flutter for Embedded
 
Oracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptxOracle Database 19c New Features for DBAs and Developers.pptx
Oracle Database 19c New Features for DBAs and Developers.pptx
 
How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?How Can Hiring A Mobile App Development Company Help Your Business Grow?
How Can Hiring A Mobile App Development Company Help Your Business Grow?
 
Using Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query PerformanceUsing Query Store in Azure PostgreSQL to Understand Query Performance
Using Query Store in Azure PostgreSQL to Understand Query Performance
 
Fundamentals of Programming and Language Processors
Fundamentals of Programming and Language ProcessorsFundamentals of Programming and Language Processors
Fundamentals of Programming and Language Processors
 
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative AnalysisOdoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
Odoo ERP Vs. Traditional ERP Systems – A Comparative Analysis
 
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit ParisNeo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
Neo4j - Product Vision and Knowledge Graphs - GraphSummit Paris
 
Hand Rolled Applicative User Validation Code Kata
Hand Rolled Applicative User ValidationCode KataHand Rolled Applicative User ValidationCode Kata
Hand Rolled Applicative User Validation Code Kata
 

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