Both two polylines contains a set of geo positions(like 38.663610000000006,-121.29237), the total number of position for each polylines are different.
How to calculate the similarity(0%-99%) of two polylines in Python?
Both two polylines contains a set of geo positions(like 38.663610000000006,-121.29237), the total number of position for each polylines are different.
How to calculate the similarity(0%-99%) of two polylines in Python?
Copyright © 2021 Jogjafile Inc.
To calculate the similiary between two lines you can try to use the Fréchet distance.
The
shapelylibrary provides thefrechet_distancefunction and its documentation reports the following example:As you can see the lines are defined by a different number of points. Then, if you need a percentage you can simply normalize the distance value using a reference distance relevant for this problem.