osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.65k stars 1.02k forks source link

Add a optional download - UK postcodes #5497

Open ADepic opened 6 years ago

ADepic commented 6 years ago

When doing a offline search, many UK postcodes are missing, unless they are stored in OSM data. However, nominatim search somehow has all the postcodes, and it must be gettting them from somewhere.

After a bit of searching, I found that nominatim does get postcodes from externel data, and that data is freely available to download here: https://www.nominatim.org/data/gb_postcode_data.sql.gz It is a compressed 33mb file containing every used postcode in the UK. On each line there are three sets of data (id, postocde, geometry). This is an example: 2>> AB10 1AG 0101000020E6100000D4C563CFE6C500C02072705EF9924C40

As you can see "AB10 1AG" is the postcode, "2>>" is the ID and "0101000020E6100000D4C563CFE6C500C02072705EF9924C40" is the geometry allthough I do not know what it represents

I found this file and info in the nominatim documentation : https://nominatim.org/release-docs/develop/admin/Import-and-Update/#uk-postcodes

At the top of the file, it says this data is obtained from 2 sources: Ordnance Survey data and Royal Mail data.

If you can get this to work, then I think the best solution is to have UK postcodes as a separate downloadable file in the "other maps" section along with the Norway trondelag maps and prompt the user (just like the world basemap prompt) that he/she can download these postcodes he/she is downloading a UK map.

An example of a prompt would be:

Download UK postcodes

In many towns in the UK, many postcodes will be missing from the offline search. Do you want to download a list of UK postcodes so that when you do a offline search all postcodes will be available?

Download (33mb) | Later

thompehw commented 6 years ago

Harry van der Wolf made an excellent POI file for this. See https://groups.google.com/forum/#!topic/osmand/ZIDFWM50OW4 With the file installed, if you click the search icon and type the postcode into the "Type to search all" box (make sure there's a space between the two parts of the postcode), then it finds locations relatively quickly even if they're hundreds of miles from the current map centre. As the search proceeds, similar postcodes defined in OSM are usually displayed first, before being replaced at the top of the list by the correct one from the POI file with "User defined other postcode" beneath it.

JonnyTech commented 6 years ago

I too use https://github.com/hvdwolf/OsmAnd-UKpostcodes

gb-dursley commented 4 years ago

I too have now successfully used Harry van der Wolf's invaluable scripts. I did have a couple of problems which may trouble other users who use Linux (Mint 18.3 in my case):- Firstly OsmAndMapCreator/utilities crashed - .../OsmAndMapCreator/utilities.sh: line 12: java: command not found and running OsmAndMapCreator.sl , produced a similar error:- .../OsmAndMapCreator.sh: line 6: java: command not found I eventually worked out that this was caused by libcommons-logging-java being missing. Finding which package(s) this is part of was a nightmare, I eventually found checkstyle. Installing this with Package Manager enabled the .sh files to run and create the postcodes POI file without any further problems.

BUT then I found that after copying the POI file to the microSD card for my tablet, and then moving it under Android to the same folder as all the OsmAnd map files, OsmAnd didn't recognise it. Re-mounting the card on my Linux laptop, deleting all trace of the POI file and then copying it (under Linux) directly into the relevant folder on the card sorted this (permissions?) problem. OsmAnd now works a treat with every UK postcode that I've tried, including our own which TomTom struggles with.

jahed commented 1 year ago

It's been over 3 years since the last activity here so I'd like to bring this issue back up and highlight its importance.

Post codes are how a lot of us in the UK navigate, especially in cities like London. Everything else can be wrong, stale, missing and inaccurate, but post codes are generally a reliable way to narrow things down and get around. It's why almost all route planning and locator software ask for a post code first.

Needing to manually import and periodically update OBF files to get working post codes adds a barrier such that I can't recommend OsmAnd to anyone that isn't an OSM enthusiast, which is a shame.

OsmAnd is so close to being a perfect, offline replacement for Google Maps, especially for people without much data allowance. The other alternative is Organic Maps which has a similar issue: https://github.com/organicmaps/organicmaps/issues/717.