This is my code so far, I am using the flickrapi to obtain images with lat and lon, then using the overpass api in flickr to find info about the nodes at this location.
import flickrapi
import overpy
api_key = "xxxxxxxxxxxxxxxxxxx"
secret_api_key = "xxxxxxxx"
flickr = flickrapi.FlickrAPI(api_key, secret_api_key)
def obtainImages():
photo_list = flickr.photos.search(api_key=api_key, accuracy = 15, has_geo=1, per_page = 100, extras = 'tags, url_s')
for photo in photo_list[0]:
id = str(photo.attrib['id'])
url = str(photo.attrib['url_s'])
title = (photo.attrib['title']).encode('utf-8')
photo_location = flickr.photos_geo_getLocation(photo_id=photo.attrib['id'])
lat = float(photo_location[0][0].attrib['latitude'])
lon = float(photo_location[0][0].attrib['longitude'])
max_lat = lat + 0.25
min_lat = lat - 0.25
max_lon = lon + 0.25
min_lon = lon - 0.25
print lat
print min_lat
api = overpy.Overpass()
query = "node(%s, %s, %s, %s);out;" % ( min_lat, min_lon, max_lat, max_lon )
result = api.query(query)
print query
print len(result.nodes)
obtainImages()
The flickr api aspect is working perfectly, if I try to print any of the variables it all works. Also min_lat and min_lon all work when printed.
However although there are no errors, my query is returning no results.Lat and min_lat print once and only once and then the program continues running but does nothing else and prints nothing else
Has anyone any suggestions as to why this may be? Any help would be greatly appreciated as I am a newbie!