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

open-cage-provider issue with adminLevels #1040

Open
amaneshi opened this issue Jan 21, 2020 · 3 comments
Open

open-cage-provider issue with adminLevels #1040

amaneshi opened this issue Jan 21, 2020 · 3 comments
Labels
bug

Comments

@amaneshi
Copy link

@amaneshi amaneshi commented Jan 21, 2020

In some cases provider don't return any adminLevels (empty list), but they should be there.
As example, if we try to reverse point (47.571109, 19.108676) we get address
"Budapest, Pajtás utca 2, 1046, Hungary"
without admin levels in parsed object.
But in original JSON response we have component item:
"region": "Central Hungary"
As I think, Regions should be admin level = 1.

@atymic atymic added the bug label Jan 21, 2020
@atymic
Copy link
Member

@atymic atymic commented Jan 21, 2020

Looking at the code, currently state is admin level one, and country is admin level two.

Can you post the full json response please?

@amaneshi
Copy link
Author

@amaneshi amaneshi commented Jan 22, 2020

Yes, I saw that two level in sources, but in my response there is none of them so temporary I add another case with "region". Full response too long to post here, if you want get it grab coordinates from first message and use it on OpenCage live demo page https://opencagedata.com/demo. Here is only components section of it (point of interest):

"components": {
        "ISO_3166-1_alpha-2": "HU",
        "ISO_3166-1_alpha-3": "HUN",
        "_category": "building",
        "_type": "building",
        "city": "Budapest",
        "city_district": "4th district",
        "continent": "Europe",
        "country": "Hungary",
        "country_code": "hu",
        "house_number": "2",
        "neighbourhood": "Szilaspatak-lakópark",
        "political_union": "European Union",
        "postcode": "1046",
        "region": "Central Hungary",
        "road": "Pajtás utca",
        "suburb": "Megyer"
      },
@jbelien
Copy link
Member

@jbelien jbelien commented Jan 22, 2020

Yeah, I think we really need to normalize our admin levels !
There is a discussion about it in my issue #852 (I still need to take care of it).

It was decided to have admin level 1 as "first-order civil entity below the country level".
So I think we should indeed fix the parseAdminsLevels() function in OpenCage provider !

Looking at an address in Belgium, I would say:

  1. state
  2. county (not country)
  3. town
  4. village

But there is not region in Belgian addresses in OpenCage apparently, so I don't know where to put it :P

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.