File: address.txt

package info (click to toggle)
mkgmap 0.0.0%2Bsvn4905-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 12,032 kB
  • sloc: java: 73,856; xml: 1,695; python: 713; sh: 240; makefile: 149; perl: 31
file content (187 lines) | stat: -rw-r--r-- 8,557 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
= Address information =

Each POI (in the range 0x?? to 0x??) and street in mkgmap generated maps can have some additional attributes. They can be assigned in the style file by setting mkgmap special tags.

== POIs ==
Additional attributes for POIs can be used only for POIs with Garmin code 0x?? to 0x??. POIs in the extended range 0x???? to 0x???? do not support these additional attributes.

POIs can have the following attributes:
[options="header"]
|=========================================================
|Attribute |mkgmap tag |Example |Notes
|Name |name |Pizza Express |Name of the POI
|Country |mkgmap:country |GBR |Three letter ISO code, e.g. for GBR United Kingdom
|Region |mkgmap:region |Nottinghamshire |The regions name. Useful if there are multiple cities with the same name.
|City |mkgmap:city |Nottingham |
|Street |mkgmap:street |King Street |
|Housenumber |mkgmap:housenumber |20 |
|Zipcode |mkgmap:postal_code |NG1 2AS |
|Phone |mkgmap:phone |+44 115 999999 |Phone number in any format
|=========================================================

The additional information is displayed if the POI is selected. Only the name, city, region and country information is used for searching.

== Streets ==
Each street can have the following attributes:
[options="header"]
|=========================================================
|Attribute |mkgmap tag |Example |Notes
|Name |name |King Street |Street name
|Country |mkgmap:country |GBR |Three letter ISO code, e.g. for GBR United Kingdom
|Region |mkgmap:region |Nottinghamshire |The regions name. Useful if there are multiple cities with the same name.
|City |mkgmap:city |Nottingham |
|Zipcode |mkgmap:postal_code |NG1 2AS |
|=========================================================

== LocatorConfig.xml ==
The +LocatorConfig.xml+ config file contains information about all countries used by mkgmap. 

----
<country name="Schweiz" abr="CHE" streetBeforeHousenumber="true" postalcodeBeforeCity="true">
	<variant>Switzerland</variant>
	<variant>Suisse</variant>
	<variant>CH</variant>
	<variant>CHE</variant>
</country>
----

This includes the +name+ of the country and several of its +variants+. The ISO 3166-1 alpha 3 
(+abr+) code is used by mkgmap internally and in the style file to have a unique naming
of countries.

TIP: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-3[Wikipedia] has a list of all ISO 3166-1 alpha 3 codes

The two flags +streetBeforeHousenumber+ and +postalcodeBeforeCity+ determines the address order used on the GPS device.

== Assigning the mkgmap tags ==
The style file can be used to assign the special mkgmap tags listed above.

NOTE: All tags can be assigned without any restrictions but mkgmap performs some special processing for the +mkgmap:country+ tag. See chapter +Country names+ below.

A common set of address rules is located in the +inc/address+ file in the default style of mkgmap.
The tag mkgmap:execute_finalize_rules=true should be set for all objects that 
should be considered for address search but may not appear in the map:
addr:housenumber=* {set mkgmap:execute_finalize_rules=true}

You can also use the tag mkgmap:numbers=false to tell mkgmap
that a node or way should be excluded when calculating address information.

A common rule set to assign the +mkgmap:city+ tag looks like:
----
mkgmap:city!=* & mkgmap:admin_level8=* { set mkgmap:city='${mkgmap:admin_level8}' } 
mkgmap:city!=* & mkgmap:admin_level7=* { set mkgmap:city='${mkgmap:admin_level7}' } 
mkgmap:city!=* & is_in:city=* { set mkgmap:city='${is_in:city}' }
mkgmap:city!=* & addr:city=* { set mkgmap:city='${addr:city}' }
----

The first non empty tag of +mkgmap:admin_level8+, +mkgmap:admin_level7+, +is_in:city+ and +addr:city+ is used to assign the +mkgmap:city+ tag and
therefore the city name of the OSM element. 

Usually the +mkgmap:country+ tag should be assigned first. After that it is possible to have country specific rules.
----
mkgmap:country=CAN & mkgmap:region!=* & mkgmap:admin_level4=* { set mkgmap:region='${mkgmap:admin_level4}' }
----

=== Country names ===
Each country has a long name (United Kingdom) and the ISO 3166-1 alpha 3 code (GBR). 
To avoid a big diversity of combinations for one country (e.g. United Kingdom/GBR, Great Britain/GBR, England/GBR, etc.) 
mkgmap first converts the value of +mkgmap:country+ internally to the ISO code. The country name and all variants
from the +LocatorConfig.xml+ and country names in all languages from the preprocessed bounds are
used for this. 

.Evaluation of the long name
+mkgmap:country+ is empty::
    The value of the +country-name+ parameter is used as country name and the value of the +country-abbr+ parameter as three letter ISO code.   
Value of +mkgmap:country+ is unknown:: 
    In case the country name cannot be assigned to a known country the given country name is used and the +country-abbr+ parameter is used as three letter ISO code.
Preprocessed bounds are used::
    The long name of the country is retrieved by evaluating the +name-tag-list+ option on the country relation that is stored in the preprocessed bounds.
Preprocessed bounds are not used:: 
    The long name is taken from the +name+ attribute of the +LocatorConfig.xml+ entry.

== Preprocessed bounds ==
In OSM a reasonable number of POIs and streets are not tagged directly with all information required to fill the additional attributes. 
For example it is very uncommon to tag a street with the city and country name the street is located in. 

mkgmap uses so called preprocessed bounds files to provide a quick method assign the lies-in relationship for some hard wired tags:
* admin_level=2..11
* postal_code

TODO: Parameter, mkgmap tags
 
=== Creating preprocessed bounds ===
Preprocessing bounds is a procedure to extract and prepare all boundary and zip code data with from a large
OSM extract (like europe extract or asia extract). The data is prepared in such a format that mkgmap 
can read and process in a fast way while compiling maps.

Preprocessing consists of two (or three) steps:

. Extracting the required data from the large OSM extract
. Preprocessing the extract
. Eventually merge multiple preprocessed extracts 

==== Extracting data ====
The boundary and zip code data must be extracted from a large OSM extract to avoid excessive memory
requirements in the preprocessing step.

NOTE: This manual describes the usage of the two tools +osmconvert+ and +osmfilter+. The same can be achieved
with other tools like +osmosis+. 

[TIP] 
==========
+osmconvert+ http://wiki.openstreetmap.org/wiki/Osmconvert

+osmfilter+ http://wiki.openstreetmap.org/wiki/Osmfilter
==========


.Extract data from europe.osm.pbf
=================================
After download the OSM extract (europe.osm.pbf in this example) the extract must be converted
to o5m format. This o5m file is then filtered. 

 osmconvert europe.osm.pbf --out-o5m >europe.o5m
 osmfilter europe.o5m --keep-nodes= --keep-ways-relations="boundary=administrative =postal_code postal_code=" --out-o5m > europe-boundaries.o5m

=================================

==== Preprocessing data ====
The tool for preprocessing the boundary and zip code data is contained in the common mkgmap download.

.Preprocessing bounds data
=================================
 # The following should be all one line
 java -cp mkgmap.jar
      uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryPreprocessor
      europe-boundaries.o5m
      europe_bounds
=================================

This will create a directory called europe_bounds containing multiple files with preprocessed bounds.
This directory can be used with the bounds option on the mkgmap command line.


==== Merging preprocessed data ====
Preprocessing requires a quite high amount of memory, e.g. north- and south-america requires around 3 GB. So on many systems
it is not possible to preprocess the whole planet at once. It is possible to divide the planet into several parts where each country
must be contained completely in one of the parts. Parts should overlap.

Each part is preprocessed in its own directory which are merged as a third step.

.Merging preprocessed data
=================================
 # The following should be all one line
 java -cp mkgmap.jar 
     uk.me.parabola.mkgmap.reader.osm.boundary.BoundaryMerger 
     part1
     part2 
     merged
=================================

This command merges the preprocessed bounds from directory +part1+ and +part2+ into the new directory +merged+.

=== index parameter === 
TODO

=== location-autofill parameter ===
TODO