Google places api not showing results for some places - google-maps-api-3

Hello i am using simple google map places api to get near by atms for users. My client lives around new york and for some strange reason api shows zero results for that place, but works fine near me (pakistan) . I searched for it a little and found out it was google's issue and some other places were also experiencing the same problem. But i never quite found any solution for this.
This is the get call i use
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.7128,74.1059&radius=10000000&keyword=atm&key=MY_KEY
I would really appreciate the help. Thank you :)

Google place nearby search maximum 50,000 meters (31 miles) . if you try enter more than 50,000 it not work proper.
There is another way for find all ATM in a city. google provide Text Search Requests
https://maps.googleapis.com/maps/api/place/textsearch/json?query=atm+in+Reno,NV,89501,USA&key={API_KEY}
query = keyword + in + city Name
for get city name using latitude longitude
http://maps.googleapis.com/maps/api/geocode/json?latlng=39.52963,-119.81380&sensor=true
For more information how to get city name using latitude longitude
https://developers.google.com/maps/documentation/geocoding/start?csw=1#ReverseGeocoding
for more information about how to use Text Search Requests
https://developers.google.com/places/web-service/search
OR (second way)
There is another way for find all ATM in a city.
Open Google Maps .
create 10-12 or more points latitude , longitude value to trigger
request.
Then use a loop to find all places within these points.
If you want more appropriate results, increase first trigger points
for your requests.
- It is just a logic i created in php.
$triggerPoints = array("lat1,long1", "lat2,long2", "lat3,long3",....);
foreeach(triggerPoints as $tP){
$requestUrl = "https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=$tP&radius=[YOUR_RADIUS_VALUE]&type=[YOUR_TYPE]&name=panera&key=[YOUR_KEY_HERE";
$results = file_get_contents($requestUrl);
//Do what you want with response JSON data
}

SHORT ANSWER: Use logical types with your needs.
In my case i used food types instead of supermarket. In some cases, my local market named A101 wasnt found under supermarkets. To find which keywords is best for you, you can search below url with your location and map_key and find most common keywords under types for each query and use it.
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=40.986527896166244,%2029.24326049097467&rankby=distance&keyword=a101&key=YOUR_MAP_KEY

Related

Incorrect work of autocomplete with Cyrillic

When sending a request to https://autocomplete.geocode.ls.hereapi.com/6.2/suggest.json?query=Вильнюс with an indication of cyrillic nothing comes and with a latin https: //autocomplete.geocode.ls.heraapi.com/6.2/suggest.json?query=Viln all is well. Tell me what the problem is or what I'm doing wrong?
You're not doing anything wrong. Autocomplete is designed to give you addresses that contain (perfectly match) your input string, and the results are sorted by relevance.
When you make your query in russian and provide only "Вильнюс" as input, the service is finding a lot of results (street names) that it considers are more relevant than the city. The city name is also found, but since the service doesn't think that this is what you're searching for, it puts the city much lower in the results list. You don't see it because you're limiting your query to give you only the first 10 matches (with the maxresults=10 parameter), but if you change the maxresults parameter to 20, for example, you will see that Vilnius appears in the 16th place of the API response.
If you want the service to better understand what is the thing you're querying for, you'll need to provide additional information. For example, if you continue typing and your input string is now "Вильнюс " (with a space at the end) or "Вильнюс Л" (a space and another letter), the service will understand what you mean and will return the result you want.
Another way of providing more information to change the way the service ranks the results is by adding a spatial filter, like the country, mapview, or prox parameters mentioned in the API Reference section of the documentation. Alternatively, the resultType parameter can help you filter out all the results with street names and return only city names, if that's what you want. These are just some options available, the one that is right for you will depend on your use case.

Grafana maps with rockset and dynamodb

Hy all, i am using grafana with rockset to collect real time series form our dynamodb database, but we have the next problem in the plugin maps.
My data with the next query:
select country,real,_event_time from commons.Players
is
'US' '0.5' '2020-05-27T08:40:51.548000Z',
'UK' '0.2' '2020-05-27T08:40:50.548000Z'
I read that i must pase the country code in the group by:
select
country,sum(real) as total ,_event_time
from commons.Players
group by _event_time,country
but this doesn't work, I select the correct type of location data (countries) but impossible to see anything.
I don't have problem with any kind of graph but in the map is impossible to my to see the information. I have read documentation and really I don't understand the query that i must use in this part to see the data.
Thanks for everything.
You didn't post your panel configuration so it is blind guess. Use query:
SELECT
_event_time AS "time",
country AS "code",
real
FROM commons.Players
and configure Map Data Options->Location Data: countries to "translate" 2 letter country code to map coordinates.

What's the meaning of "ceid" in Google News url

I am recently working on web scraping of Google News and dealing with the URL format. I have same question of this post about the meaning of ceid.
For example the link from the post: https://news.google.com/rss/search?q=studie&hl=de&gl=DE&ceid=DE:de
I know hl = host language, gl = for the search results whose country of origin matches the parameter value, but I can't find what ceid for. If I cut that part of the search link, it is unable to show the result, so obviously it is a must part.
So what's the meaning and the purpose of the "ceid"?
Many thanks.
It might mean the country name and show the results according to the common language of the country.
For example: 'ceid=IN:en' means the country as "India", and hence the result should show up in English.

Google Places API: How to go from address to "good" place_id?

On the google places api site, they have an example query that returns a load of detail:
site:
https://developers.google.com/places/web-service/details
query:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJN1t_tDeuEmsRUsoyG83frY4&key=My-API-Key
Place_id appears to be the key here. So I'm trying to reverse-engineer this example, starting from information that a human being would actually have, to end up with this place_id.
Address from the example:
48 Pirrama Rd, Pyrmont NSW 2009, Australia
Places API query from the address:
https://maps.googleapis.com/maps/api/place/textsearch/json?query=48+Pirrama+Rd,+Pyrmont+NSW+2009,+Australia&key=My_API_Key
The result contains a different place_id:
ChIJ8UadyjeuEmsRDt5QbiDg720
And the place details with that place_id are much poorer than the original example:
https://maps.googleapis.com/maps/api/place/details/json?placeid=ChIJ8UadyjeuEmsRDt5QbiDg720&key=My-API-Key
So what am I missing here? How do I start from human-place information and get to the place_id that has the great place details?
EDIT: why the down votes? Am I trying to do something that isn't allowed?
Thanks,
sff
I think your text search is returning the office building, whereas your first search is returning the Google office within the office building. You can fix your text search by adding the name of the company and removing some of the search terms.
I'm not sure why just adding 'google' to the search term doesn't return the result you want though.

How does Google Maps decide when to use a specific icon?

I am using the Google Maps Places library to do a search for nearby hospitals, but it returns results that aren't necessary hospitals (but have 'hospital' as one of their types). However, I've noticed that actual hospitals have a hospital icon on the map, so Google must somehow know which establishments are actually hospitals. Does anyone know if the public has access to this data?
This is the icon I'm referring to: https://www.dropbox.com/s/1jfqcayxavjhlyi/Screenshot%202015-03-17%2017.20.19.png?dl=0
Example of request I'm making:
var request = {
location: self.location,
radius: 20000,
types: ['hospital'],
keyword: 'hospital'
};
Example result that isn't a hospital:
{"geometry":{"location":{"k":44.815958,"D":-68.808244}},
"icon":"http://maps.gstatic.com/mapfiles/place_api/icons/generic_business-71.png","id":"de6e60bd70b90ba4cb86afe149a60169553607f1",
"name":"Penobscot Community Health Center",
"opening_hours":{"open_now":true,"weekday_text":[]},
"photos":[{"height":320,"html_attributions":[],"width":320}],"place_id":"ChIJj--4INRKrkwRN0z2XkoJtVU",
"rating":3.1,
"reference":"CoQBdAAAADmf3YA0659efzMbCSPOK6SZttkfus7aWBDhrZZyX63Szl256BRcpz81LH6rIuONldYv256tsN7Zv-N6ZkOkJadlD2VS01bs7C4ierKvGUMyJOJu657xL5MvidF3Tgs9iejeJcXsxjDJYOwtN3m3sbfClfWYVnnIL4hMLYV8P9TnEhBurfJv_30CAG2wp1V73POVGhR-7fz1mCdh4OYWSa3Pw0mPupckoQ",
"scope":"GOOGLE",
"types":["hospital","pharmacy","store","health","establishment"],
"vicinity":"1012 Union Street, Bangor",
"html_attributions":[]}
My guess is there are a couple ways to get around this. You might remove the keyword argument from the API, which acts like a search term rather than a specific match on a type of location like the type field does.
You may want to be careful about your radius value choice.
Next, if you do a search on Google Maps in general you'll get a broad assortment of results. Do you need every result to be an actual hospital or can you do your own filtering afterwards?
If you do your own filtering it looks like type information and even icons are embedded in the result JSON. You might see if there's a distinguishing characteristic between the types of results you want and filter by that. Otherwise, any additional graphical data would not be accessible via the API.

Resources