Saving lat and lang in database using geocoding - google-maps-api-3

I have a csv file with around 40.000 addresses which I need the lat and lng points from to pinpoint the position of the marker. I know there is a 2500 request limit per day using googles geocoder. but I was wondering if it was possible to geocode these addresses and save the lat and lng points inside my database and repeat this every day untill I have the coördinates of all addresses and if possible, how would I do that?
All help will be highly appreciated.

You can technically do it using javascript code as suggested in the commments. Their are even other methods and techniques you can do this with but please be aware of the Google Policies.
Quoting from the official Google Documentation
No mass downloading. You will not use the Service in a manner that gives you or a third party access to mass downloads or bulk feeds of any Content. For example, you are not permitted to offer a batch geocoding service that uses Content contained in the Maps API(s).

Related

How to retreive speed limit from here maps given a latitude and longitude?

I'm trying to get speed limit from Here API maps but I can't find the way to do it. I tryed few example on web site but the only one that works is the one which require point of start and point of stop of the route.
I would like to get the speed limit given only one point ( or a box ). Which api do I have to use? Is there an example?
https://route.cit.api.here.com/routing/7.2/calculateroute.json?jsonAttributes=1&waypoint0=51.31854,9.51183&waypoint1=50.11208,8.68342&departure=2019-01-18T10:33:00&routeattributes=sh,lg&legattributes=li&linkattributes=nl,fc&mode=fastest;car;traffic:enabled&app_code=appcode&app_id=appid
This is the waypoint one but is not what I'm looking for, I would like to pass it only a Latitude / Longitude.
Thank you
You can achieve this by using PDE API(Platform Data Extension)
You have to first map your geocordinates(lat,long) to a navigable position(lat,long) for the given coord and the Functional Class(FC1-5) it is located in. This you can achieve by a simple geocoder request
You can calculate tilexy values based on the navigable lat,long and pass it to PDE API for querying speed limit layer on that particular FC class.
Look at https://tcs.ext.here.com/examples/v3/link_speed_locator example which covers this exact usecase.
Below is a sample geocoder request. Here prox parameter is your lat,long
https://reverse.geocoder.cit.api.here.com/6.2/reversegeocode.json?app_id=xxxx&app_code=yyyy&prox=50.133848, 8.715332,500&mode=retrieveAddresses&maxResults=1&additionaldata=SuppressStreetType,Unnamed&locationattributes=linkInfo
Below is a sample pde request
https://pde.cit.api.here.com/1/tiles.json?layers=SPEED_LIMITS_VAR_FC1,SPEED_LIMITS_VAR_FC2,SPEED_LIMITS_VAR_FC3,SPEED_LIMITS_VAR_FC4,SPEED_LIMITS_VAR_FC5,ROAD_GEOM_FC1,ROAD_GEOM_FC2,ROAD_GEOM_FC3,ROAD_GEOM_FC4,ROAD_GEOM_FC5&levels=9,10,11,12,13,9,10,11,12,13&tilexy=536,398,1073,797,2147,1594,4294,3188,8588,6377,536,398,1073,797,2147,1594,4294,3188,8588,6377&app_id=xxxx&app_code=yyyy
Read more about it in the developer site - https://developer.here.com/documentation/platform-data/topics/quick-start-view-map-data.html
Hope you find this useful!
The ReverseGeocoder has rarely used mode "trackPosition" (mode=trackPosition).
In combination with locationattributes=linkInfo you may retrieve the speed limit for that matching road.

Generating a route without having Lat/Lon coordinates

It seems that the Routing API requires a Lat/Lon pair to be supplied to the Waypoint parameter. I've seen other APIs that allow for the actual address to be passed, instead of the Lat/Lon. I'm wondering if anyone knows of a way to do this with the Here.com API. In many instances I can obtain the Lat/Lon first, but in one instance it's proving to be a headache, especially given the nature of the way that the REST APIs work and the fact that I'm trying to batch-process a small group of addresses at a single time. Any help would be appreciated.
Unfortunately Routing API needs a waypoint in lat, lon and required a Geocoding as a pre-requisite.
Maybe a not so nice workaround if you are facing issues with Geocoding, the Duck Duck Go provides a syntax
https://duckduckgo.com/?q=!here Junghofstraße 14,60311 Frankfurt am Main,Germany, Germany&ia=about
But you will stll have to extract the lat,lon from the final redirected url.

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.

Is it possible to merge Google Places API with Google Geocoding API?

I am in the process of building a booking system and I'm wanting to do a lookup, based on a text field, that searches both businesses and addresses.
For example, a user is presented with an Input Box that asks them to enter a location. I want it to support Businesses and Addresses.
My current implementation uses the Geocoding web service, but it's unable to find businesses, so I need to bring in the Places API.
I also need to find the distance between these places using the Google Distance Matrix Web Service.
I thought I'd solved my problem by JUST using the Google Places API, but not all addresses are listed on it.
Any ideas / previous experience is greatly appreciated.
You can use both of these on the page, and place a condition for an unsuccessful search on one (i.e. missing or empty variable) to trigger the other.

ASP.NET/Silverlight Location Points on Google/Bing Map

I realize that the question is pretty complicated and may require much research. Hope anybody can help me to get useful resources to achieve my goal.
I want to have a Google or Bing map on my ASP.NET 4 application (C#) to display all my logged in users as points on the map.
I understand that this involves five major problems
Get the location of the device (most likely standard laptop with IE9 browser) based on its unique IP address.
Integrate Google or Bing map with ASP.NET or Silverlight application.
Display the right portion of the map with the right Zooming depending on logged-in users locations.
Finally, mark the addresses as points on the map.
Note that the locations points should be dynamically reflected when any of the locations is changed.
The database is implemented using SQL SERVER 2005/2008R2
There are geo location services that can give you the latitude and longitude given an ip address.
As you mention you would be storing these in a database, getting all the current users would be simple database call.
Integrating a google map into a html page is very simple. You would only have to emit the necessary javascript from your page.
You should mark the points on the map first.
Google maps api has calls to fit the map to show all current points(fitBounds). I am guessing bing would have something similar.
To reflect the current points, you would have to fresh your locations from the database. I highly recommend an ajax call that returns json and using that to replot the points.

Resources