-
Notifications
You must be signed in to change notification settings - Fork 11
Open
Description
AttributeError: 'Matcher' object has no attribute 'tree' when calling reverse_geocode
I have a problem when running matcher.reverse_geocode, this is the error:
Traceback (most recent call last):
File "/mnt/d/DeepRetailWA2/probando.py", line 11, in <module>
response2 = matcher.reverse_geocode([(-37.761993408203125, 144.97064208984375)])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/d/DeepRetailWA2/.venv/lib/python3.12/site-packages/whereabouts/Matcher.py", line 155, in reverse_geocode
query_indices = self.tree.query(points)[1]
^^^^^^^^^
AttributeError: 'Matcher' object has no attribute 'tree'
This is my code:
import json
from whereabouts.Matcher import Matcher
matcher = Matcher("au_all_sm")
response = matcher.geocode(
["34/121 exhibition st melbourne", "645 sydney rd brunswick"]
)
print(json.dumps(response, indent=4))
response2 = matcher.reverse_geocode([(-37.761993408203125, 144.97064208984375)])
print(json.dumps(response2, indent=4))Expected behavior:
reverse_geocode should return the nearest address for the given coordinates.
Actual behavior:
It raises an AttributeError because the Matcher object has no attribute tree.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels