legacy-api-documentation
legacy-api-documentation copied to clipboard
Geo search requirements?
I'm playing around with geo search.
If I search for an image using "term", and grab the lat/long values in one of the images, it works (in the format ?geo=1111111,2222222,10, for example)
If I replace the lat/long with ones from, say, the url of google maps, I get no results though.
Example:
- Search for
https://api.500px.com/v1/photos/search?term="tower bridge london" - get co-ordinates from first returned image and do a geo search:
https://api.500px.com/v1/photos/search?geo=51.4996600500144,-0.124454498291016,5- results returned OK.- load google maps and centre on Tower Bridge. Get URL
https://www.google.co.uk/maps/@51.5048413,-0.0728062,16z?hl=en - use these co-ordinates:
https://api.500px.com/v1/photos/search?geo=51.5048413,-0.0728062,5NO results found.
I wondered if it was to do with the number of decimal places, but padding out the gmaps co-ordinates to the same length didn't help: https://api.500px.com/v1/photos/search?geo=51.5048413000001,-0.0728062000001,5 - NO results.
Any ideas?
@jmbillings API documentation states radius is either 'km' or 'mi' units so if you add km it starts to return some results.
https://api.500px.com/v1/photos/search?geo=51.5048413,-0.0728062,5km
I presume if you don't specify the unit the 500px backend defaults to meters as
https://api.500px.com/v1/photos/search?geo=51.5048413,-0.0728062,5000
will give you the same result set.
Ah- that might be it, I think I'd assumed it defaulted to km or something, I shall give that a try. Thanks!