Origional script >> https://github.com/musafir-py/geolocatethis
Latitude and Logtitude - points to the center of the search circle. For best results give closest approximate coordinates to place you are trying to find.
Radius - Defines radius for area to search from given above coordinates. The maximum allowed radius is 50 000 meters. Because of Google Maps advertising policy, sometimes one or two places can be included from outside of the given radius.
Keyword - A term to be matched against all content that Google has indexed for this place, including but not limited to name, type, and address, as well as customer reviews and other third-party content.
Category - Restricts the results to places matching the specified type. Only one type may be specified (if more than one type is provided, all types following the first entry are ignored). See the list of allowed categories .
Distance - Number (in metres) defines distance beetwen to searched places (landmarks).
Copy all files to your webserver and configure your google API.
Let's assume we need to geolocate this photo:
All we know it was taken somewhere in southern Berlin near Schonefeld. On the photo, there is a pharmacy and a small shop with Deutsche Post sing above the door. That is enough information to run program.
There are 4 parts of the city where photo potentially could have been taken: Rudow, Adlershof, Altglienicke, and Bohnsdorf. The best place to place marker for center point would be somewhere around State Park (52.415430, 13.526943).
Next, we should type in following data:
- Radius = 8000m (distance between the center point and edge of every adjacent neighborhood).
- A keyword for place 1 = 'pharmacy' (best to use a word in English as this is the main language of Google Maps database)
- Category for place 1 = 'pharmacy' (limit search only to actual pharmacies)
- A keyword for place 2 = 'post' (you can type in multiple keywords, however, in this case, is better to give a more general description as we don't know how this shop is described in google maps).
- Category for place 2 = 'store' (it will limit search only to stores with 'post' related keyword)
- Distance = 10m (rough estimate from photo)
...and yes, our pharmacy is in results ;)