3
votes

I want to get the Zip-Code for current user location from Windows Phone 7. From GeoLocation service I am able to get latitude and longitude and with the help of Bing map API I am able to get all other information (Like City, State) except zipcode (Postal code). For United States the PostalCode field is blank. Is there any way of getting the ZipCode? My application limitations are following.

  1. We cannot use any other service than BingMap API/Web service to get the ZipCode.
  2. We only support US as location. So if the solution works only for US. It is ok.
2

2 Answers

2
votes

Here is what you need (Bing Maps REST API):

http://msdn.microsoft.com/en-us/library/ff701710.aspx

Notice that in the response (given that you built the request properly), there is a PostalCode entity.

2
votes

You cannot be guaranteed that you'll get a zip/postal code for every single latitude. Even within the US. They're not allocated that way.

You'll need to rethink/reevaluate your requirements in this area.

You also can't be guaranteed to be able to go the other way either. Not all postcodes relate to physical locations and a few even cross state boundaries.