Suggestions: improvements to mkgmap --style-file= and --list-styles options

1. Currently, if you invoke mkgmap with the --style-file= tag and point to a non-existent style file (or incorrect path), mkgmap continues regardless (and applies the inbuilt default style, afaict). Can I suggest a patch to mkgmap that at least makes it clear that no style file was found in this circumstance? Sadly I lack the programming skills to do this, but hopefully it's a relatively trivial thing to change. 2. Secondly it seems to me that mkgmap has three inbuilt styles (default, noname, test) that you cannot change by editing the files in the resources folder. Viz: as a new user, it confused me that I though was editing the points file in the resources/default folder and invoking mkgmap with --style=default I could not see any effect on the map output. By trial and error I found that only by specifying --style-file=resources/default when invoking mkgmap would my changes to the style file be reflected in the map. This implies to me that the "default" style rules must be inbuilt into mkgmap. Indeed, running java -jar mkgmap.jar --list-styles suggests that there are 3 different inbuilt styles. Because there was nothing to say otherwise, I had assumed that I could just invoke mkgmap with --style=default (having edited the style files in the resources/default folder) and directly affect the output map. It might therefore be less confusing to rename the subfolders in resources (or rename the output of --list-styles). Or best of all, make it clear in the documentation that mkgmap has inbuilt styles that you can see if you use --list-styles, but cannot edit. If you want to create your own style you need to edit the files in the resources folder and then invoke the file with --style-file= instead. Charlie

Charlie Ferrero <charlie@cferrero.net> writes:
1. Currently, if you invoke mkgmap with the --style-file= tag and point to a non-existent style file (or incorrect path), mkgmap continues regardless (and applies the inbuilt default style, afaict). Can I suggest a patch to mkgmap that at least makes it clear that no style file was found in this circumstance? Sadly I lack the programming skills to do this, but hopefully it's a relatively trivial thing to change.
I would be in favor of exiting with an error if anything goes wrong in finding the style file.
2. Secondly it seems to me that mkgmap has three inbuilt styles (default, noname, test) that you cannot change by editing the files in the resources folder.
Viz: as a new user, it confused me that I though was editing the points file in the resources/default folder and invoking mkgmap with --style=default I could not see any effect on the map output.
By trial and error I found that only by specifying --style-file=resources/default when invoking mkgmap would my changes to the style file be reflected in the map. This implies to me that the "default" style rules must be inbuilt into mkgmap. Indeed, running java -jar mkgmap.jar --list-styles suggests that there are 3 different inbuilt styles. Because there was nothing to say otherwise, I had assumed that I could just invoke mkgmap with --style=default (having edited the style files in the resources/default folder) and directly affect the output map.
It might therefore be less confusing to rename the subfolders in resources (or rename the output of --list-styles). Or best of all, make it clear in the documentation that mkgmap has inbuilt styles that you can see if you use --list-styles, but cannot edit. If you want to create your own style you need to edit the files in the resources folder and then invoke the file with --style-file= instead.
The resources/default folder is in fact the default style, but when you run mkgmap the style is read from the jar. So you have to rebuild a distribution with ant before you can use it. I will see about adding something to README.java and the options help file that explains this better. Perhaps by default mkgmap should print out what it's doing, where it read things from, and the style in use, maybe with a -q to suppress this. I prefer the more chatty output style of the splitter, but I realize preferences differ.

On 09/08/09 18:41, Charlie Ferrero wrote:
1. Currently, if you invoke mkgmap with the --style-file= tag and point to a non-existent style file (or incorrect path), mkgmap continues regardless (and applies the inbuilt default style, afaict). Can I suggest a patch to mkgmap that at least makes it clear that no style file was found in this circumstance? Sadly I lack the programming skills to do this, but hopefully it's a relatively trivial thing to change.
Yes this should be done. It has been requested once or twice before.
2. Secondly it seems to me that mkgmap has three inbuilt styles (default, noname, test) that you cannot change by editing the files in the resources folder.
Yes that is right. The resource directory is effectively source code and perhaps shouldn't be included. It is not required as everything in there that is required is inside the mkgmap.jar. Its a good source of examples I guess. You have worked it out perfectly correctly; the --style-file argument is to use styles that are external to the mkgmap.jar file and so not built in. ..Steve
participants (4)
-
Charlie Ferrero
-
Greg Troxel
-
Steve Ratcliffe
-
Valentijn Sessink