This API offers access to different route similarity measures.
It supports both GET and POST request types.
The response contains at least the similarity value and the computation time (in milliseconds). Additional values will be available, depending on the selected similarity measure.
Instructions:
Address: http://cs.uef.fi/mopsi/routes/similarityApi
Parameters: param containing a JSON description of the request.
JSON attributes:
- measure: {
C-SIM,
HC-SIM,
LCSS,
EDR,
DTW,
FastDTW,
ERP,
Euclidean,
Hausdorff,
Frechet
}
- A: JSON array of geographic Points representing the first route. For example:
[{"lat":62.60,"lng":29.76},{"lat":62.60,"lng":29.77}]
- B: JSON array representing the second route. For example:
[{"lat":62.61,"lng":29.76},{"lat":62.61,"lng":29.75}]
- threshold: A distance (in meters) used only by: C-SIM, HC-SIM, LCSS and EDR. It is the cell length for C-SIM, minimum cell length for HC-SIM, and the ε threshold for the other two measures.
Example calls: (using GET)
1. C-SIM with cell length - 25 meters:
http://cs.uef.fi/mopsi/routes/similarityApi?param={"measure":"C-SIM",
"threshold":25,"A":[{"lat":62.6067,"lng":29.76060},{"lat":62.6057,"lng":29.76060},{"lat":62.6057,"lng":29.76160}],"B":[{"lat":62.6067,"lng":29.76060},{"lat":62.6057,
"lng":29.76060},{"lat":62.6057,"lng":29.75960}]}
2. EDR with ε - 30 meters:
http://cs.uef.fi/mopsi/routes/similarityApi?param={"measure":"EDR",
"threshold":30,"A":[{"lat":62.6067,"lng":29.76060},{"lat":62.6057,"lng":29.76060},{"lat":62.6057,"lng":29.76160}],"B":[{"lat":62.6067,"lng":29.76060},{"lat":62.6057,
"lng":29.76060},{"lat":62.6057,"lng":29.75960}]}
3. Frechet distance
http://cs.uef.fi/mopsi/routes/similarityApi?param={"measure":"Frechet",
"A":[{"lat":62.6067,"lng":29.76060},{"lat":62.6057,"lng":29.76060},{"lat":62.6057,"lng":29.76160}],"B":[{"lat":62.6067,"lng":29.76060},{"lat":62.6057,
"lng":29.76060},{"lat":62.6057,"lng":29.75960}]}