如何在调用SearchAddressAsync(string)时保留Suite/Apt?

huangapple go评论54阅读模式
英文:

How can I preserver the Suite/Apt in a call to SearchAddressAsync(string)?

问题

如果在调用MapSearchClient.SearchAddressAsync(string)时,地址中包含套房或公寓行,会被抛弃并不会出现在结果中。

我该如何保留这部分信息以便将其包含在结果中?我认为我需要解析输入字符串,提取套房或公寓信息(如果存在),然后将其分配给生成的地址?

英文:

When calling MapSearchClient.SearchAddressAsync(string), if there is a suite or apartment line in the address, it is thrown and not returned in the results.

How can I preserve this to put it in the results? I assume I need to parse the input string, pull the suite/apt if it exists, then assign it to the generated address?

答案1

得分: 0

以下是翻译好的内容:

套房和/或公寓号码将不会被地理编码器保留。这是大多数地理编码服务的工作方式(除了有限的室内地图场景外,在我在地理空间行业工作了15年中,我从未遇到过保留这种信息的全球地理编码器)。这主要是因为地理编码器接受您的输入并返回他们系统中最可能的地址,而不是返回您的解析输入。单元/公寓/套房号通常不会在这些系统中捕获,因为全球地理编码器中的大多数地址数据仅涵盖到建筑物级别。

如果可能的话,您最好尝试自行解析,如果您知道输入地址字符串可能出现的组合方式。您可能会找到一个支持此功能的开源地址解析库。以下是我找到的几个看起来支持此功能的库:

https://github.com/SwoopSearch/pyaddress

https://github.com/datamade/usaddress - 更多信息请参阅 https://github.com/datamade/usaddress/issues/159

英文:

Suite and/or apartment numbers will never be retained by the geocoder. This how most geocoding service work (Other than limited indoor map scenarios, I've never come across a global geocoder that retains this in the 15 years I've been in the geospatial industry). This is primarily since geocoders take your input and return the most likely address that they have in their system, they don't return your parsed input. Unit/apartment/suite numbers are generally not captured in these systems since most address data in global geocoders only go down to building level.

At best you could possibly try and parse it out yourself if you know the possible combinations of how it might appear in the input address string. You may be able to find an open-source address parsing library that supports this. Here are a few I found that look to support this:

https://github.com/SwoopSearch/pyaddress

https://github.com/datamade/usaddress - More info here https://github.com/datamade/usaddress/issues/159

huangapple
  • 本文由 发表于 2023年6月26日 19:37:56
  • 转载请务必保留本文链接:https://go.coder-hub.com/76556320.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定