Closed SteveMan67 closed 11 months ago
Please don’t include your credentials in your code. Also, (I’m not 100% sure) but I believe that geocoding takes in a address - there could be multiple places in the world with the name “Tulsa” in it.
I tried a coordinate point as well and got the same results.
No idea what is happening, but with my account, on the latest version (0.4.4
), I'm getting these results:
Coney v Hot Dog
36.106, -95.9178
#1 - Places we love to go!
PMO
We All Float Down Here #2
36.09898, -95.916256
An Extra Unextraordinary Corner
36.098216, -95.914181
We All Float Down Here
36.097555, -95.917133
Ramble and Read
36.0973, -95.9212
Disc-overy!
36.0993, -95.9266333333333
Lake view
36.115067, -95.928983
Quite a Darling Place
36.122667, -95.9177
Escape!!
36.119665, -95.904155
Oh, now I know what's happening :D
So, the default sort parameter in the Geocaching.search()
method is SortOrder.date_last_visited
. And as I've mentioned in https://github.com/tomasbedrich/pycaching/issues/204, for basic members only SortOrder.distance
works.
So your account probably isn't a basic member. And the caches you get from the code are sorted by SortOrder.date_last_visited
.
For now, there's a working code that gives the expected results:
import pycaching
from pycaching.geocaching import SortOrder
geocaching = pycaching.login("login", "password")
point = geocaching.geocode("Tulsa")
for cache in geocaching.search(point, limit=10, sort_by=SortOrder.distance):
print(cache.name)
print(cache.location.format_decimal())
Given the comment by @BelKed, it seems like this is just some usage issue I am and going to close this as resolved.
With this code,
It gives me results like this:
These are nowhere near Tulsa. I also tried the geo.Point() module, which had the same results, which are all over the place.