I want to label around 300K addresses according to their longitudes and latitudes on the google map. By labeling, I mean put an indication sign on the map.
Are there any methods to realize it? Thank you.
Best,
Leon
If you mean you have full, proper addresses and you want to geocode them (find lat/lngs) then consider using Google Fusion Tables - its like a spreadsheet to which you can define a location field.
Then, you can tell Google Fusion Tables to geocode those addresses for you and it fills in the lat/lng location, and creates a kml file from this with "infoboxes" which you can define.
The geocoding process should be seen as one-off operation, and may take somewhere between many minutes and many hours to do this work.
Use the geocoding api
Related
Really quick/simple question that will determine which map API i use for my project.
I dont need an example- ill figure that out, i just need to know if the capabilities are there.
If i have store geocode (latitude, longitude) coordinates in a database, can i put one of those little red markers on a google map without having to actually make a geocoding request from google?
Additional question:
Also, would it count towards any quotas every time i display one of their maps, even if i give them the geocoded coordinates? Because i mean technically their map still has to find those coordinates...
Q1: Yes — you tell the API the coordinates of where to put the marker, rather than get Google to find those coordinates.
Q2: The usage limits are published by Google. You can have up to 25000 map loads per day. If you don't use the geocoder because you provide the coordinates yourself, then you don't use a geocoder access.
I have a Google spreadsheet with one column of physical addresses, and I want to have a second column be the time in minutes to walk between the address in column 1 and a second address (as determined by Google Maps). Any recommendations on how to accomplish this task?
From my understanding of the Google Maps terms of service, they:
don't like people using their service as a "batch geocoder". This means that
you will need to throttle your requests (place delays between each successive request, to avoid the OVER_QUERY_LIMIT error)
it is against the terms of service to use the geocoder (and maybe the distance service) without displaying a map graphic
If you still want to proceed,
you need some way of extracting the address from your spreadsheet. I think there's a Google docs API that will help you do that. I also found some custom Javascript code that does that for you easily. I don't have a link anymore :(
once you have the addresses readable from the Google Maps Javascript API, you can call the distance or directions API to get the walking distance
then you need to save that back to the spreadsheet.
It sounds like a possible application for the Distance Matrix Service.
But you can only use it if you will be displaying a map
Use of the Distance Matrix API must relate to the display of
information on a Google Map; for example, to determine
origin-destination pairs that fall within a specific driving time from
one another, before requesting and displaying those destinations on a
map. Use of the service in an application that doesn't display a
Google map is prohibited.
I have a script that generates a ton of locations/places based on a users input. I want to add these places as markers on Google Maps based on javascript APIv3, but I would easily go over the geocoding limit.
Is there a way simply to insert a string of a popular location into the markers options variable and have it load on the map? So insert "Boston, USA" instead of latlng(X,Y)? Are their other options available to me? I know of free geocoding APIs, but not all my locations are in the US.
The only way to specify a Marker's location in Google Maps JavaScript API v3 is with a LatLng object. You cannot specify the Marker's location with a common name like "Boston, USA".
One thing you may want to consider is how a map will perform with lots of Markers. (I'm assuming by "a ton" you mean at least 500.) That might heavily tax your user's computer/device and the user may end up with little more than a blob of markers that's less than completely useful. Perhaps you can test with, say, 1000 markers on a less-than-kickass machine and see how your code performs. You may find that you need to rethink your interface in a way that reduces the number of markers you use anyway.
I have to provide such functionality:
User checks 2-10 cities at Google Maps, I count the way between those cities using roads and show the way. The additional information is length of the full way.
Is it possible with google maps?
If you already know the order you want to be travelling to the cities in, then you just have to make a DirectionsRequest using the in between cities as waypoints. If you don't know the order, as long as you know the start and end, you can have Google Maps optimize the order of the waypoints for you.
http://code.google.com/apis/maps/documentation/javascript/services.html#Waypoints
What is the best way to plot points on a Google map? I have a bunch of addresses (about 300) stored in my database, and right now I am outputting each address into a JS array and plotting each address by looping over the array and running a function that geocodes the address and creates a new marker. However, I'm not sure if that is the best approach. Any thoughts?
Your problem is the geocoding part. Geocoding 300 addresses in one go is slow, and you would quickly hit the daily limit.
You should consider doing the geocoding on the server-side, and caching them in your database, or somewhere else. The Google Maps API Terms of Use appear to permit the caching of geocoding results "for the purpose of improving the performance of your Maps API Implementation" (Section 10.3).
If the addresses are relatively constant, then the repeated geocoding isn't terribly efficient. You could geocode each once and submit to Google Maps only the latitude and longitude for plotting. See the KML upload information.
What I ended up doing was geocoding the addresses upon address insertion into my databas using a web service called Tiny Geocoder: http://tinygeocoder.com/.
For the existing addresses I already had, I ran a script that used this same service to loop over my result set, geocode each address, and store the lat/long in the database. It took awhile but it got the job done.