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

Village recognized as suburb: Grzybowo near Kołobrzeg #101

Closed
dbapl opened this issue Dec 13, 2013 · 7 comments
Closed

Village recognized as suburb: Grzybowo near Kołobrzeg #101

dbapl opened this issue Dec 13, 2013 · 7 comments

Comments

@dbapl
Copy link

dbapl commented Dec 13, 2013

In serach results it is returned with classification suburb which is wrong, it is independent village:
http://nominatim.openstreetmap.org/search.php?q=grzybowo%2C+ko%C5%82obrzeg&viewbox=15.43%2C54.18%2C15.55%2C54.14&polygon=1

@lonvia
Copy link
Member

lonvia commented Dec 15, 2013

Nominatim takes the classification from the admin_level=10 tag which in most countries means suburb. Poland seems to be an exception. We'd need country-specific mappings to get around that issue.

@dbapl
Copy link
Author

dbapl commented Jan 9, 2014

Where I can find it in source code?
I would like to fix that for Poland, but have no idea where to start.
Please point me in general direction.

@lonvia
Copy link
Member

lonvia commented Jan 9, 2014

That's rather tricky. The classification term is created by each website individually. Modifying the code in Nominatim, won't give you a different term on osm.org for example. Until that changes I doubt it is really worth special casing things like this.

@dbapl
Copy link
Author

dbapl commented Jan 9, 2014

In functions.sql code there is:

      NEW.rank_search := NEW.admin_level * 2;
      IF NEW.type = 'administrative' THEN
        NEW.rank_address := NEW.rank_search;
      ELSE
        NEW.rank_address := 0;
      END IF;

So rank_address = admin_level * 2
For village in Poland it will be rank_address = 10*2 = 20
But for village standard rank_address = 16.
rank_address = 20 is mapped to suburb, which gives us wrong results.

      ELSEIF NEW.type in ('village','hamlet','municipality','district','unincorporated_area','borough') THEN
        NEW.rank_search := 19;
        NEW.rank_address := 16;
      ELSEIF NEW.type in ('suburb','croft','subdivision','isolated_dwelling') THEN
        NEW.rank_search := 20;
        NEW.rank_address := NEW.rank_search;

I will just change admin_level * 2 to mapping used in Poland.
So when we compare them in relations it will match.
I will use this modification on our servers, just give me a clue if I am on right track.

@lonvia
Copy link
Member

lonvia commented Jan 10, 2014

That'll work as well. You can use NEW.calculated_country_code to figure out if an object is in Poland.

@dbapl
Copy link
Author

dbapl commented Jan 11, 2014

Thank you.

@lonvia
Copy link
Member

lonvia commented Aug 8, 2015

This is basically an issue of #213.

@lonvia lonvia closed this as completed Aug 8, 2015
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