简体   繁体   English

Mappoint-将邮政编码优先于FindAddressResults()中的街道名称

[英]Mappoint - prioritise post code over street name in FindAddressResults()

We operate a route optimisation service, these routes typically involve 100+ deliveries in a small local area several times a day, lots of the deliveries may exist in the same postcode. 我们运营路线优化服务,这些路线通常每天在小区域中多次执行100多次交货,许多交货可能都存在于同一邮政编码中。

As such, when we use MapPoint to add waypoints and optimise the run on postcode & streetname / house number. 因此,当我们使用MapPoint添加航点并优化邮政编码和街道名/门牌号的运行时。

Problem is, if you call MapPoints FindAddressResults() function with a bad streetname but valid postcode, it ignores the postcode and tries finding the streetname elsewhere, often in a random town hundreds of miles away. 问题是,如果您使用错误的街道名称但有效的邮政编码调用MapPoints FindAddressResults()函数,则它将忽略该邮政编码,并尝试在其他地方(通常在数百英里之外的随机城镇)中找到街道名称。

Now, whilst we can ask the shops to improve the quality of their data - this will never be done reliably. 现在,尽管我们可以要求商店改善其数据质量,但这将永远无法可靠地完成。

My question: when calling FindAddressResults() , is there any way to make it prioritise the postcode over the streetname as opposed to it's default behaviour which prioritises the streetname over the postcode? 我的问题:调用FindAddressResults() ,是否有任何方法可以使邮政编码优先于街道名,而不是默认行为将街道名优先于邮政编码?

Example usage (This is written in VB6 (dont ask) - but any example / info would help): 用法示例(这是用VB6编写的(不要问)-但任何示例/信息都会有所帮助):

'#### GeoCode using postcode & streetname
Set oResults = oMap.FindAddressResults(rsRequest("Request_Address"), , , , rsRequest("Request_Postalcode"))
If oResults.Count = 0 Then
    '#### Nothing was found, GeoCode using postcode only
    Set oResults = oMap.FindAddressResults(, , , , rsRequest("Request_Postalcode"))
End If

The only thing i can think off is setting a "Max Distance" var, if the 1st (best match) item in oResults[] is over that threshold, default to a postcode only search - but that would be a botch at best. 我唯一能想到的就是设置一个“最大距离”变量,如果oResults []中的第一个(最佳匹配)项超过了该阈值,则默认为仅搜索邮政编码-但这充其量是不明智的。

EDIT 1 - Just came up with this, seems to work OK: 编辑1-刚想出这个,似乎工作正常:

Set oResults = oMap.FindAddressResults(rsRequest("Request_Address"), , , , rsRequest("Request_Postalcode"))
If oResults.ResultsQuality <> geoFirstResultGood Then
    echo (rsRequest("Request_Address") & " + " & rsRequest("Request_Postalcode") & " had poor results (" & CStr(oResults.ResultsQuality) & "), using postcode only instead...")
    Set oResults = oMap.FindAddressResults(, , , , rsRequest("Request_Postalcode"))
End If

Yes you have come up with the result I would have suggested: 是的,您提出了我建议的结果:

  1. Perform query with street address 用街道地址执行查询
  2. Check the ResultsQuality if it is ambiguous / bad, then... 检查结果质量是否模糊/不好,然后...
  3. ...perform the second query with just the postcode ...仅用邮政编码执行第二个查询

Another way to improve FindAddressResults quality with British addresses, is to try a few different calls to FindAddressResults until you find one that gives a "Good" quality result. 使用英国地址提高FindAddressResults质量的另一种方法是,尝试几次不同的对FindAddressResults的调用,直到找到一个给出“良好”质量结果的调用。 Each call would have a slightly different variation in the parameters. 每个调用的参数会有稍微不同的变化。 British addresses are pretty felxible, for example the house name might be line 1 (making line 2 the street); 英国的地址很容易理解,例如房屋名称可能是1号线(使2号线成为街道); and there might be more than one place ("cities" in US parlance) - eg. 并且可能有多个地方(以美国的说法是“城市”),例如 a village and a city/town. 一个村庄和一个城市/城镇。 in the address. 在地址中。

Run some test data through, first; 首先运行一些测试数据; and find the combinations that perform best. 并找到效果最佳的组合。 Then your call sequence would start with the best combination, second best, etc. until a 'good' result is found. 然后,您的通话顺序将以最佳组合,次佳组合等开始,直到找到“好”结果。 Finally if there are no results, you can try your Postcode-only call, as above. 最后,如果没有结果,您可以尝试如上所述的仅限邮编的呼叫。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM