I generate my own garmin map files using mkgmap. I want to be able to search for addresses using postcodes in the uk. This data isn't widely entered on OSM and its not going to be until we get a paf file. However the office of national statistics publishes a postcode dump which would be sufficient for my purposes. Essentially I want to download the latest OSM data for the uk and the latest ons postcode file and combine them before putting through mkgmap. What is the best way to achieve this?

asked 05 Jun '14, 08:32

mcgin's gravatar image

mcgin
26112
accept rate: 0%


I would simply create two separate layers: one for the OSM data, the other for the ONS or CodePoint Open data. You can then merge these using the --gmapsupp flag of mkgmap.

The more difficult problem is exactly how to transform the Code Point Open data so as to be usable with a Garmin device. Simply ensuring every postcode is tagged in this way "addr:postcode=SW1A 1AA" may not be adequate for your purposes (I presume using postcodes as a geolocation code, as used in commercial satnavs is one use case).

I am not familiar with the status of the address branch of the mkgmap code.

Extending the postcode data to produce approximate locations for actual addresses is theoretically possible (use the 12 million addresses from Land Registry Prices Paid and those from the National Register of Social Housing: both are Open Data sets licensed under OGL), but there are problems in identifying how house numbers increment on particular road segments. Note that most of this latter aspect could be done with OpenData sets without having to use OSM. In the next few months it is likely that some of these data sets will be made available in a modified, and more useful form, on openaddresses.io

permanent link

answered 10 Jun '14, 19:06

SK53's gravatar image

SK53 ♦
22.3k46228350
accept rate: 20%

So it's the creation of that second layer that I'm after, is it simply another IMG file or what format does it need to be in?

(10 Jun '14, 20:52) mcgin
1

Yes just another img file, probably also created with the gmapsupp option (necessary if your source needs to be split into several files)

something like mkgmap --gmapsupp gb_osm_gmapsupp.img ons_gmapsupp.img

(10 Jun '14, 21:17) SK53 ♦

So the next question is how to convert the postcode file to an IMG file. I haven't seen any tools that do this, and I'm not sure what the format of the IMG file is in order to do it manually.

(10 Jun '14, 21:47) mcgin

You need it as an OSM XML file, so options might be ogr2ogr, QGIS (delimited text layer, save as an OGR compatible layer) & JOSM, or load into PostGIS and use SQL to transform to the snapshot schema format & Osmosis to read it into an OSM file. This may be best as a separate question.

(11 Jun '14, 07:54) SK53 ♦

Won't that result in negative ids in the OSM file as its not synced with the main OSM... Are negative ids even a problem?

(12 Jun '14, 06:26) mcgin

So anyway, 3 years ago someone asked a valid question. Pity there was no reply, as I'm in the same boat with no experience how to paddle.

I actually have a comma delimited file: lat, long, postcode, over 2.5 million entries.

I would reckon 85% are negative numbers, being UK postcodes. So if I subtracted these numbers from 360 degrees, would that work?

After that, then what would I do?

(08 Jul '17, 21:17) Me Again

No longitude is a negative number. And the reply I gave then is still valid now. Convert your file into a suitable OSM form & run mkgmap over the output.

(09 Jul '17, 12:48) SK53 ♦
showing 5 of 7 show 2 more comments
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×43
×30
×30

question asked: 05 Jun '14, 08:32

question was seen: 5,777 times

last updated: 09 Jul '17, 12:48

powered by OSQA