passing an array of addresses into the Geocode.geocoder() Google Maps - javascript

Description:
I am using Google Maps v3. I have 25 dynamic addresses that I need to geocode at one time. We are currently working on a solution to store the lat/long in a database and remove the need to use Google's resources, but that is still a few months down the road and I need this geocoding functionality now.
Question:
Is there a way that I can send an entire array of full address into the geocode.geocoder() function? I have only seen examples where it was limited to one address at a time.
Disclaimer:
I have searched this site and could not find a solution. I have also google'd this exact question and haven't found anything.

The answer is: No
Some great alternatives: https://gis.stackexchange.com/questions/22108/how-to-geocode-300-000-addresses-on-the-fly
Not too sure if I should delete the question or not; kinda want to leave it up so duplicates aren't made. I would never have thought of the search query "batch processing"

Related

How to get only street/road coordinates via reverse geocoding (Google Maps API)

I'm looking for a solution to get data to create a simple roads-only map.
Within a small area specified by lat/long I need data that allows me to draw custom lines between given street coordinates (start and endpoints are basically enough and only from major streets). Coordinates from intersections are also fine to connect those with my custom lines.
Another approaches would be to get all the major street names within the specified area via reverse geocoding and then - somehow - get coordinates for each of this streets.
There was a similar request a couple years ago:
Get street graph for a game using Google Maps API and I'm wondering is it still a big deal to achieve this kind of technical information in a simple way?
EDIT:
I researched the topic but no result gave me the satisfaction I was looking for. For instance Google's Directions/Roads API are both depending on routes. OSM/Google Maps API are filled with information around a specified geo location but without any technical data I need. To be simple: An Array of intersection/street-point coordinates (are they even called coordinates?!).
I think I'm lost - or even stuck - in terms of my own search phrases. I'm not looking for a copy & paste snippet more like a direction or some hints where to focus next or how it is done.
With the clarification of geocodezip's comment I've found the following related question:
How to get all roads around a given location in OpenStreetMap?
This fully suits my demand to get specific road information within a certain location using OSM instead of Google Maps API.
Many thanks

Two different google APIs on the same page

Is it possible to get two different javascript Google APIs to work on the same page? My goal is to use the autocomplete Google API to get an address to pass into the calculate distance API, allowing the user to autocomplete their address and immediately see the estimated travel time to a predefined location (similar to Uber). I am new to javascript, so I am not sure if there is some trick to solve this problem; any advice?
If the question is "is it possible ?", I could just answer "yes" :).
You can insert autocomplete in HTML that will lead subsequent call to distance API, no problem.

maps.google Geocoding Jquery calls with country codes

Im trying to get a simple geo-location type address lookup thing going using the google maps geocode API using jQuery $.getJSON method.
US & UK postal/zip codes are working fine but i've come across random countries where I'm guessing zip address are the same as other countries and i need to be able to return the correct address.
Im using a select option for someone to pick their country which contains its code e.g. Afghanistan has AF tied to it however when i try pass in the country code I'm still getting the wrong results.
Is there a proper way to call the API or are the results just hit and miss.
Sample below :
Zip for Kabul,Chahar Asyab is 1051
http://maps.googleapis.com/maps/api/geocode/json?address=1051&sensor=false
Will return addresses for Sweden,Slovakia and others countries but the one i want, I've looked briefly at the documentation and someone suggested region parameter in the URL however even with region=afit still returns different results.
Probably an easy fix but i've not found anything yet, i appreciate any help.
Thanks
Found a solution using
components=country:AF as a work around although the data is not always complete but works

Google Maps Directions - Find Out if Route Contains Toll

I am making a program that uses the Google Maps Directions Service. In my Directions Service Request I have set avoidTolls to false. But, I would like to know if the route contains tolls just like Google Maps:
I have seen this SO question:
Return if route has Tolls Google Maps API xml request
But because the question is over a year old, I am wondering if the Google Maps API has added a toll feature, might there be a different answer?
Is this possible? If so, how?
I'd love to see this feature as well. But Google didn't make any changes to this. So you still have to check html_instructions for certain words.
The best way is to force the language to "en" and then check if it contains "Toll road" or "Partial toll road".
Fail safe might be just to lowercase the html_instruction and search for "toll road".

Convert Lat/Long into state

I know how to set up geocode and pull the user's lat and long coordinates. However how do I turn this into a state name or code ie(DE, MO FL). I've looked at using Google's reverse geocode, but am unable to get an API code. Any other way to go about this?
As the comments suggest the only way to achieve this is via reverse GeoCoding.
Here's a link to the API docs for reverse GeoCoding:
https://developers.google.com/maps/documentation/geocoding/
And an anchored link to the outputs, clearly showing the state:
https://developers.google.com/maps/documentation/geocoding/#GeocodingResponses
I've found some of the Google API docs somewhat confusing so I'd suggest searching for a worked example where someone has done something similar.

Categories

Resources