mkgmap --check-styles and line count

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

mkgmap --check-styles and line count

Bernd Weigelt
Hi

my style include a lot of rules like this:

highway=footway            [0x1200d resolution 23-23 continue]
highway=footway            [0x1100d resolution 24 continue]
highway=footway &
              (bicycle=designated |
               bicycle=permissive |
               bicycle=official |
               bicycle=yes)    [0x0a resolution 24 road_class=0 road_speed=1]
highway=footway        [0x0d resolution 24 road_class=0 road_speed=0]

IMHO mkgmap count four lines, is that correct?


now it is difficult to find the error, if the files includes up to 700 lines, i
think, there are some larger styles around the world
mkgmap tells:
Error in style: Error: (lines:393): Stack size is 0
but the line with the error is line 485 in the style file

my error was to use '[' instead '(' ;-)



Bernd



_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: mkgmap --check-styles and line count

Gerd Petermann
Hi Bernd,

please send the file with the error. I assume the line count is completely wrong
in case of these stack 0 errors.

Gerd

> From: [hidden email]

> To: [hidden email]
> Date: Fri, 21 Mar 2014 20:11:14 +0100
> Subject: [mkgmap-dev] mkgmap --check-styles and line count
>
> Hi
>
> my style include a lot of rules like this:
>
> highway=footway [0x1200d resolution 23-23 continue]
> highway=footway [0x1100d resolution 24 continue]
> highway=footway &
> (bicycle=designated |
> bicycle=permissive |
> bicycle=official |
> bicycle=yes) [0x0a resolution 24 road_class=0 road_speed=1]
> highway=footway [0x0d resolution 24 road_class=0 road_speed=0]
>
> IMHO mkgmap count four lines, is that correct?
>
>
> now it is difficult to find the error, if the files includes up to 700 lines, i
> think, there are some larger styles around the world
> mkgmap tells:
> Error in style: Error: (lines:393): Stack size is 0
> but the line with the error is line 485 in the style file
>
> my error was to use '[' instead '(' ;-)
>
>
>
> Bernd
>
>
>
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: mkgmap --check-styles and line count

Carlos Dávila-2
In reply to this post by Bernd Weigelt
El 21/03/14 20:11, Bernd Weigelt escribió:

> Hi
>
> my style include a lot of rules like this:
>
> highway=footway            [0x1200d resolution 23-23 continue]
> highway=footway            [0x1100d resolution 24 continue]
> highway=footway &
>                (bicycle=designated |
>                 bicycle=permissive |
>                 bicycle=official |
>                 bicycle=yes)    [0x0a resolution 24 road_class=0 road_speed=1]
> highway=footway        [0x0d resolution 24 road_class=0 road_speed=0]
>
> IMHO mkgmap count four lines, is that correct?
>
>
> now it is difficult to find the error, if the files includes up to 700 lines, i
> think, there are some larger styles around the world
> mkgmap tells:
> Error in style: Error: (lines:393): Stack size is 0
> but the line with the error is line 485 in the style file
>
> my error was to use '[' instead '(' ;-)
>
>
>
> Bernd
>
>
>
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>
I have also seen this error in the line number recently, but the
difference was only 3 or 4 lines.
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: mkgmap --check-styles and line count

Bernd Weigelt
In reply to this post by Gerd Petermann
Am Freitag, 21. März 2014, 20:21:33 schrieb Gerd Petermann:
> please send the file with the error. I assume the line count is completely
> wrong in case of these stack 0 errors.
I have send the file in a PM

thx
Bernd
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: mkgmap --check-styles and line count

Gerd Petermann
In reply to this post by Bernd Weigelt
Hi Bernd,

the problem is caused by the empty lines in your style file and a
routine which tries to detect all kinds of line feed and carriage return combinations
(0x0a, 0x0d) as "end of line".
As a result, empty lines are not counted.

 @Steve: I know that this part in TokenScanner is critical, so I don't dare to change it:
        if (c == '\n' || c == '\r') {
            while ((c = readChar()) == '\n' || c == '\r')
                val.append(c);
..
}

Gerd


> From: [hidden email]

> To: [hidden email]
> Date: Fri, 21 Mar 2014 20:11:14 +0100
> Subject: [mkgmap-dev] mkgmap --check-styles and line count
>
> Hi
>
> my style include a lot of rules like this:
>
> highway=footway [0x1200d resolution 23-23 continue]
> highway=footway [0x1100d resolution 24 continue]
> highway=footway &
> (bicycle=designated |
> bicycle=permissive |
> bicycle=official |
> bicycle=yes) [0x0a resolution 24 road_class=0 road_speed=1]
> highway=footway [0x0d resolution 24 road_class=0 road_speed=0]
>
> IMHO mkgmap count four lines, is that correct?
>
>
> now it is difficult to find the error, if the files includes up to 700 lines, i
> think, there are some larger styles around the world
> mkgmap tells:
> Error in style: Error: (lines:393): Stack size is 0
> but the line with the error is line 485 in the style file
>
> my error was to use '[' instead '(' ;-)
>
>
>
> Bernd
>
>
>
> _______________________________________________
> mkgmap-dev mailing list
> [hidden email]
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: mkgmap --check-styles and line count

Steve Ratcliffe
Hi Gerd

> As a result, empty lines are not counted.
>
>   @Steve: I know that this part in TokenScanner is critical, so I don't
> dare to change it:
>          if (c == '\n' || c == '\r') {
>              while ((c = readChar()) == '\n' || c == '\r')
>                  val.append(c);
> ..
> }

Thanks, good catch. I shall fix it.

..Steve
_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
Reply | Threaded
Open this post in threaded view
|

Re: mkgmap --check-styles and line count

Steve Ratcliffe
In reply to this post by Gerd Petermann
Hi

>   @Steve: I know that this part in TokenScanner is critical, so I don't
> dare to change it:
>          if (c == '\n' || c == '\r') {
>              while ((c = readChar()) == '\n' || c == '\r')
>                  val.append(c);
> ..
> }

The attached patch fixes this, I believe.

..Steve


_______________________________________________
mkgmap-dev mailing list
[hidden email]
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

newline_count.patch (1K) Download Attachment