
Hi everyone! I wanted to start a new map from scratch - using the default style from mkgmap. So I copied the $mkgmap/examples/style/default/ folder to my working direktory. If I try to compile a map, mkgmap (r2504) crashes with a stack overflow: java.lang.StackOverflowError at java.io.UnixFileSystem.getBooleanAttributes0(Native Method) at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242) at java.io.File.isDirectory(File.java:799) at uk.me.parabola.mkgmap.osmstyle.StyleFileLoader.createStyleLoader(StyleFileLoader.java:56) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:133) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.readBaseStyle(StyleImpl.java:515) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.<init>(StyleImpl.java:141) The last two lines repeat a few hundred times. After exchanging the style with a style-set that works, the no errors occur and the map is generated as expected. Is there something wrong with the default style provided with the package (.tar.gz) or am I doing something wrong? Regards Steffen

Hi Steffen, the problem is caused by missing files which are included as base-styles. See default/info. I had the same problem and did not find out how to use them, so I commented the lines in info (I wanted to create a minimum style). I'll check tomorrow why this situation gives no useful error message. Gerd Steffen Breitbach wrote
Hi everyone!
I wanted to start a new map from scratch - using the default style from mkgmap. So I copied the $mkgmap/examples/style/default/ folder to my working direktory. If I try to compile a map, mkgmap (r2504) crashes with a stack overflow:
java.lang.StackOverflowError at java.io.UnixFileSystem.getBooleanAttributes0(Native Method) at java.io.UnixFileSystem.getBooleanAttributes(UnixFileSystem.java:242) at java.io.File.isDirectory(File.java:799) at uk.me.parabola.mkgmap.osmstyle.StyleFileLoader.createStyleLoader(StyleFileLoader.java:56) at uk.me.parabola.mkgmap.osmstyle.StyleImpl. <init> (StyleImpl.java:133) at uk.me.parabola.mkgmap.osmstyle.StyleImpl.readBaseStyle(StyleImpl.java:515) at uk.me.parabola.mkgmap.osmstyle.StyleImpl. <init> (StyleImpl.java:141)
The last two lines repeat a few hundred times.
After exchanging the style with a style-set that works, the no errors occur and the map is generated as expected.
Is there something wrong with the default style provided with the package (.tar.gz) or am I doing something wrong?
Regards Steffen _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Default-style-example-invalid-tp5751086p57510... Sent from the Mkgmap Development mailing list archive at Nabble.com.

Am 26.02.2013 20:54, schrieb GerdP:
Hi Steffen,
the problem is caused by missing files which are included as base-styles. See default/info. I had the same problem and did not find out how to use them, so I commented the lines in info
When I had this problem I extracted the referenced base-files from the jar File. ;-) Indeed this is something that should be documented much better. Chris

Hi
Indeed this is something that should be documented much better.
Well, its not really lack of documentation, its just broken ;) I will remove the example until we have something that works. The base-style declarations in the style need to be replaced with include file statements. ..Steve

Hi,
Indeed this is something that should be documented much better.
yes, base-style is not documented at all in the wiki, and I am not sure if it is still useful. reg. the error: r2508 and below ran into a loop searching for the base-style within the directory specified with --style-file, ending in an stackoverflow With r2509 I've added a check for that, but I am not 100% sure how base-style should work. Like others I wanted to create my own variabt of the default style by copying it: mkdir c:\mystyle xcopy /s d:\mkgmap\resources\styles\default c:\mystyle java -jar mkgmap.jar ... --style-file=c:\mystyle ... This will not work because the default style uses base-styles. So I tried mkdir c:\mystyles xcopy /s d:\mkgmap\resources\styles c:\mystyles xcopy /s d:\mkgmap\resources\styles\default c:\mystyles\mynicestyle java -jar mkgmap.jar ... --style-file=c:\mystyles\mynicestyle ... and that still did not work. One has to use java -jar mkgmap.jar ... --style-file=c:\mystyles --style=mynicestyle ... Is this the intended behaviour? If yes, the wiki should make this clear, but I'd prefer a default style that doesn't refer to other styles. Ciao, Gerd

Thanks everyone for looking into this! On 2013-02-27 11:32, Gerd Petermann wrote:
Is this the intended behaviour? If yes, the wiki should make this clear, but I'd prefer a default style that doesn't refer to other styles.
My initial intention was to get a default style to work with to create my own style. The idea was to use the very same style mkgmap would use if no style is set explicitly. I can't say anything about the expected behaviour of mkgmap, but I think one should be able to obtain the default style as a template, which should be the same the very build of mkgmap uses. I have a style now that works for me, but who knows, maybe I feel to start over from scratch some day ;-) Regards Steffen

Hi
yes, base-style is not documented at all in the wiki, and I am not sure if it is still useful.
In the real documentation (doc/style, http://www.mkgmap.org.uk/doc/pdf/style-manual.pdf) it says: base-style:: Do not use anymore. This was used to base a style on another one. However, it is bug prone and behaves in a way that is not intuitive without a good understanding of how things work. The preferred way to do this is to use the include mechanism.
One has to use java -jar mkgmap.jar ... --style-file=c:\mystyles --style=mynicestyle ...
Is this the intended behaviour? If yes, the wiki should make this clear, but I'd prefer a default style that doesn't refer to other styles.
Yes, the default style should be self contained. It is however a bug that you can't just do --style-file=c:\mystyles\mynicestyle but not one that I am going to fix since base-style is on its way out anyway. ..Steve

Hello I've removed base-style from the default style. I will remove it from the noname style too, but there is a bug to be fixed first. ..Steve

Hi Steve, just a question: Why are the rules into includes? I thought this makes only sense for rules that are common to e.g. points and lines ? Gerd
Date: Wed, 27 Feb 2013 21:45:00 +0000 From: steve@parabola.me.uk To: mkgmap-dev@lists.mkgmap.org.uk Subject: Re: [mkgmap-dev] Default style example invalid?
Hello
I've removed base-style from the default style. I will remove it from the noname style too, but there is a bug to be fixed first.
..Steve
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://lists.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

On 28/02/13 09:26, Gerd Petermann wrote:
just a question: Why are the rules into includes?
Its just copying the previous base-style layout.
I thought this makes only sense for rules that are common to e.g. points and lines ?
It makes sense in the same way that having a method that is only called from one place makes sense - it separates out common features and may make them easier to reuse in derived styles. In this actual case though, I don't think that there is much value in the current split since it is incomplete, so I am quite happy to in-line those again. ..Steve

Hi Steve, I agree in all points. Gerd Steve Ratcliffe wrote
On 28/02/13 09:26, Gerd Petermann wrote:
just a question: Why are the rules into includes?
Its just copying the previous base-style layout.
I thought this makes only sense for rules that are common to e.g. points and lines ?
It makes sense in the same way that having a method that is only called from one place makes sense - it separates out common features and may make them easier to reuse in derived styles.
In this actual case though, I don't think that there is much value in the current split since it is incomplete, so I am quite happy to in-line those again.
..Steve _______________________________________________ mkgmap-dev mailing list
mkgmap-dev@.org
-- View this message in context: http://gis.19327.n5.nabble.com/Default-style-example-invalid-tp5751086p57514... Sent from the Mkgmap Development mailing list archive at Nabble.com.

On Thu, Feb 28, 2013 at 02:17:58PM +0000, Steve Ratcliffe wrote:
In this actual case though, I don't think that there is much value in the current split since it is incomplete, so I am quite happy to in-line those again.
Yes, I guess we can inline the default style again. I wanted to make it modular so that you could choose which modules you want to include in the map (for example, if you do not want other landuse than waters). But, I do not seem to have the time or interest to do big changes any more, since I no longer use the Garmin maps myself (using OsmAnd instead). Furthermore, most of the time OSM seems to be good enough for me where I move (no need to update the maps often any more). I wonder if it would be feasible to write a backend for some open-source Android navigation application (I know, it could be a moving target). Perhaps we could cooperate with the OsmAnd team. The OsmAndMapCreator is horribly slow, and it seems to suffer from problems that we solved years ago. A recent example is failure to add all bus route ${ref} to the underlying ways. This was solved by the $(var) syntax in the relation 'apply' rule. Marko
participants (6)
-
chris66
-
Gerd Petermann
-
GerdP
-
Marko Mäkelä
-
Steffen Breitbach
-
Steve Ratcliffe