地理编码 API 不可靠
Geocoding API is not reliable
我在 bing 地图地理编码 API 方面遇到问题。 API 不可靠。同样的查询不会总是return相同的结果。
这个查询
http://dev.virtualearth.net/REST/v1/Locations/?key=myKey&o=xml&countryRegion=CA&postalCode=g0a4b0
将return没有地址
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">
<Copyright>
Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
</Copyright>
<BrandLogoUri>
http://dev.virtualearth.net/Branding/logo_powered_by.png
</BrandLogoUri>
<StatusCode>200</StatusCode>
<StatusDescription>OK</StatusDescription>
<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
<ResourceSets>
<ResourceSet>
<EstimatedTotal>0</EstimatedTotal>
<Resources/>
</ResourceSet>
</ResourceSets>
</Response>
或地址
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">
<Copyright>
Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
</Copyright>
<BrandLogoUri>
http://dev.virtualearth.net/Branding/logo_powered_by.png
</BrandLogoUri>
<StatusCode>200</StatusCode>
<StatusDescription>OK</StatusDescription>
<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
<ResourceSets>
<ResourceSet>
<EstimatedTotal>1</EstimatedTotal>
<Resources>
<Location>
<Name>G0A 4B0, QC</Name>
<Point>
<Latitude>46.679374694824219</Latitude>
<Longitude>-72.049674987792969</Longitude>
</Point>
<BoundingBox>
<SouthLatitude>46.675511977253542</SouthLatitude>
<WestLongitude>-72.0571812840852</WestLongitude>
<NorthLatitude>46.683237412394895</NorthLatitude>
<EastLongitude>-72.042168691500734</EastLongitude>
</BoundingBox>
<EntityType>Postcode1</EntityType>
<Address>
<AdminDistrict>QC</AdminDistrict>
<AdminDistrict2>Portneuf</AdminDistrict2>
<CountryRegion>Canada</CountryRegion>
<FormattedAddress>G0A 4B0, QC</FormattedAddress>
<Locality>Saint-Marc-des-Carrières</Locality>
<PostalCode>G0A 4B0</PostalCode>
</Address>
<Confidence>High</Confidence>
<MatchCode>Good</MatchCode>
<GeocodePoint>
<Latitude>46.679374694824219</Latitude>
<Longitude>-72.049674987792969</Longitude>
<CalculationMethod>Rooftop</CalculationMethod>
<UsageType>Display</UsageType>
</GeocodePoint>
</Location>
</Resources>
</ResourceSet>
</ResourceSets>
</Response>
有没有办法让 Bing 地理编码 API 更可靠?
是否因为我使用了基本密钥,他们因为服务器过载而拒绝了我的查询?
谢谢
您的陈述不正确,因为您似乎没有遵守您在创建基本密钥时同意的使用条款。
这些类型的密钥在给定时间段内的请求数量受到限制,这是 MSDN 上的一篇精确文章,详细解释了这些限制:
https://msdn.microsoft.com/en-us/library/dn894107.aspx
另一个关于状态和代码:
https://msdn.microsoft.com/en-us/library/ff701703.aspx
速率限制和信息
这里是进一步管理错误的有趣部分:
Rate Limiting
In the Bing Maps terms of use trial and basic keys are
limited in the number of transactions they can generate within a
period of time. Windows Store, Windows Phone, and WPF apps have a
limit of 50,000 transactions in a 24 hour period. Public facing web
sites and non-Windows mobile apps have a limit of 125,000 transactions
a year. Rate limiting occurs when the frequency of requests made
against the Bing Maps REST and/or SOAP services by an account exceeds
these free terms of use. Rate limiting can also occur when the
services are under a lot of load. This is done to ensure that the
usage from trial and basic keys do no interrupt the services for those
using an Enterprise keys. Enterprise keys are not rate limited and the
only way to get around rate limiting is to upgrade to an Enterprise
key. For more information contact see our Bing Maps Licensing Options
page.
When a request is rate limited, the response will return no
results. This may be confusing at first as it looks like Bing Maps was
unable to find results. To indicate that the request was rate limited
a flag is added to the header of the response (X-MS-BM-WS-INFO) which
is set to the value of 1 as documented the Status Codes and Error
Handling page. To make for a better user experience, applications that
use trial or basic keys should look for this flag in the header and
handle requests which are rate limited. Something as simple as logging
the fact that a request was rate limited in your application log could
help when debugging reported issues.
还有许多其他地理编码提供商。如果您的应用程序必须能够依赖于快速、可扩展且可靠的地理编码提供商,您最终可能会为高级服务付费。
GeoCoding providers for non-map use
我在 bing 地图地理编码 API 方面遇到问题。 API 不可靠。同样的查询不会总是return相同的结果。
这个查询 http://dev.virtualearth.net/REST/v1/Locations/?key=myKey&o=xml&countryRegion=CA&postalCode=g0a4b0
将return没有地址
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">
<Copyright>
Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
</Copyright>
<BrandLogoUri>
http://dev.virtualearth.net/Branding/logo_powered_by.png
</BrandLogoUri>
<StatusCode>200</StatusCode>
<StatusDescription>OK</StatusDescription>
<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
<ResourceSets>
<ResourceSet>
<EstimatedTotal>0</EstimatedTotal>
<Resources/>
</ResourceSet>
</ResourceSets>
</Response>
或地址
<Response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/search/local/ws/rest/v1">
<Copyright>
Copyright © 2015 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.
</Copyright>
<BrandLogoUri>
http://dev.virtualearth.net/Branding/logo_powered_by.png
</BrandLogoUri>
<StatusCode>200</StatusCode>
<StatusDescription>OK</StatusDescription>
<AuthenticationResultCode>ValidCredentials</AuthenticationResultCode>
<ResourceSets>
<ResourceSet>
<EstimatedTotal>1</EstimatedTotal>
<Resources>
<Location>
<Name>G0A 4B0, QC</Name>
<Point>
<Latitude>46.679374694824219</Latitude>
<Longitude>-72.049674987792969</Longitude>
</Point>
<BoundingBox>
<SouthLatitude>46.675511977253542</SouthLatitude>
<WestLongitude>-72.0571812840852</WestLongitude>
<NorthLatitude>46.683237412394895</NorthLatitude>
<EastLongitude>-72.042168691500734</EastLongitude>
</BoundingBox>
<EntityType>Postcode1</EntityType>
<Address>
<AdminDistrict>QC</AdminDistrict>
<AdminDistrict2>Portneuf</AdminDistrict2>
<CountryRegion>Canada</CountryRegion>
<FormattedAddress>G0A 4B0, QC</FormattedAddress>
<Locality>Saint-Marc-des-Carrières</Locality>
<PostalCode>G0A 4B0</PostalCode>
</Address>
<Confidence>High</Confidence>
<MatchCode>Good</MatchCode>
<GeocodePoint>
<Latitude>46.679374694824219</Latitude>
<Longitude>-72.049674987792969</Longitude>
<CalculationMethod>Rooftop</CalculationMethod>
<UsageType>Display</UsageType>
</GeocodePoint>
</Location>
</Resources>
</ResourceSet>
</ResourceSets>
</Response>
有没有办法让 Bing 地理编码 API 更可靠?
是否因为我使用了基本密钥,他们因为服务器过载而拒绝了我的查询?
谢谢
您的陈述不正确,因为您似乎没有遵守您在创建基本密钥时同意的使用条款。
这些类型的密钥在给定时间段内的请求数量受到限制,这是 MSDN 上的一篇精确文章,详细解释了这些限制:
https://msdn.microsoft.com/en-us/library/dn894107.aspx
另一个关于状态和代码:
https://msdn.microsoft.com/en-us/library/ff701703.aspx
速率限制和信息
这里是进一步管理错误的有趣部分:
Rate Limiting
In the Bing Maps terms of use trial and basic keys are limited in the number of transactions they can generate within a period of time. Windows Store, Windows Phone, and WPF apps have a limit of 50,000 transactions in a 24 hour period. Public facing web sites and non-Windows mobile apps have a limit of 125,000 transactions a year. Rate limiting occurs when the frequency of requests made against the Bing Maps REST and/or SOAP services by an account exceeds these free terms of use. Rate limiting can also occur when the services are under a lot of load. This is done to ensure that the usage from trial and basic keys do no interrupt the services for those using an Enterprise keys. Enterprise keys are not rate limited and the only way to get around rate limiting is to upgrade to an Enterprise key. For more information contact see our Bing Maps Licensing Options page.
When a request is rate limited, the response will return no results. This may be confusing at first as it looks like Bing Maps was unable to find results. To indicate that the request was rate limited a flag is added to the header of the response (X-MS-BM-WS-INFO) which is set to the value of 1 as documented the Status Codes and Error Handling page. To make for a better user experience, applications that use trial or basic keys should look for this flag in the header and handle requests which are rate limited. Something as simple as logging the fact that a request was rate limited in your application log could help when debugging reported issues.
还有许多其他地理编码提供商。如果您的应用程序必须能够依赖于快速、可扩展且可靠的地理编码提供商,您最终可能会为高级服务付费。
GeoCoding providers for non-map use