← Back to the blog

Geotagged Image Gallery

The original idea was to recreate Google maps' image gallery (see below) and modify it in such a way that images are not filtered by lat/long of screen-bounds, but time of year and topic.


The geo-tagged image data is directly queried on topic and time from the Wikidata database. For example, this is a API call going out for year "1222" with variance set to 10 , on topic "people":



tagged as date of birth from 1212 to 1232

data entry must have image attached

data entry must have place of birth attached

list the following properties directly in the response: instance of (31) and image (18) and place of birth (19)


Using the item identifer (here: 2719051), we query the wikipedia link:


the coordinates we get by querying the location identifier extracted from the original query under props 19 (here: 12225):


and for the image URL, we extract the image title from the original query under props 18 (here: "Ibn Sab'in.png") and query:

https://commons.wikimedia.org/w/api.php?action=query&titles=File%3AIbn Sab'in.png&prop=imageinfo&iiurlwidth=260&iiurlheight=400&iiprop=url%7Csize&format=json


We iterate through the found item list (up to the set limit of images), query all required fields as seen above and add each new element to the gallery. On mouse over, we add a pointer line from the image to the location where we create a dot marker. On mouse leave event, those two are removed again.

You can display all those pointer lines and dot markers of every visible image by clicking the "show all" button as seen in the image on top of this article.

Be the first to reply