Google Map API v3 Geocoding: should I use full address or just part of it? - google-maps

When geocoding human readable address into lat lng e.g. 3 mystreetname, myarea, mycity, mypostcode.
Should I use full address or just some part of it, for instance post code?
I know that it works ether way, but I'd like to know what would be the best practice to avoid errors geocoding locations.

Some cities span multiple postal codes, and some postal codes span multiple cities. You might not have problems with smaller data sets but as you start dealing with a lot of addresses things like that can pop up. It's entirely possible that there are two 201 Main Streets in the same zip code, located in two different cities.
So yep, give as much detail as you can.
I'd really recommend storing your information in a spatial datatype if your database supports that as well.

This link is the google's documentation of geocoding
https://developers.google.com/maps/documentation/geocoding/?csw=1
And refer below link for the real time sample..!
http://gmaps-samples.googlecode.com/svn/trunk/geocoder/singlegeocode.html
And for better results use more information so that you will get accurate answers
Hope it helps

I would try running the queries with as much detail as possible, and if a query fails rerun without the zip, as sometimes the zip causes problems with the google api (especially zips greater then 5 digits).

Related

Why Google's Webservice is returning approximate vs. rooftop or other location types?

Regarding Google's Geocoding Webservice: Is there documentation (beyond Google's documentation), articles, or anything out there regarding how to format addresses to get accurate results.
Some of my locations have names preceding the address. If it recognizes a street address in the string, I can usually get rooftop back. In some cases having a single quote or special character in the name will cause it to just recognize the address and geocode rooftop.
However, I am also seeing cases where it finds the exact place correctly as an establishment, a church for example, but still says the 'location_type' is approximate. Other cases where having words preceding the address causes it to only seem to recognize the zip code and it just geocodes the zip.
I am wondering if anyone has insight into how Google's Geocoding webservice API recognizes/parses locations? What causes it to see the address in one case, but only see a zip in another?
Also, is there maybe a better way to interpret accuracy than just that 'location_type' field?
So basically you have to follow the standard mailing address format that is used by the respective country the address falls in and refrain from using apt/house/suite numbers. Use street number for the building/complex/entity rather than names.
This is what you need to go through. However, please do your research first and ask a question as a last resort.

Geonames vs Google Maps

I am building an application that uses both GeoNames and Google Places API. The thing is, when I do a search nearby by a specific location (say lat: 47.16, lng: 27.56) on both of the services I do not know how to remove entities that appear both in the results from Google Places and the results from GeoNames(findNearby). I was thinking about using location (latitude and longitude) but it isn't accurate enough. Also, the name varies considerably so this wouldn't work either. Another idea that crossed my mind would be using the types (feature codes for GeoNames and type for Google Places), but there are a lot of types and obviously I can not do a cross reference manually. Any ideas?
Note: I want to use both of them as this is a school project and the requirements specify using more than one source of info.
Thanks.
I think that, unfortunately, the reason you haven't received an answer is that there is no answer that would fully satisfy the requirements.
Even with one provider, a single coordinate could be associated with multiple results. Imagine a large building in New York, for example, where dozens of companies each occupying a floor or part of a floor in the same building, and yet they would all be associated with the same (latitude, longitude) coordinate.
Now consider two sources. Source A says there's a doctor at that location (let's say on the 7th floor). Source B says there'S a doctor too. Can we assume they're the same doctor? Nope. It might be another doctor on another floor. Or it could be the same doctor. It's impossible to tell. The point is, you could try to use feature codes / types to reduce the number of hits by assuming similar locations are the same location, but it's still an assumption.
Anyway, good luck with your assignment from 3 years ago. It was a good idea nonetheless. :)

Compiling a list of all colonies/neighborhoods for a particular city

I want a list of locations (coordinates) for all possible colonies/neighborhoods of some Indian cities. Take for example Delhi. Can this data be obtained with the Places API?
The only thing that comes to my mind is to use a query like -
https://maps.googleapis.com/maps/api/place/search/xml?location=28.540346,77.210026&radius=500&types=administrative_area_level_1|administrative_area_level_2|administrative_area_level_3|locality|neighborhood|street_address|sublocality|sublocality_level_4|sublocality_level_5|sublocality_level_3|sublocality_level_2|sublocality_level_1|subpremise&sensor=false&key=MYKEY
and then keep changing the radius by 500 till the whole city is covered.
Is there a better way of doing this?
Given how often you would need to do this for your map, since caching that data goes against the terms of service, this is not a great approach. If you map gets any decent usage, you'll rapidly hit your quota. Plus you're only get center points of the colonies/neighborhoods. I'd recommend trying to find another source of that data you can download. The Places API was not designed with this in mind.

alternative to Google maps

My client wants some of the functionality of Google maps namely:
- geocoding
- generating maps with points based on postal code or long.lat
- optimal trip mapping
Their issues with Google maps
- cannot control outages
- postal codes are sometimes inaccurate or not updated frequently for Canada/UK
- they have no way to correct inaccurate information
They would prefer to host the mapping application themselves, but will require postal code updates.
Can anyone suggest such a product?
thanks
"cannot control outages - postal codes are sometimes inaccurate or not updated frequently for Canada/UK - they have no way to correct inaccurate information"
Outages
hosting your own mapping is the only way to control this, but you would be very very hard pushed to beat Google Maps / Bing Maps uptime over the last 5 years. Take a look at the following:
OpenStreetMap for the road imagery data, this is open source data very good in the UK (Im not sure about canada) and you can make your own changes and submit them (or just change the data you have downloaded)
Geoserver, Mapnik or MapServer will read openstreetmapdata and create the image tiles needed to create your own maps in whatever style you wish. Depending on if you dont want all countries and all zoom levels these products can create all the tiles you will need in advance, but usually they have to be created in real time and cached. You need a BIG fast server to manage tile crunching
Openlayers or Leaflet are open source javascript mapping platforms that will display your tiles for you
Obviously this is just for road maps, aerial imagery would cost you an absolute fortune.
Post Code Data
Many people do not realize that UK postcode data for latitude and longitude is now completely free and available to download every quarter from the official source (ordinance survey) http://www.ordnancesurvey.co.uk/oswebsite/products/code-point-open/index.html.
This is the same data source Google will use and there is none better but it will always contain inaccuracies and always be a few months out of date.
Finally
Hopefully that answer the question you asked and gives you information to inform your client. Now for the question you didn't ask "Is this approach good value to my client?".
I won't presume to know your business or client, however what I described above is possible but with one to many months of work involved to get it all working together and even then it wont have any where near the performance or uptime of something like google /bing maps and only offers a small subset of their features.
I think you're looking for something like Caliper-It's a very custom, and I would expect expensive, solution. Not suggested.
http://www.caliper.com/GISMappingSoftwareDevelopment.htm
One solution could be to use two different mapping services and compare their results, this way there's a much better chance the data is accurate. You can also fix inaccurate data by creating a system which acts as a barrier between the API and your user, where data you know is inaccurate is corrected before it's displayed. Not sure exactly what you're doing though, so this might not work for you.
Is trip mapping/routing the basic functionality you want to do?
Before rushing into rolling your own, I'd suggest a good think about the consequences of doing so. The first that springs to mind is whilst the pros are that you can now control your data, the cons are that you now control your data.
So you are going to have to consider where and when you get updates and the processes you are going to have to employ to keep your maps in sync with the rest of the world. There are a lot of headaches involved in these things which is why so many people use externally hosted solutions such as Googles.

What is required in order to implement a geo-spatial/proximity search?

I want to better understand what is required in order to implement a geo-spatial (aka proximity) search. I'd appreciate clarification on the following:
Beyond the latitude & longitude for
corresponding zip codes, what if
anything, is required?
Can anyone recommend any resources (books,
websites, etc.) for understanding
the formulas that can be used to
calculate proximity such as:
Haversine, Vincenty, Spherical?
How easy and effective are Mysql's tools for
implementing proximity searches?
Does Google Maps have an API for
proximity searches? For example if I
provide, a zip code can it return
zip codes within a set radius? I
searched the Google Maps website but
found nothing of the sort.
Thanks.
You just need to do a lookup on the zip code against a lat/lon. You can get this data at some of these sites.
This is a good reference for Haversine / great circle calculations.
MySQL apparently has a geometry type that can be used for some of this. There are also other Spatial Database that might be more useful.
I've never heard that it has that capability, but that doesn't mean that it can't. It might be better to look to one of the spatial databases listed at the link above.