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

issue with address_only? #160

Open
dpprdan opened this issue Jul 8, 2024 · 2 comments
Open

issue with address_only? #160

dpprdan opened this issue Jul 8, 2024 · 2 comments

Comments

@dpprdan
Copy link
Member

dpprdan commented Jul 8, 2024

@freyfogle I am seeing some diverging API responses to queries in the {opencage} tests. That by itself is not very surprising, considering that some tests are > 2 years old.

However, regarding the address_only parameter I am seeing some unexpected results:

  1. https://api.opencagedata.com/geocode/v1/json?q=47.21835%2C-1.55439&no_annotations=1&address_only=1&key=OPENCAGE_KEY returns "formatted": "Hôtel Rosmadec, Rue de la Commune, 44000 Nantes, France",
  2. similarly https://api.opencagedata.com/geocode/v1/json?q=34.05369%2C-118.242767&no_annotations=1&address_only=1&key=OPENCAGE_KEY returns "formatted": "Los Angeles City Hall, 200 North Spring Street, Los Angeles, CA 90012, United States of America",
  3. or https://api.opencagedata.com/geocode/v1/json?q=47.21947%2C-1.54754&no_annotations=1&address_only=1&key=OPENCAGE_KEY returns "formatted": "Le Palais, 37 Rue Gambetta, 44000 Nantes, France"

All three seem to contain a POI in the formatted field, which they shouldn't, I'd expect, because address_only=1.

Conversely there are some places where I would expect a POI, where there is none returned. E.g. judging from the {opencage} tests there was one at https://api.opencagedata.com/geocode/v1/json?q=47.21864%2C-1.554136&no_annotations=1&key=OPENCAGE_KEY (probably "Hôtel de Ville" or something similar), and for https://api.opencagedata.com/geocode/v1/json?q=47.21611%2C-1.54931&no_annotations=1&key=OPENCAGE_KEY I'd expect "Château des Ducs de Bretagne".

My expectations might be wrong, of course.

FWIW the "Goethes Gartenhaus" example from the API docs works as described there.

@freyfogle
Copy link
Contributor

many thanks for the detailed examples. Will investigate, but am on holiday this week, so may be a few days.

More soon

@freyfogle
Copy link
Contributor

Hi, finally had a chance to understand this in detail.

The issue is that in some building have commonly used names (and indeed in some parts of the world buildings have names and no numbers). So for example in this case "Los Angeles City Hall" is tagged in OSM as the name of the building (rather than, for example, being tagged something like office=Los Angeles City Hall. It is the same with the hotel in France. It is tagged as the name of the building rather than hotel=

We have now adapted our code so that if address_only=1 is set and we have a house number we just use the house number. Note though that the hotel at 47.21835, -1.55439 we do not have a building number, so we keep the building name in the address. If it is actually a working hotel it should be tagged a such. Possibly it once was a hotel, no longer is, but is still simply refered to as the hotel as its "address".

We have also clarified this in the documentation.

Thanks for the examples and making us aware of this issue.

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