如何验证2个加拿大邮政编码之间的距离

How to verify the distance between 2 canadian zip code

我想知道在加拿大获取 2(邮政编码)或 postal 代码之间距离的最佳方法是什么。我已经看到 post 关于 MySQL 使用美国邮政编码这样做。

或者我想我可以将邮政编码转换为坐标,然后对距离进行三角测量?如果有人可以分享这方面的技巧,我将不胜感激!

我正在使用 Angular JS 和 Node JS,但我也可以使用 PHP。

Api 应该是免费的并且能够处理大量查询。

谢谢

Google 地图 API 可以通过在距离矩阵 API 上设置 origindestination 来做到这一点。

https://maps.googleapis.com/maps/api/distancematrix/json?units=imperial&origins=M4C4Y7&destinations=H1A0A2