[mkgmap-dev] [PATCH] POI Address Support, Country Region Autofill
From Bernhard Heibler bernhard at heibler.de on Fri Feb 6 06:56:55 GMT 2009
Mark Burton schrieb: > One thing though, the region names are wrong for a large proportion of the > towns/villages/hamlets. Some are right, but a lot are wrong. How do you decide > where the regions are? > The algorithm works like this. 1. Step: Go through all cities an check if they have useful country region info The best case is if the tags is_in:country and is_in:county are present thats easy. Some cities have is_in information that can be used. I check for three different formats: County, State, Country, Continent County, State, Country Continent, Country, State, County, ... In "openGeoDb countries" this info is pretty reliable since it was imported from a external db into osm. Other countries have very sparse is_in info. All this cities that have such info will end up in "city" list. All which lack such information in "location" list. 2. Step: Go through the "location" list and check if the is_in info has some relations to the cities we have info about. Especially hamlets often have no full is_in information. They only have one entry in is_in that points to the city they belong to. I will check if I can find the name of this city in the "City" list. If there are more with the same name I use the closest one. If I can't find the exact name I use fuzzy name search. Thats a workaround for german umlaute since sometimes there are used in the tags and sometimes there are written as ue ae oe. I had a phonetic search in there but it was too fuzzy. 3. Step: Do the same like in step 2 once again. This is used to support at least one level of recursion in is_in relations. If there is still no info found I use brute force and use the information from the next city. Has to be used for countries with poor is_in tagging. I think I should add this description to the source code ... Thanks Berni.
- Previous message: [mkgmap-dev] [PATCH] POI Address Support, Country Region Autofill
- Next message: [mkgmap-dev] [PATCH] POI Address Support, Country Region Autofill
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the mkgmap-dev mailing list