b-r-u / osmpbf

A Rust library for reading the OpenStreetMap PBF file format (*.osm.pbf).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Distance between two points

andrewgy8 opened this issue · comments

Hey! Not sure this is the right place for this, but Ill ask anyway. Im trying to get the distance between two sets of lat/lon on a map. Would this be the right lib to get this done? Is it in the scope of this project?
Thanks!

Hi! I think that distance calculations are not in scope for this library because there are just so many ways to do it. But you could combine this library with your own implementation of the haversine formula :)

Thanks! Thats what I was afraid of. Ill continue digging into how to find driving distance between two points. But first Ill start small with haversine. I appreciate the help. Cheers!

If you want to calculate the driving distance, you could build a graph of streets using this function by filtering ways with the highway tag.