Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Europe address_to_coords issue #38 is happening again #57

Open
LucidityCrash opened this issue Jul 14, 2021 · 5 comments
Open

Europe address_to_coords issue #38 is happening again #57

LucidityCrash opened this issue Jul 14, 2021 · 5 comments

Comments

@LucidityCrash
Copy link

Europe address_to_coords issue #38 is currently happening

From: 19 Albyn Drive, Livingston, UK - to: 2 Station Road, Prestonpans, UK
Start coords: (55.88032913208008, -3.524367570877075)
End coords: (52.34578323364258, 1.5044173002243042)
Time 446.55 - 493.93 minutes, distance 720.30 - 766.54 km.

Which is very much not correct. Grabbing some debug on the returned json
{'bounds': None, 'businessName': 'Starbucks Drive Through', 'city': 'Livingston', 'countryName': 'United Kingdom', 'location': {'lat': 55.88032913208008, 'lon': -3.524367570877075}, 'name': 'Starbucks Drive Through', 'number': None, 'provider': 'waze', 'segmentId': -1, 'state': 'West Lothian', 'stateName': 'No State', 'street': None, 'streetId': 0}

{'bounds': None, 'businessName': 'Station Road', 'city': 'Halesworth', 'countryName': 'United Kingdom', 'location': {'lat': 52.34578323364258, 'lon': 1.5044173002243042}, 'name': 'Station Road', 'number': None, 'provider': 'waze', 'segmentId': -1, 'state': 'Suffolk', 'stateName': 'No State', 'street': None, 'streetId': 0}

so it has found a Station Road in Halesworth not Prestonpans.

Modifying the COORD_SERVERS for EU to be SearchServer/mozi as per issue #38 the returned jsons become
{'bounds': {'bottom': 55.86370668029149, 'left': -3.518317480291502, 'right': -3.515619519708498, 'top': 55.8610087197085}, 'businessName': None, 'city': 'Murieston', 'countryName': 'United Kingdom', 'location': {'lat': 55.86235809326172, 'lon': -3.5169684886932373}, 'name': '19 Albyn Dr, Murieston, Livingston EH54 9JN', 'number': '19', 'provider': 'waze', 'segmentId': -1, 'state': 'Scotland', 'stateName': 'No State', 'street': 'Albyn Drive', 'streetId': 0}

{'bounds': {'bottom': 55.9558145802915, 'left': -2.979162080291502, 'right': -2.976464119708498, 'top': 55.9531166197085}, 'businessName': None, 'city': 'Prestonpans', 'countryName': 'United Kingdom', 'location': {'lat': 55.954463958740234, 'lon': -2.9778130054473877}, 'name': '2 Station Rd, Prestonpans EH32 9EP', 'number': '2', 'provider': 'waze', 'segmentId': -1, 'state': 'Scotland', 'stateName': 'No State', 'street': 'Station Road', 'streetId': 0}

Which is much better :)

LucidityCrash added a commit to LucidityCrash/WazeRouteCalculator that referenced this issue Jul 14, 2021
based on findings for issue kovacsbalu#57 updated the EU server to be
SearchServer/mozi
@kovacsbalu
Copy link
Owner

Hi @LucidityCrash , can you please -recheck with modified BASE_COORDS?
Search server URL is looks good for me.
https://www.waze.com/row-SearchServer/mozi?q=2+Station+Road%2C+Prestonpans%2C+UK&max_distance_kms=&lon=-0.12996785342692366&lat=51.46451800296184&format=PROTO_JSON_FULL

@LucidityCrash
Copy link
Author

Assuming I understand you correctly I set the BASE_COORDS for EU in WazeRouteCalculator.py to
'EU': {"lat": 51.46451800296184, "lon": -0.12996785342692366} and re-ran my tests and now get the same response with row-SearchServer/mozi as with SearchServer/mozi and the original BASE_COORDS.

Looks like those new BASE_COORDS are London compared to the origianals which are Budapest ?
So does this mean the BASE_COORDS should be updated for EU or is there a way of Overriding them ?

@kovacsbalu
Copy link
Owner

Yes, the original was Budapest, because I use this service with Hungarian addresses. :)
Probably you need to modify the code and allow to override BASE_COORDS.
You can test your search in https://www.waze.com/editor search field.

@LucidityCrash
Copy link
Author

Hmmm ... that is going to mean that the Home Assistant plugin is going to need work along side tha in order to be able to override the BASE_COORDS.

I wonder why the SearchServer/mozi path works "Properly" with the Budapest BASE_COORDS while the row-SearchServer/mozi path doesn't ?

@kovacsbalu
Copy link
Owner

I don'n know. I'm working on a new version which support custom base coord.
See #56
#56 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants