Skip to content

Allows querying Google Maps API for 2 specific places in precise distance from each other within given radius. Useful for geolocating from photographs.

Notifications You must be signed in to change notification settings

IntelTakes/geolocatethis

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

*** DEPRECATED ***

geolocatethis

Idea came to life during geolocation of a picture taken in unknown location. I thought it would be very helpful to ask google maps to find "all restaurants in area with maximum distance of 30 metres from newspaper kiosk". So I've written simple python script that allows querying Google Maps API for 2 specific places within precise distance from each other in given area.

DATA INPUTS:

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).

HOW TO RUN IT?

Min. required python version: 3.6

Copy all files (including 'assets' folder) to your disk. Remeber to paste your API Google Map key into 'assets/auth_key.py' file.

Run script with command: python geolocatethis.py

While searching program prints out coordinates of places that met previously given criteria.

USE EXAMPLE:

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)
Result gives 20 positive matches. In the same area, Google Map search shows over 60 pharmacies. It means three times less work to do on google street view.

...and yes, our pharmacy is in results ;)

About

Allows querying Google Maps API for 2 specific places in precise distance from each other within given radius. Useful for geolocating from photographs.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages