Google 距离矩阵 API 替换甚至不接近的地址

Google Distance Matrix API substituting address that isn't even close

当我搜索“160 Trek Ln, Redding, CA 96003”时,距离矩阵将我的搜索更改为 'Bechelli Ln at Hartnell Ave, Redding, CA 96002, USA'。我知道 Google 地图中尚不存在“160 Trek Ln, Redding, CA 96003”,但将地址更改为完全不同的地址绝对不是我想要的。出现某种错误 'Address not found' 之类的会更好。

如有任何帮助,我们将不胜感激。

"Internally Distance Matrix uses Geocoding to resolve the address to coordinate. It will try to get best match even for non-existing address, in your case it gives partial match. I believe there is no way to change this behavior of service. If you know exact coordinate of your address use it instead of address string. In this case Distance Matrix will snap to nearest road directly without geocoding step and you may get better results." – xomena 8 月 29 日 20:48