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

Add support to calculate routes with addresses in Brazil #60

Open
coelholm opened this issue Sep 29, 2021 · 2 comments
Open

Add support to calculate routes with addresses in Brazil #60

coelholm opened this issue Sep 29, 2021 · 2 comments

Comments

@coelholm
Copy link

Although it is possible to calculate distances using lat/long in Brazil with region AU, it is not possible to convert address to lat/long from AU region, without country information. Looks like issue is related to base coordinates. I have added BR with base coordinates and it works accordingly.

import WazeRouteCalculator
import logging

logger = logging.getLogger('WazeRouteCalculator.WazeRouteCalculator')
logger.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
logger.addHandler(handler)

# from_address = '-22.609454573, -43.179068844'
# to_address = '-22.902955752, -43.185864835'
from_address = 'rua sete de setembro,rio de janeiro'
to_address = 'avenida presidente vargas, rio de janeiro'
region = 'BR'
route = WazeRouteCalculator.WazeRouteCalculator(from_address, to_address, region)
route.calc_route_info()

Output

From: rua sete de setembro,rio de janeiro - to: avenida presidente vargas, rio de janeiro
Start coords: (-22.609454573, -43.179068844)
End coords: (-22.902955752, -43.185864835)
Time 53.87 minutes, distance 51.97 km.

Changing region to AU coordinates would be wrong

region = 'AU'

Output

From: rua sete de setembro,rio de janeiro - to: avenida presidente vargas, rio de janeiro
Start coords: (-34.84001541137695, 150.593994140625)
End coords: (-26.43230438232422, 133.2591094970703)
Time 1555.48 minutes, distance 2354.24 km.

I have submitted a pull request with this support to Brazil. #56 Add support to region BR

@lichessboy
Copy link

i have a simmilar issue in Australia, i have the region as 'AU', is that the problem?

Output
From: 1 Marita Road, Perth, WA - to: 1 North Street, Perth, WA Start coords: (-34.4881591796875, 150.90646362304688) End coords: (-31.931893945, 115.85721939) Time 2661.83 minutes, distance 4010.51 km.
this is incorrect because 1 northstreet is like 1KM from Marita Road so it makes no sense

Output
From: 1 Marita Road, Perth, WA - to: 5 Davies Road, Perth, WA Start coords: (-34.4881591796875, 150.90646362304688) End coords: (-34.4881591796875, 150.90646362304688) Time 0.23 minutes, distance 0.04 km.
this is actually correct,

Output
From: 182 Little Marine Parade, Perth, WA - to: 5 Davies Road, Perth, WA Start coords: (-27.988226795, 153.429991207) End coords: (-34.4881591796875, 150.90646362304688) Time 581.32 minutes, distance 952.95 km.

but this is also incorrect, as these places are also 5KM from each other, so i dont think the start coords are correct, cos 153 isnt the y coord of 182 Little Marine Parade.

how do i fix this issue, it seems like it is just getting the wrong place, is there anyway to ensure that this doesnt happen?
specifying the suburb ect. could potentially be done, but the suburbs are just randomly assigned in my data, with many of them just being 'suburb1', so if there are any other suggestions that would be easier as i have hundreds of addresses in my db.

@kovacsbalu
Copy link
Owner

@lichessboy please check #57 (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

3 participants