google API (Geocoding) request returns wrong language - php

related to the doc https://developers.google.com/maps/documentation/geocoding/intro i am using this api request to figure out the full address data (especially lat/lon)
https://maps.googleapis.com/maps/api/geocode/xml?address=30449+hannover&sensor=false&language=en&key=YOURAPIKEY
the language parameter is the important part. its EN for english.
lets now face the result: "Niedersachsen" this part is german.
okay.. what a pitty.. i thought that google possibly doesnt know the english name of it so it returns the default german name since my request is about a german town but then i changed the api request a little bit and removed the ZIP (30449) of the address.
https://maps.googleapis.com/maps/api/geocode/xml?address=hannover&sensor=false&language=en&key=YOURAPIKEY
now my result was CORRECT: "Lower Saxony" in english.
so obviously google knows the name.
am I doing something wrong? do you have any ideas? i cant get this issue sorted...
please advise.
thanks!
p.s. its a little related to this I think: Google Geocoding API returns wrong language in response but not completely... I have also already opened a bug report on google side just in case...

I'm having Geocoding issues as well, ever since the new "pay-as-you-go" API nonsense. Installed new API key after activiating a new CC attached accnt with Google dev. Fixed things for a moment, but seems like cache issues are keeping the geocoding, as well as front side UX with the map embed itself (markers don't show, limited/no functionality). Wish I had an answer for you, but for now, just commiserating...

Related

Get Google Streetview heading by PHP

Good day, I am trying to setup a Streetview Static API in PHP.
I got as far that I got the address to coords by GeoCode.
I got the image of the address to show.
The last part however is still puzzling me. Thats the heading.
https://maps.googleapis.com/maps/api/streetview?size=800x800&location=%2052.525113,%205.487970&fov=90&heading=0&pitch=0&key=*GOOGLE_API_KEY*
I can find a lot of explanations about obtaining the heading by Javascript. But none in the form of a PHP solution.
It almost feels like it is impossible.
But if there'd only be a way to calculate the exact heading : &heading=0 of the building it would be solved. But are there any specific google API calls required?
Thanks in advance!

Facebook Graph Api: How to disable transliteration from Cyrillic to Latin when querying FB Graph API

When searching with Facebook Graph API for posts containing a phrase in Cyrillic, it returns results containing the transliterated string.
For example when trying to get results for "стол":
https://graph.facebook.com/search?q=стол&type=post&...
I'm getting results for the transliterated string "stol".
Been there done that:
An old solution was to use the locale parameter. As it seems it is not working anymore in this kind of searches "by design".
Another proposed solution was to send Accept-Language headers with the query, but doesn't work either.
A workaround is to do an additional filtering after receiving the results, but it just doesn't seem to be a good practice.
So ... does anyone knows how to make Facebook Graph API search for exact phrase in given language without transliterating it?
Thanks!

Autocompleteplus how to detect user language(Real language not browser)?

I'm looking for a way to get a user default language by the country. For example I have windows in english but still I would like to get my country 2 letter language ("cs")
You can see an example of what I want, In the source code of http://search.conduit.com/ using (Autocompleteplus) as well. This is what I see:
window.language = "en-us";
window.countryCode = "cz";
window.suggestBaseUrl = "http://api.autocompleteplus.com/?q=UCM_SEARCH_TERM&l=cs&c=cz&callback=acp_new";
You can see the api url has inside "l=cs&c=cz" how did they get this information? I would like to have the same thing I use the same autocompleteplus method just need a way to generate the l=(user true langague)&c=(country code) and performance is important as well. It's autosuggestions for my website search.
This is Ed from AutoComplete+. Getting the user country is typically done when using our API through server side implementations. There are however some open APIs that can assist you. Regardless, you can use our autocomplete feed without the user country. Feel free to contact us directly for further info at http://www.autocompleteplus.com
Thanks,
--ed

Getting information from Gmaps like grassland, street, water etc

I'm thinking about a project, where I need such informations as described in the title. Does the Google Maps API provide something like this, or does anyone know how to get these informations?
Project will be done in PHP, HTML and Javascript.
AFAIK Google doesn't provide this information via the API. The only thing I can think of is getting the image, and then detecting the colour. A map of colour hex values against point type might give you what you need.
However, this may well break the Terms and Conditions, depending on what you're doing.

is it possible to find geolocation using zipcode using PHP

Is it possible to find geolocation using zip code using PHP.
For example, if i am entering the zip code i need to find the name of that particular zipcode.
Is that possible? if yes kindly explain me how?
Thanks in advance
See the duplicate question on how to turn an address into coordinates using the Google Geocoding service.
A query in the format [zipcode], United States, e.g..
72116, United States
should always work for you.
Try maps.google.com to simulate the request.
The XML returned from the Google Service will contain the official place name, as well as other information like county and state names etc.
You can do this through Javascript and PHP using Google's Map API - check this question for an example of how this is used.
I dont think it can be done solely through PHP however because you'd need to access an API's data and they normally (not always) do this through javascript.
You should check the API documentation.
You can access the Geocoding API solely using PHP.. you don't even need an API Key anymore.
http://code.google.com/apis/maps/articles/phpsqlgeocode.html
So if understand this correctly, you want to know the City/State of the zip code you have entered?
Maybe you should look into the Access database here :
http://databases.about.com/od/access/a/zipcodedatabase.htm
And if you find it useful, just convert it into a MySQL table and use as you please.

Categories