-
Notifications
You must be signed in to change notification settings - Fork 10
/
mkgmap_velomappatches.patch
350 lines (317 loc) · 15.3 KB
/
mkgmap_velomappatches.patch
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
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
Index: resources/LocatorConfig.xml
===================================================================
--- resources/LocatorConfig.xml (revision 1875)
+++ resources/LocatorConfig.xml (working copy)
@@ -62,6 +62,9 @@
<variant>Austria</variant>
<variant>AT</variant>
<variant>AUT</variant>
+ <variant>Oesterreich</variant>
+ <variant>Oestereich</variant>
+ <variant>Östereich</variant>
</country>
<country name="Azerbaijan" abr="AZE">
<variant>AZ</variant>
@@ -902,6 +905,7 @@
</country>
<country name="Schweiz" abr="CHE" geodb="1" poiDispFlag="0xc">
<variant>Switzerland</variant>
+ <variant>Suisse</variant>
<variant>CH</variant>
<variant>CHE</variant>
</country>
Index: src/uk/me/parabola/imgfmt/app/trergn/TREHeader.java
===================================================================
--- src/uk/me/parabola/imgfmt/app/trergn/TREHeader.java (revision 1875)
+++ src/uk/me/parabola/imgfmt/app/trergn/TREHeader.java (working copy)
@@ -43,7 +43,7 @@
// A map has a display priority that determines which map is on top
// when two maps cover the same area.
- private static final int DEFAULT_DISPLAY_PRIORITY = 0x19;
+ private static final int DEFAULT_DISPLAY_PRIORITY = 0x1F;
static final int MAP_LEVEL_REC_SIZE = 4;
private static final char POLYLINE_REC_LEN = 2;
@@ -172,7 +172,7 @@
writer.put(getPoiDisplayFlags());
writer.put3(displayPriority);
- writer.putInt(0x110301);
+ writer.putInt(0x170401);
writer.putChar((char) 1);
writer.put((byte) 0);
@@ -233,7 +233,7 @@
public void config(EnhancedProperties props) {
String key = "draw-priority";
if (props.containsKey(key))
- setDisplayPriority(props.getProperty(key, 0x19));
+ setDisplayPriority(props.getProperty(key, 0x1f));
if (props.containsKey("transparent"))
poiDisplayFlags |= POI_FLAG_TRANSPARENT;
Index: src/uk/me/parabola/mkgmap/build/MapBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/build/MapBuilder.java (revision 1875)
+++ src/uk/me/parabola/mkgmap/build/MapBuilder.java (working copy)
@@ -94,7 +94,7 @@
private static final int CLEAR_TOP_BITS = (32 - 15);
private static final int MIN_SIZE_LINE = 1;
- private static final int MIN_SIZE_POLYGON = 8;
+ private static final int MIN_SIZE_POLYGON = 15;
private final java.util.Map<MapPoint,POIRecord> poimap = new HashMap<MapPoint,POIRecord>();
private final java.util.Map<MapPoint,City> cityMap = new HashMap<MapPoint,City>();
@@ -114,6 +114,7 @@
private String regionAbbr;
private double reducePointError;
+ private double reducePointErrorPolygon;
private boolean mergeLines;
private int locationAutofillLevel;
@@ -135,6 +136,9 @@
regionName = props.getProperty("region-name", null);
regionAbbr = props.getProperty("region-abbr", null);
reducePointError = props.getProperty("reduce-point-density", 2.6);
+ reducePointErrorPolygon = props.getProperty("reduce-point-density-polygon", -1);
+ if (reducePointErrorPolygon == -1)
+ reducePointErrorPolygon = reducePointError;
mergeLines = props.containsKey("merge-lines");
makePOIIndex = props.getProperty("make-poi-index", false);
@@ -337,7 +341,10 @@
if(p.isExit()) {
processExit(map, (MapExitPoint)p);
}
- else if(!p.isCity() && !p.hasExtendedType() && (p.isRoadNamePOI() || poiAddresses)) {
+ else if(!p.isCity() && !p.hasExtendedType() && (p.isRoadNamePOI() || poiAddresses)
+ && ((p.getType() < 0x1c00) || (p.getType() >= 0x1d00))
+ && (p.getType() < 0x4100)) {
+
boolean doAutofill;
if(locationAutofillLevel > 0 || p.isRoadNamePOI())
doAutofill = true;
@@ -354,7 +361,7 @@
countryStr = locator.fixCountryString(countryStr);
boolean guessed = false;
- if(countryStr == null || regionStr == null || (zipStr == null && cityStr == null))
+ if((countryStr == null || regionStr == null || (zipStr == null && cityStr == null)) & p.getStreet() != null)
{
MapPoint nextCity = locator.findByCityName(p);
@@ -441,11 +448,6 @@
Label streetName = lbl.newLabel(p.getStreet());
r.setStreetName(streetName);
}
- else if (guessed && locationAutofillLevel > 0)
- {
- Label streetName = lbl.newLabel("FIX MY ADDRESS");
- r.setStreetName(streetName);
- }
if(p.getHouseNumber() != null)
{
@@ -698,9 +700,9 @@
//
// We use it to add copyright information that there is no room for
// elsewhere.
- map.addInfo("OSM Street map");
- map.addInfo("http://www.openstreetmap.org/");
- map.addInfo("Map data licenced under Creative Commons Attribution ShareAlike 2.0");
+ map.addInfo("Openmtbmap - CCBYSA 2.0 http://openmtbmap.org/");
+ map.addInfo("Map data from http://openstreetmap.org/");
+ map.addInfo("Map and Map data licenced under Creative Commons Attribution ShareAlike 2.0");
map.addInfo("http://creativecommons.org/licenses/by-sa/2.0/");
// Pad the version number with spaces so that version
@@ -709,12 +711,12 @@
map.addInfo("Map created with mkgmap-r"
+ String.format("%-10s", Version.VERSION));
- map.addInfo("Program released under the GPL");
+ map.addInfo("Mkgmap is released under the GPL");
// There has to be (at least) two copyright messages or else the map
// does not show up. The second one will be displayed at startup,
// although the conditions where that happens are not known.
- map.addCopyright("program licenced under GPL v2");
+ map.addCopyright("Map CCBYSA 2.0 by http://openmtbmap.org");
// This one gets shown when you switch on, so put the actual
// map copyright here.
@@ -879,7 +881,7 @@
//TODO: Maybe this is the wrong place to do merging.
// Maybe more efficient if merging before creating subdivisions.
- if (mergeLines && res < 24) {
+ if (mergeLines && res < 22) {
LineMergeFilter merger = new LineMergeFilter();
lines = merger.merge(lines);
}
@@ -930,8 +932,8 @@
filters.addFilter(new SizeFilter(MIN_SIZE_POLYGON));
//DouglasPeucker behaves at the moment not really optimal at low zooms, but acceptable.
//Is there an similar algorithm for polygons?
- if(reducePointError > 0)
- filters.addFilter(new DouglasPeuckerFilter(reducePointError));
+ if(reducePointErrorPolygon > 0)
+ filters.addFilter(new DouglasPeuckerFilter(reducePointErrorPolygon));
}
filters.addFilter(new PolygonSplitterFilter());
filters.addFilter(new RemoveEmpty());
Index: src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java (revision 1875)
+++ src/uk/me/parabola/mkgmap/combiners/GmapsuppBuilder.java (working copy)
@@ -78,7 +78,7 @@
public void init(CommandArgs args) {
areaName = args.get("area-name", null);
- mapsetName = args.get("mapset-name", "OSM map set");
+ mapsetName = args.get("mapset-name", "Openmtbmap mapset");
overallDescription = args.getDescription();
outputDir = args.getOutputDir();
}
Index: src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java (revision 1875)
+++ src/uk/me/parabola/mkgmap/combiners/NsisBuilder.java (working copy)
@@ -34,6 +34,7 @@
private String seriesName;
private String id;
private int productId;
+ private int familyIdd;
private boolean hasIndex;
private boolean hasTyp;
@@ -45,7 +46,8 @@
public void init(CommandArgs args) {
int familyId = args.get("family-id", CommandArgs.DEFAULT_FAMILYID);
productId = args.get("product-id", 1);
-
+ familyIdd = args.get("family-id", 1);
+
baseFilename = args.get("overview-mapname", "osmmap");
seriesName = args.get("series-name", "OSM map");
@@ -89,12 +91,17 @@
w = new FileWriter(Utils.joinPath(outputDir, nsisFilename));
PrintWriter pw = new PrintWriter(w);
- pw.format(Locale.ROOT, "!define DEFAULT_DIR \"C:\\Garmin\\Maps\\%s\"\n", seriesName);
+ pw.format(Locale.ROOT, "!define DEFAULT_DIR \"C:\\Garmin\\%s\"\n", seriesName);
pw.format(Locale.ROOT, "!define INSTALLER_DESCRIPTION \"%s\"\n", seriesName);
pw.format(Locale.ROOT, "!define INSTALLER_NAME \"%s\"\n", seriesName);
pw.format(Locale.ROOT, "!define MAPNAME \"%s\"\n", baseFilename);
+ pw.format(Locale.ROOT, "!define MAP_URL \"http://openmtbmap.org\"\n");
+ pw.format(Locale.ROOT, "!define MAP_COPYRIGHT \"Copyright (C) CCBYSA 2.0 http://openmtbmap.org\"\n");
+ pw.format(Locale.ROOT, "!define INSTALL_MSG \"This install wizard will guide you through the installation of the ${INSTALLER_DESCRIPTION} for Garmin Basecamp and Mapsource. The map you downloaded is copyrighted under CCBYSA 2.0 by ${MAP_URL}. It is recommended that you close all other applications before starting Setup. This will make it possible to update relevant system files without having to reboot your computer. If you paid something for Downloading this map, make use of your 14 day return right or other applicable rights and download the map directly from ${MAP_URL} Click Next to continue.\"\n");
+ pw.format(Locale.ROOT, "!define MUI_WELCOMEPAGE_TITLE \"${INSTALLER_DESCRIPTION} Setup\"\n");
+ pw.format(Locale.ROOT, "!define MUI_WELCOMEPAGE_TEXT \"${INSTALL_MSG}\"\n");
pw.format(Locale.ROOT, "!define PRODUCT_ID \"%s\"\n", productId);
- pw.format(Locale.ROOT, "!define REG_KEY \"%s\"\n", seriesName);
+ pw.format(Locale.ROOT, "!define REG_KEY \"FAMILY_%s\"\n", familyIdd);
pw.println();
pw.format(Locale.ROOT, "SetCompressor /SOLID lzma\n");
@@ -106,7 +113,7 @@
pw.format(Locale.ROOT, "; Installer pages\n");
pw.format(Locale.ROOT, "!insertmacro MUI_PAGE_WELCOME\n");
- pw.format(Locale.ROOT, "!insertmacro MUI_PAGE_LICENSE %s\n", licenseFilename);
+ pw.format(Locale.ROOT, "!insertmacro MUI_PAGE_LICENSE copyright.txt\n");
pw.format(Locale.ROOT, "!insertmacro MUI_PAGE_DIRECTORY\n");
pw.format(Locale.ROOT, "!insertmacro MUI_PAGE_INSTFILES\n");
pw.format(Locale.ROOT, "!insertmacro MUI_PAGE_FINISH\n");
@@ -122,12 +129,17 @@
pw.format(Locale.ROOT, "Name \"${INSTALLER_DESCRIPTION}\"\n");
pw.format(Locale.ROOT, "OutFile \"${INSTALLER_NAME}.exe\"\n");
pw.format(Locale.ROOT, "InstallDir \"${DEFAULT_DIR}\"\n");
+ pw.format(Locale.ROOT, "InstallDirRegKey HKLM \"SOFTWARE\\Garmin\\MapSource\\Families\\${REG_KEY}\\${PRODUCT_ID}\" \"LOC\"\n");
pw.println();
// Install files
pw.format(Locale.ROOT, "Section \"MainSection\" SectionMain\n");
pw.format(Locale.ROOT, " SetOutPath \"$INSTDIR\"\n");
pw.format(Locale.ROOT, " File \"${MAPNAME}.img\"\n");
+ pw.format(Locale.ROOT, " File \"*.txt\"\n");
+ pw.format(Locale.ROOT, " File \"*.bat\"\n");
+ pw.format(Locale.ROOT, " File \"*.TYP\"\n");
+ pw.format(Locale.ROOT, " File \"*.exe\"\n");
if (hasIndex) {
pw.format(Locale.ROOT, " File \"${MAPNAME}_mdr.img\"\n");
pw.format(Locale.ROOT, " File \"${MAPNAME}.mdx\"\n");
@@ -155,7 +167,8 @@
pw.format(Locale.ROOT, " WriteRegStr " + HKLM_FAMILIES + "\\${PRODUCT_ID}\" \"TDB\" \"$INSTDIR\\${MAPNAME}.tdb\"\n");
pw.println();
- pw.format(Locale.ROOT, " WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n");
+ // pw.format(Locale.ROOT, " WriteUninstaller \"$INSTDIR\\Uninstall.exe\"\n");
+ pw.format(Locale.ROOT, " WriteUninstaller \"$INSTDIR\\%s_Uninstall.exe\"\n", seriesName);
pw.println();
pw.format(Locale.ROOT, "SectionEnd\n");
pw.println();
@@ -163,6 +176,13 @@
// Un-install files
pw.format(Locale.ROOT, "Section \"Uninstall\"\n");
pw.format(Locale.ROOT, " Delete \"$INSTDIR\\${MAPNAME}.img\"\n");
+ pw.format(Locale.ROOT, " Delete \"$INSTDIR\\*.txt\"\n");
+ pw.format(Locale.ROOT, " Delete \"$INSTDIR\\*.bat\"\n");
+ pw.format(Locale.ROOT, " Delete \"$INSTDIR\\*.TYP\"\n");
+ pw.format(Locale.ROOT, " Delete \"$INSTDIR\\*.nsi\"\n");
+ pw.format(Locale.ROOT, " Delete \"$INSTDIR\\gmt.exe\"\n");
+ pw.format(Locale.ROOT, " Delete \"$INSTDIR\\${INSTALLER_NAME}.exe\"\n");
+
if (hasIndex) {
pw.format(Locale.ROOT, " Delete \"$INSTDIR\\${MAPNAME}_mdr.img\"\n");
pw.format(Locale.ROOT, " Delete \"$INSTDIR\\${MAPNAME}.mdx\"\n");
@@ -173,7 +193,8 @@
for (String file : mapList) {
pw.format(Locale.ROOT, " Delete \"$INSTDIR\\%s.img\"\n", file);
}
- pw.format(Locale.ROOT, " Delete \"$INSTDIR\\Uninstall.exe\"\n");
+ // pw.format(Locale.ROOT, " Delete \"$INSTDIR\\Uninstall.exe\"\n");
+ pw.format(Locale.ROOT, " Delete \"$INSTDIR\\%s_Uninstall.exe\"\n", seriesName);
pw.println();
pw.format(Locale.ROOT, " RmDir \"$INSTDIR\"\n");
@@ -212,10 +233,10 @@
w = new FileWriter(Utils.joinPath(outputDir, licenseFilename));
PrintWriter pw = new PrintWriter(w);
- pw.format(Locale.ROOT, "OSM Street map\n");
- pw.format(Locale.ROOT, "http://www.openstreetmap.org/\n");
+ pw.format(Locale.ROOT, "Openmtbmap.org Maps\n");
+ pw.format(Locale.ROOT, "http://www.openmtbmap.org/\n");
pw.println();
- pw.format(Locale.ROOT, "Map data licenced under Creative Commons Attribution ShareAlike 2.0\n");
+ pw.format(Locale.ROOT, "Map data licenced under Creative Commons Attribution ShareAlike 2.0 by http://openmtbmap.org\n");
pw.format(Locale.ROOT, "http://creativecommons.org/licenses/by-sa/2.0/\n");
pw.println();
pw.format(Locale.ROOT, "Map created with mkgmap-r" + Version.VERSION +"\n");
Index: src/uk/me/parabola/mkgmap/combiners/TdbBuilder.java
===================================================================
--- src/uk/me/parabola/mkgmap/combiners/TdbBuilder.java (revision 1875)
+++ src/uk/me/parabola/mkgmap/combiners/TdbBuilder.java (working copy)
@@ -65,8 +65,7 @@
* In other words if the same argument appears more than once, then it will
*/
public void init(CommandArgs args) {
- overviewMapname = args.get("overview-mapname", "osmmap");
- overviewMapnumber = args.get("overview-mapnumber", "63240000");
+ overviewMapname = args.get("overview-mapname", "Openmtbmap"); overviewMapnumber = args.get("overview-mapnumber", "63240000");
try {
parent = Integer.parseInt(overviewMapnumber);
@@ -80,8 +79,8 @@
int productId = args.get("product-id", 1);
short productVersion = (short)args.get("product-version", 100);
- String seriesName = args.get("series-name", "OSM map");
- String familyName = args.get("family-name", "OSM map");
+ String seriesName = args.get("series-name", "Openmtbmap");
+ String familyName = args.get("family-name", "Openmtbmap");
// Version 4 is the default. If you really want v3 then the tdb-v3
// option can be used.
Index: src/uk/me/parabola/mkgmap/filters/DouglasPeuckerFilter.java
===================================================================
--- src/uk/me/parabola/mkgmap/filters/DouglasPeuckerFilter.java (revision 1875)
+++ src/uk/me/parabola/mkgmap/filters/DouglasPeuckerFilter.java (working copy)
@@ -66,6 +66,7 @@
coords.addAll(points);
//#if (Node version)
+/*
//Don't touch Coords, which are nodes.
//So points at crossings will not be moved
// For now simplify all points, which are not nodes
@@ -86,13 +87,13 @@
}
// Simplify the rest
douglasPeucker(coords, 0, endIndex, maxErrorDistance);
-
+*/
//#else Straight version
//Do the douglasPeucker on the whole line.
//Deletes more points, but may lead to incorrect display of crossings at given high error distances
-/*
- douglasPeucker(coords, 0, n, maxErrorDistance);
- */
+
+ douglasPeucker(coords, 0, coords.size()-1, maxErrorDistance);
+
//#endif
MapLine newline = line.copy();