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

Improve address scoring in latlng_to_address() #16

Open
1 task
nexushoratio opened this issue Jan 1, 2024 · 2 comments
Open
1 task

Improve address scoring in latlng_to_address() #16

nexushoratio opened this issue Jan 1, 2024 · 2 comments

Comments

@nexushoratio
Copy link
Owner

nexushoratio commented Jan 1, 2024

I have at least one example where the reverse geocoding picks a really bad result.

https://developers.google.com/maps/documentation/geocoding/requests-reverse-geocoding

Right now we only allow a result_type of street_address, but with my example, premise is MUCH better. In particular, the good has a location_type of ROOFTOP while the other had RANGE_INTERPOLATED.

But, from a set of one, it is not yet possible to determine that premise is always better than street_address. More testing is needed.

Also, currently, scores are a simple summation of weights. A tuple-like solution would probably be better. Also, switch from a dictionary of weights to proper enums.

@nexushoratio nexushoratio self-assigned this Jan 1, 2024
@nexushoratio
Copy link
Owner Author

Sampling some places demonstrates that it is NOT straightforward in any way. For some, the plus_code was the best, others, premise, others street_address.

Each result also has a ['geometry']['location'] associate with it. Maybe picking the one that is closest to the original latlng is best? Or maybe the results array is already sorted and the best is the first element (though I was unable to find any documentation on this)?

Anyway, the only place that uses this information is when we generate a KML file for the optimal route, and we are unable to do that right now anyway because the old libraries no long exist.

Figuring out if closest result is best would currently depend on pyproj anyway, and that might go away with #14 .

So, this is a pretty low priority item at the moment.

@nexushoratio nexushoratio removed their assignment Jan 3, 2024
nexushoratio pushed a commit that referenced this issue Jan 4, 2024
@nexushoratio nexushoratio self-assigned this Dec 22, 2024
@nexushoratio
Copy link
Owner Author

A place like 38.455568,-122.497515 is interesting.

Some results have administrative_area_level_2, but not postal_code, while others are the opposite. None have both.

@nexushoratio nexushoratio removed their assignment Dec 22, 2024
nexushoratio pushed a commit that referenced this issue Jan 16, 2025
Since, with da87a9f, we now mix in values from other results, we are no longer
bound by selecting the best single value.

And for the case of 38.491493,-122.02494, which ends up stradling county
boundaries, the first value in the list is a good place to start.

Issue #16.
nexushoratio pushed a commit that referenced this issue Jan 30, 2025
Seeing cases where there is also a `plus_code` in the results, and tend to be
useless around boundaries, like for counties.

Issue #16.
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

1 participant