Extraction of data from Google Maps using MySQL queries - mysql

Can anyone tell me how I can extract Data from Google Maps database?
I want to extract information based on the name.
For eg: select name, address, coordinates from maps_table where name like 'regex_expression'
Please help me on how to do this with Google Maps

You cannot fetch google maps information in a database or any such entity which stores bulk information .So a discussion on how to retrieve it from a database is hypothetical as Google Maps data is not meant to reside in a DB.
Section 10.1 of Google Maps' Terms of Use [1] says :
(b) No Pre-Fetching, Caching, or Storage of Content. You must not pre-fetch, cache, or store any Content, except that you may store: (i) limited amounts of Content for the purpose of improving the performance of your Maps API Implementation if you do so temporarily, securely, and in a manner that does not permit use of the Content outside of the Service; and (ii) any content identifier or key that the Maps APIs Documentation specifically permits you to store. For example, you must not use the Content to create an independent database of "places" or other local listings information.
(c) No Mass Downloads or Bulk Feeds of Content. You must not use the Service in a manner that gives you or any other person access to mass downloads or bulk feeds of any Content, including but not limited to numerical latitude or longitude coordinates, imagery, visible map data, or places data (including business listings). For example, you are not permitted to offer a batch geocoding service that uses Content contained in the Maps API(s).

Related

Storing of photoreferences which are returned with place-details

Can I store the photoreferences returned with place-details API (max 10 are returned) so that I can use them later directly to fetch the photos using places-photos API call? ToS states that we can't store anything.
Like you said, the ToS state the following:
3.2.4 Restrictions Against Misusing the Services.
(a) No Scraping. Customer will not extract, export, or otherwise
scrape Google Maps Content for use outside the Services. For example,
Customer will not: (i) pre-fetch, index, store, reshare, or rehost
Google Maps Content outside the services; (ii) bulk download Google
Maps tiles, Street View images, geocodes, directions, distance matrix
results, roads information, places information, elevation values, and
time zone details; (iii) copy and save business names, addresses, or
user reviews; or (iv) use Google Maps Content with text-to-speech
services.
(b) No Caching. Customer will not cache Google Maps Content except as
expressly permitted under the Maps Service Specific Terms.
And the Specific Terms of Service say the following on what caching is allowed for Places:
5.4 Caching. Customer can temporarily cache latitude (lat) and longitude (lng) values from the Places API for up to 30 consecutive
calendar days, after which Customer must delete the cached latitude
and longitude values. Customer can cache Places API Place ID
(place_id) values, in accordance with the Places API Policies.
So it certainly doesn't look like you can store photo references. You may want to speak with a legal representative in any case.
Hope this answers your question.

Save static browser image to local folder

I am using the Google Static Maps API, to construct a URL with the necessary parameters, which then displays in the browser.
https://developers.google.com/maps/documentation/staticmaps/
How can I automatically save the static map image which is displayed in the browser?
Currently, I have to right-click over image and 'Save image as...', in order to get the image into the required folder. I would like to automate this last step.
Here is a sample URL:
https://maps.googleapis.com/maps/api/staticmap?&size=600x600&maptype=roadmap&scale=1&markers=color:red|label:S|610+Beech+St+W,Whitby&markers=color:blue|label:1|43.8764737,-78.945162&markers=color:blue|label:2|43.8975446,-78.9429329&markers=color:blue|label:3|43.8828564,-78.9294267&markers=color:blue|label:4|43.8828564,-78.9294267&markers=color:blue|label:5|43.903265,-78.956063&markers=color:blue|label:6|43.8780157,-78.9590955&markers=color:blue|label:7|43.886099,-78.952875&key=AIzaSyC5FiaYcLsRwaSxOhcOzqejdN_xzCwVIJ8
This use case might be in contradiction with Google Maps API Terms of Service. Section 10.5 (d) states:
No caching or storage. You will not pre-fetch, cache, index, or store any Content to be used outside the Service, except that you may store limited amounts of Content solely for the purpose of improving the performance of your Maps API Implementation due to network latency (and not for the purpose of preventing Google from accurately tracking usage), and only if such storage:
is temporary (and in no event more than 30 calendar days);
is secure;
does not manipulate or aggregate any part of the Content or Service; and
does not modify attribution in any way.
https://developers.google.com/maps/terms#section_10_5
Just an update to where you can find the relevant terms of service now:
3.2.3 Restrictions Against Misusing the Services.
(a) No Scraping. Customer will not export, extract, or otherwise scrape Google Maps Content for use outside the Services. For example, Customer will not: (i) pre-fetch, index, store, reshare, or rehost Google Maps Content outside the services; (ii) bulk download Google Maps tiles, Street View images, geocodes, directions, distance matrix results, roads information, places information, elevation values, and time zone details; (iii) copy and save business names, addresses, or user reviews; or (iv) use Google Maps Content with text-to-speech services.
(b) No Caching. Customer will not cache Google Maps Content except as expressly permitted under the Maps Service Specific Terms.

Can users rate a restaurant by using google places API?

I am able to get restaurants list, timings, rating and displaying them in my Android application by using Google places API. This is API
https://maps.googleapis.com/maps/api/place/search/json?location=13.0104611,80.2086226&
radius=10000&types=cafe|restaurant&hasNextPage=true&nextPage()=true&sensor=false&key=MY_API_KEY
As per my client requirement, Users should be able to give rating to a specific restaurant from my application, this restaurant got from above Googel API.
Kindly tell me whether possible or not giving rating to a restaurant from above API . Thanks in advance.
According to the documentation, using the Google Places API Web Service, the following place requests are available:
Place Searches return a list of places based on a user's location or search string.
Place Details requests return more detailed information about a specific Place, including user reviews.
Place Add allow you to supplement the data in Google's Places database with data from your application.
Place Photos gives you access to the millions of Place related photos stored in Google's Place database.
Place Autocomplete can be used to automatically fill in the name and/or address of a place as you type.
Query Autocomplete can be used to provide a query prediction service for text-based geographic searches, by returning suggested queries as you type.
The only request that allows to put data is Place Add, but according to the documentation it adds a place that is available immediately in Nearby Searches initiated by your application and also enters a moderation queue to be considered for Google Maps.
So the answer is that for the time being it's not possible to add reviews to Places using the Google Places API Web Service.

List businesses - Google Maps APIs Terms of Service

The website I am working on should keep a list of many businesses located at different cities. I add those business manually into my database, and later need to display them with Google Maps using markers (so the main purpose of the map is to display a list of businesses). The map is public and no fees are charged. I am not retrieving businesses' information from Google. What I do not understand is whether I am allowed to use Google Maps to display a list of businesses or not.
I can not quite understand this point of their ToS
10.2 (b) No Business, Residential, or Telephone Listings Services. You must not display business listings Content in any Maps API Implementation that has the primary purpose of making available business, residential address, or telephone directory listings.
Does this basically say that I can implement a service to list businesses, but I cannot query Google to obtain information about other businesses and add them to my own list?
Thank you
Firstly I am not a lawyer but I have taken a good look at the Google Maps licensing and I would read it the opposite way that you have read it. I think that displaying business listings on a Google map violates their ToS.
10.2 Restrictions on the Types of Applications that You are Permitted to Build with the Maps API(s). Except as explicitly permitted in Section 8 (Licenses from Google to You) or the Maps APIs Documentation, you must not (nor may you permit anyone else to) do any of the following:
....
(b) No Business, Residential, or Telephone Listings Services. You must
not display business listings Content in any Maps API Implementation
that has the primary purpose of making available business, residential
address, or telephone directory listings.
It seems to me the criteria that is being evaluated is the type of service you are offering and if the type of offering is a business listing service (which it sounds like you service is) then you are not allowed to use the Google map API. This makes sense as it would be hard to differentiate that sort of business listing from the service that Google provide.
However, there are a number of free options you could use to put markers on maps that you should look at which avoid this issue. These include:
OpenLayers
GeoExt
PolyMaps
Leaflet
As you have created your own database I suggest you to create a web service of it and then use that data to display it on map.
Refer this link..This one is the best for your question. It explain each every steps from DB to Google Maps.
https://developers.google.com/maps/articles/phpsqlsearch_v3
Another thing which you can do is that you can upload the bulk data on Google's Places and then you can use Google's Places API to fetch the data. But one thing which you i would like to point is that if you use Places API then it will provide you maximum 20 results. Refer this links.
Bulk data upload
Hope this will help you....

How can to export Google maps data and understand them for creating new navigation software

I want to create a navigation software and I need strong maps.
How can to export Google maps data and understand them for creating new navigation software?
Is it illegal?
You cannot export Google maps data. In fact you aren't even allowed to cache them:
When using Google Maps or Earth APIs, you may not cache any imagery or
other Content. Google continually updates the imagery within Maps and
Earth; thus, caching may result in stale or even impermissible
imagery. For full details, please read section 10.3.1 of the Maps/Earth API Terms of Service.
All google maps usage must be through the appropriate google maps API which specifically forbids turn-by-turn navigation if that is where you were going with this.
As an alternative you can try openstreetmap.org and check out their API usage policy
Basically you can download the entire planet as vectorized data from various planet.osm mirrors
You might want to read this first http://maps.google.com/help/terms_maps.html:
Unless you have received prior written authorization from Google (or, as applicable, from the provider of particular Content), you must not: (a) copy, translate, modify, or make derivative works of the Content or any part thereof; (b) redistribute, sublicense, rent, publish, sell, assign, lease, market, transfer, or otherwise make the Products or Content available to third parties; (c) reverse engineer, decompile or otherwise attempt to extract the source code of the Service or any part thereof, unless this is expressly permitted or required by applicable law
In other words, you're not allowed to extract their data.