You are here

How To Use the Wikimapia API to Automate Photo Retrieval for Geolocating

Geolocating a photograph is the process of determining the real-world geographic location of where it was taken by analysing the visual information in the image and cross-referencing it against other confirmed photos of the same location.

It is the sort of thing that happens in spy movies, or in elaborate treasure hunts facilitated by the internet. An organiser could take a series of photographs of clues placed at specific locations, leaving hunters to determine the positions of the clues from the visual information in the photo. But rather than manually searching for photographs from the suspected location, this tutorial by Justin Seitz on the Automating OSINT Blog shows followers how to automate photo retrieval using the Wikimapia API with Python and its package management system Pip.

The first part of this tutorial (consisting of 2 posts) focuses on using Panoramio as Seitz sets followers up with the software to interact with the necessary APIs. Using this knowledge base, the author guides followers through creating the required Wikimapia API key that allows HTTP GET requests from within a user-defined bounding box on a map.

The HTML parsing library Beautiful Soup is then installed and followers are shown how to poll the API for pages of results, since the Wikimapia API allows up to 100 records per page. The returned list of photos is logged to an HTML file with Beautiful Soup allowing extraction of the HREF attribute to avoid logging other tagged info such as locations or comments.

The author assumes no prior knowledge of coding and so includes extremely handy, line-by-line explanations for every bit of code supplied across all three posts, making this an ideal first project.

Be sure to read the next Geography article: As the Google Earth API Shutdown Nears, What Are Your Options?

Original Article

Automating Photo Retrieval for Geolocating – Part 2: Wikimapia