Canadian Postal Codes via Bing Maps API - bing-maps

A bit of a newb here, although I have some experience with Bing Maps.
Im trying to use the Locations API to search for locations (primarily) in Canada. My data request is successful and I get back expected data...except for one thing. Canadian Postal codes are traditionally six characters long. However, the API only responds with the first three characters. I realize that only the first 3 characters are needed for geolocation but was wondering if it is possible for Bing to return the whole 6 character value.
My data request looks like this:
http://dev.virtualearth.net/REST/v1/Locations?key=[MYKEY]&q=1440+Law&ul=43.45297157764435%2C-79.70163702964783
I've trimmed some fields for relevancy.
Can Bing's Locations API return a full Canadian Postal code?

The Bing Maps Locations API is designed for geocoding and reverse-geocoding, not for address validation.
As you point out, it's generally unnecessary to consider the full postcode for geocoding - the results can be unambiguously identified using a street address and only the first 3 characters of the postcode. So, although I can't say for certain, I'd say the answer is "no".

Related

Bing maps Rest API objects not the same

I need to create an API services that calls Bing maps Rest API gets Address, Elevation and latitude and longitude values.
I see that there a Autosuggest that returns an Address object, I also see you have Find location by address api that also returns an Address object. My question is why both address object are not the same? and can it be the address adding the missing fields ?
As I need all the values from the address object from Autosuggest .I would like to call the Find location by address api and get a list of address with the latitude and longitude values as well. Currently I making 3 api calls
The autosuggest and Location APIs, do use the same Address class/object, however this is a lower-level property of the main response from each API.
The autosuggest API returns an autosuggest response that can contain a LocalBusiness, Place, or Address object. All of these have an address property that is an Address object. The __type property in these responses provide an additional insight on the type of result.
The location APIs, return a Location object that has an address property that is the same Address object used in the autosuggest API.
There are some differences in the response objects, but they all include the same Address object.
The autotsuggest responses do not include location details such as latitude/longitude as this information has a higher cost and including this information would mean this service would have to have the same cost per request as the Location API. By separating out this information, the Autosugget API only generates a 1/10th of a transaction per request (10 times cheaper than the Location API). Since in a normal autosuggest experience, a user will likely generate 5 to 10 requests to this service, when typing a single input, this makes the overall cost of this experience significantly cheaper. If each request was charged a full transaction, most companies would quickly find the cost of this experience to be extreme.
For your scenario, the expectation would be atleast 3 requests as defined below.
One or more to the autosuggest API with the users input.
One taking the formattedAddress value from the Address object in the autosuggest response and passing it into the location query API to get the latitude/longitude details.
One taking the latitude/longitude information into the elevation API. Note you can pass in multiple points into this API, and thus get the elevations for an array of address coordinates.

Mapbox simply can't find address

I already asked the same thing to Mapbox support and it's been a week and no response, so here I am.
Here at my company we are developing a system that uses a delivery service to deliver products to our customers. This delivery service uses Mapbox to get the latitude and longitude of the customer's address so they can tell the exact spot where to deliver the order to their workers.
So we started using mapbox to get these required data but we are facing a problem here.
You see, for addresses here in the city of Natal, in Brazil, everything works fine, not a problem at all. But when there's a delivery to Parnamirim, a nearby city, mapbox service simply can't find the correct address. We filled everything correctly and still the results are not the ones we asked. Can anyone help-me with that?
For example, we want to find the coordinates of the following address: "Rua dos Pinheiros, 10, Encanto Verde. Parnamirim - RN" The zip code is "59149-594".
Street name: Rua dos Pinheiros
Number: 10
Neighborhood: Encanto Verde
City: Parnamirim
State: RN (Rio Grande do Norte)
ZIP Code: 59149-594
Country: Brazil
With this data, we send you the following query: https://api.mapbox.com/geocoding/v5/mapbox.places/rua%20dos%20pinheiros%2010%20encanto%20verde%20Parnamirim%2059149-594%20BR-RN.json (I've hidden the access_token here, but it is present on the URL).
I've tried to add the country=BR&language=BR to the, but still facing the same problem.
If you search for this address on Google, it returns the correct one. But with Mapbox, it simply can't find the correct. This is happening with all addresses from Parnamirim. We don't know about other ones, but this is a big problem for us.
What can we do to fix it? Mapbox doesn't have addresses from Parnamirim in the db? Another crazy thing is that the coordinates are weird. In the first result from the above request, the coordinates takes us to the middle of the sea. Are those in the correct order?

Google nearby search with multiple keywords

Im trying to fetch both restaurants and cafes from googles Places API using the nearby search query.
Excerpt from my query string:
...&radius=2000&keyword=cafe+restaurant&key=myAPIKey
Using the plus '+' seems to bias towards one keyword type and returns a very limited quantity of places (limited versus using i.e. the restaurant and the cafe keywords on separate queries).
I've also tried using single pipe, %20, double pipe to name a few but nothing seems to work.
I've looked at this SO thread, the solution here (its 7 years old now) uses a workaround making two separate calls which I was hoping has now been resolved within the query string?
Is it possible to query nearby search for two keywords i.e. cafe and restaurant using a single query string?
No, it is not possible. You need to make multiple requests to the API for this, one with keyword=cafe or type=cafe, and the other with keyword=restaurant or type=restaurant.
You may also want to file a feature request for this in Google's Issue Tracker.
Hope this helps!

Bing Maps REST API Basic key returns different results than Enterprise key

This unstructured format
http://dev.virtualearth.net/REST/v1/Locations?addressLine=3712%20Adelaide&adminDistrict=TX&locality=The%20Colony&countryRegion=US&postalCode=75056&maxRes=1&key=YourKey
does not seem to return the same result as this structured format
http://dev.virtualearth.net/REST/v1/Locations/US/TX/75056/The%20Colony/3712%20Adelaide?o=json&key=YourKey
The structured format is returning high confidence and the unstructured format is returning medium. What am I missing?
Edit: I never would have expected this. I have discovered the unstructured format returns medium confidence with my current API key and returns high confidence with a new trial key. What does this mean?
Trying the URL's you provided I see the exact same results with the same high confidence value.
Here is the response from the Microsoft Bing Team:
Issue Definition: Question regarding Bing Maps REST Location API service. Scope Agreement: As per our communication, you provided a query for 3712 Adelaide, The Colony, TX 75056 with the Bing Maps REST Location API with a Basic and Enterprise key and received different results and you would like to know the reason. The reason you are receiving different results is because we are in the middle of deploying new information to the Bing Maps REST geocoder. This information is first flighted on Basic (free) accounts before it is released to Enterprise customers.
Our Product Group let us know that it should be deployed to all Enterprise customers by the end of this month.

Points of interest for zip code

I"m looking for way to get list of points of interests like airports, parks, etc. per zip code using Bing maps. Believe me, I search google but it looks like my google is broken since I can't find anything useful. I just need a way to get that info. If there is like a list that would be even better. Any help is appreciated fellows. Is there a simple URL where I can pass in my bing map key, a category and longitude/latitude and get a list of point of interests?
You could use the NAVTEQ point of interest data sources that are in the Bing spatial Data Services here: https://msdn.microsoft.com/en-us/library/hh478189.aspx
You can use the Query API to filter on the PostalCode property: https://msdn.microsoft.com/en-us/library/gg585126.aspx
Here is an example that gets points of interests that are in zip code 98004 and returns the results as XML:
http://spatial.virtualearth.net/REST/v1/data/f22876ec257b474b82fe2ffcb8393150/NavteqNA/NavteqPOIs?&$filter=PostalCode%20eq%20'98004'&$top=250&o=xml&key=YOUR_BING_MAPS_KEY
That said, make sure that your use case does not go against this restriction in the Bing Maps terms of use:
(h)Use Content that consists of points of interest data to generate
sales leads information in the form of ASCII or other text-formatted
lists of category-specific business listings which (i) include
complete mailing address for each business; and (ii) contain a
substantial portion of such listings for a particular country, city,
state or zip code region.