On Thu, Nov 24, Steve Ratcliffe wrote:
As well as being placed into the .img, all copyright messages are
collected, de-duplicated and placed into the .tdb file. You can
display all those copyright information in mapsource via
help-about-product info.
Doesn't work for me, at least with MapSource 6.15.7. Only the MapSource
copyright is shown, but not the ones of an installed map.
So I'd like to apply your patch but change the option wording to
'specify a copyright message for files that do not contain one'
or something like that.
Attached is the new patch from me, which is able to change both: the
copyright message for the device and what I call license text.
The first one works fine with my Garmin devices. Since my
Mapsource version doesn't display the license text, I'm not really
able to test that part. But by looking at the images with a hex
editor, it looks good, the new text ist there.
Thorsten
--
Thorsten Kukuk, Project Manager/Release Manager SLES
SUSE LINUX Products GmbH, Maxfeldstr. 5, D-90409 Nuernberg
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg)
Index: src/uk/me/parabola/mkgmap/build/MapBuilder.java
===
--- src/uk/me/parabola/mkgmap/build/MapBuilder.java (Revision 2109)
+++ src/uk/me/parabola/mkgmap/build/MapBuilder.java (Arbeitskopie)
@@ -21,6 +21,11 @@
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.IOException;
import uk.me.parabola.imgfmt.app.Coord;
import uk.me.parabola.imgfmt.app.Exit;
@@ -51,6 +56,7 @@
import uk.me.parabola.imgfmt.app.trergn.Subdivision;
import uk.me.parabola.imgfmt.app.trergn.TREFile;
import uk.me.parabola.imgfmt.app.trergn.Zoom;
+import uk.me.parabola.imgfmt.ExitException;
import uk.me.parabola.log.Logger;
import uk.me.parabola.mkgmap.Version;
import uk.me.parabola.mkgmap.filters.BaseFilter;
@@ -125,6 +131,8 @@
private LBLFile lblFile;
+ private String licenseFileName;
+
public MapBuilder() {
regionName = null;
locator = new Locator();
@@ -149,6 +157,8 @@
poiAddresses = false;
routeCenterBoundaryType = props.getProperty(route-center-boundary, 0);
+
+ licenseFileName = props.getProperty(license-file, null);
locator = new Locator(props);
}
@@ -695,19 +705,40 @@
//
// We use it to add copyright information that there is no room for
// elsewhere.
- map.addInfo(OpenStreetMap and contributors);
- map.addInfo(www.openstreetmap.org);
- map.addInfo(Map data licenced under Creative Commons Attribution ShareAlike 2.0);
- map.addInfo(http://creativecommons.org/licenses/by-sa/2.0/;);
+ if (licenseFileName != null) {
+ File file = new File(licenseFileName);
+ StringBuffer contents = new StringBuffer();
+ BufferedReader reader = null;
- // Pad the version number with spaces so that version
- // strings that are different lengths do not change the size and
- // offsets of the following sections.
- map.addInfo(Map created with mkgmap-r
+ try {
+ reader = new BufferedReader(new FileReader(file));
+ String text = null;
+
+ // repeat until all lines is read
+ while ((text = reader.readLine()) != null) {
+ map.addInfo(text);
+ }
+
+ reader.close();
+ } catch (FileNotFoundException e) {
+ throw new ExitException(Could not open license file + licenseFileName);
+ } catch (IOException e) {
+ throw new ExitException(Error reading license file + licenseFileName);
+ }
+ } else {
+ map.addInfo(OpenStreetMap and contributors);
+ map.addInfo(www.openstreetmap.org);
+ map.addInfo(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
+ // strings that are different lengths do not change the size and
+ // offsets of the following sections.
+ map.addInfo(Map created with mkgmap-r
+ String.format(%-10s, Version.VERSION));
- map.addInfo(Program released under the GPL);
-
+ map.addInfo(Program 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.
Index: src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java
===
--- src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java (Revision 2109)
+++ src/uk/me/parabola/mkgmap/reader/osm/OsmMapDataSource.java (Arbeitskopie)
@@ -112,10 +112,9 @@
* @return A list of copyright messages as a String array.
*/
public String[] copyrightMessages() {
- return new String[] {
-OpenStreetMap.org contributors,
-See: