Google geocode API results - storing the data - google-maps-api-3

This is a question specifically for the Google Developer Relations team. I have read the Geocode API T&Cs and I am aware that I am not allowed to store data except by way of a temporary cache (e.g. for performance). Is this the end of the matter? I am developing a product which requires a search with results sorted by distance from a place, meaning that all my records need a lat/long. I was intending to use the Geocode API to get the lat/long when a user adds a record, and then adding that lat/long info to the record. We would then use the Haversine formula to calculate the relative distances and sort the results.
If I follow this approach, will I be in breach of the T&Cs? If so, is there another approach using the Geocode API which will allow me to hold onto lat/long data so that I can sort my results by distance, within the letter of the T&Cs?
For anyone else commenting, please observe the following restrictions: (1) we don't have a budget to buy a postcode-lat/long dataset; (2) we don't want to use a static dataset of our own, eg GeoNames, because we don't want to have to maintain data which is, effectively, public; (3) we have to support users who have javascript disabled.
To be absolutely clear, what I need here is to have the lat/long for all of my records in hand so that I can do effective searching and sorting by distance relative to another lat/long as provided, e.g. by a user searching.
Google Team, please respond to this message with contact details so we can speak.

Related

Here api not showing any data in /places/v1/dicover/here for specific lat long

I am using here map api for getting nearby places but it is giving blank data (/places/v1/descover/here). While in /descover/explore/ it is giving so many records on same lat long. I am sharing screenshot for better understanding, Visit https://www.awesomescreenshot.com/image/3804672/65583a3e4f228ade754feba101ef26eb.
This depends on the use case you have.
The Here entrypoint helps users to identify direct places at their location or at a point selected on a map by returning places close to a given point, sorted by distance. (Normally the closest known places are returned, but if the uncertainty in the position is high then some nearer places are excluded from the result in favour of more popular places in the area of uncertainty.)
Then again the Explore entrypoint retrieves a complete list of relevant places nearby a given position or area. It answers the question "What interesting places are in the viewport of the map?" The results presented to the user are confined to those located in the current map view or search area and are ordered by popularity.
In general I would recommend to use the Explore entrypoint as the Here one is deprecated:
https://developer.here.com/documentation/places/topics_api/entrypoint-maturity-availability.html

How to fetch exactly same results of Google Grocery stores near to me

I am wondering to find a way to fetch exactly similar results of google grocery stores near to me
I have used the below API to get nearby grocery stores
https://maps.googleapis.com/maps/api/place/nearbysearch/json?sensor=true&radius=5000&key=AIzaSyC9rFJ90pP1oHpLrqpR2B0HtUboLaHmnDw&location=45.4940475,-73.5606149&type=supermarket&rankby=prominence
but it's not showing the all popular stores with matching to google grocery stores near to me best match (attached images).
What is the way to achieve functionality by applying filters From API? please, advice appreciated if its possible immediate replay.
Thanks
The API only will gather data by distance, prominence, and type. It is up to you how you want the data be sorted/filtered and which to display to your users.
Get your data: rankby
If rankby=distance (described under Optional parameters below) is
specified, then one or more of keyword, name, or type is required.
If you want to rank by distance, you will need to remove radius parameter form your url.
radius — Defines the distance (in meters) within which to return place
results. The maximum allowed radius is 50 000 meters. Note that radius
must not be included if rankby=distance (described under Optional
parameters below) is specified.
This will get you started. Places Library

Check if a railway track is near location

I've been looking into this for quite a bit, but couldn't find a solution. Is there a way to find out whether railway tracks are near a users position?
The APIs don't provide a places search like this (see Google Places supported types for this). One possibility would be to download the OpenStreetMap dataset for your region, import it in a database and extract the datasets Railways. Then you could pass the users position to your database (PostGIS) and check if there is a railways matching your filters.
Moreover there is the OpenRailwayMap, if you just need a possibility to do some visual identification of railway tracks. See OpenRailwayMap API site for further usage information.

Nearest Shops Feature by using Google Places API

I am trying to develop the feature in my website to search the nearest Stores for the given location/address.
For example.
http://www.tesco.com/store-locator/uk/
After I have done some research, I think, I need to use the Google Places API to locate the nearest places. I have tested with some examples and it's working.
However, I don't know how to upload my chain of stores onto the Google Map and how to find the nearest stores (only mine, not other stores). I couldn't find a feature to upload my places onto the Google Places by using their API.
Could you please guide me how I could achieve it? Thanks.
I am attempting a similar feature.
First, you will need to upload your business locations to google. I think this is an important step it getting your places to show up on google maps. You can do that here: https://www.google.com/local/manage/#/list
After uploading you can download all of the locations in csv format. Once you have all of your locations in csv format you can parse the data and create a list of addresses to search.
Once you have your addresses you can use google's distance matrix api https://developers.google.com/maps/documentation/distancematrix/
you can search up to 100 places and get back a distance result for each location. Finally you can parse the distance results to find the closest location.
A few drawbacks here. There is a URL length limit of 2000 characters. If you are searching a lot of places this will fill up fast. Also, the free version of the API has a limit of 100 places per search and a maximum of 100 places per 10 seconds so if you have a lot of places or a lot of users this will be an issue.

Using the Googlemaps Geocoder and Storing the Data

I am building an Events site in which the address of a given event will be stored to be used within a map on the page. Whilst viewing an Individual Events' page i would like to provide a list of similar events on side of the page. I would also like to rank this list by distance and display a small map with a marker on it for each item on the list.
I was thinking of Geocoding the Events address upon content input and then storing this data within the sites database. Doing this would allow me to calculate the distance of an event on the server and then provide an ordered list to display.
My question is this:
Would this violate the Googlemaps Terms of Service?
These terms:
"the geocoder for any purpose other than obtaining locations that will be displayed using the Google Maps APIs is a violation of the Terms of Service. You may use the HTTP geocoder to geocode addresses outside of your Google Maps API application so that they may be cached and later displayed using one of the Google Maps APIs, but locations obtained using the Geocoding Web Service may not be used by any other application, distributed by other means, or resold."
Suggest that storing the data is not a problem but i am unsure that the process of ordering the list by long lat would not result in a violation.
Any advice would be greatly appreciated.
As long as the map your refer to in your question is a Google Map and you are using the geocoded data to display features on a Google Map, you are fine. The client-side google.maps.Geocoderdev-guide is intended for dynamic requests that are based on real-time user interaction that drives a need to perform on-the-fly geocoding. But Google encourages you to consider using the Geocoding Web Servicedev-guide on the server-side, when you wish to pre-geocode static addresses or coordinates prior to using the response values on a Google Map. Storing those values is assumed.
It is common to perform some form of post-response/post-storage processing on those values, just like the ordering by distance that you describe, to fit whatever use case is needed to populate your map with the appropriate data. I understand you want to be careful to remain within the TOS, but what you describe sounds pretty standard.

Resources