Re: [mkgmap-dev] fixme rules

2017-03-08 Thread Gerd Petermann
Hi Andrzej,

if my assumption is right that mkgmp produces two different ways one can 
probably simple delete
the one that appears in the lines rules if no outlines are wanted. I'll check 
this again.

Gerd

Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Mittwoch, 8. März 2017 20:06:52
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] fixme rules

Hi Gerd,

I use rule for multipolygon, because it is convenient. Style already
include many tests for tag "area". In most cases there should be added
test for multipolygon, because multipolygon by default is area, so could
miss the tag. Single rule at the beginning corrects it all.

--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] fixme rules

2017-03-08 Thread Andrzej Popowski

Hi Gerd,

I use rule for multipolygon, because it is convenient. Style already 
include many tests for tag "area". In most cases there should be added 
test for multipolygon, because multipolygon by default is area, so could 
miss the tag. Single rule at the beginning corrects it all.


--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] ShapeMergeFilter bug

2017-03-08 Thread Gerd Petermann
Thanks Ticker,

committed in r3837

Gerd

Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Mittwoch, 8. März 2017 18:27:36
An: mkgmap development
Betreff: [mkgmap-dev] ShapeMergeFilter bug

Hi Gerd

around line 73, it need the addAll (or equivalent) line

if (usableShapes.size() < 2) {
mergedShapes.addAll(usableShapes);
return mergedShapes;
}

Ticker

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] Commit r3837: fix error in ShapeMergeFilter which can drop a shape

2017-03-08 Thread svn commit
Version mkgmap-r3837 was committed by gerd on Wed, 08 Mar 2017

fix error in ShapeMergeFilter which can drop a shape

- Ticker Berkin

http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=3837
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


[mkgmap-dev] ShapeMergeFilter bug

2017-03-08 Thread Ticker Berkin
Hi Gerd

around line 73, it need the addAll (or equivalent) line

if (usableShapes.size() < 2) {
mergedShapes.addAll(usableShapes);
return mergedShapes;
}

Ticker

___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] fixme rules

2017-03-08 Thread Gerd Petermann
Hi Andrzej,

one remark:
The tag mkgmap:mp_created is set for all ways created from mp-relations.
An additional tag mkgmap:stylefilter is set 
This tag is also used to decide which rules are used for the way:
mkgmap:stylefilter=polyline means: use only the lines rules
mkgmap:stylefilter=polygon means: use only the polygons rules

The comment in MultipolygonRelation.java says:
// Go through all original outer ways, create a copy, tag them
// with the mp tags and mark them only to be used for polyline 
processing
// This enables the style file to decide if the polygon 
information or
// the simple line information should be used.
I did not try, but If I got that right you should see two different ways for 
each outer way of a mp-relation.

Gerd

Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Dienstag, 7. März 2017 18:21:21
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: [mkgmap-dev] fixme rules

Hi,

there are some rules in include/name, designed to remove "fixme" value
from tags. Unfortunately they are executed too late for many cases, for
example for highway "name" and "ref".

I propose to add a file include/fixme to default style and include it at
the beginning of points, lines and polygon files. This file could
contain fixme rules and other rules, that are useful for all objects. I
have found these functions useful:
- fixme rules
- setting mkgmap:country tag,
- correction for multipolygon without area=yes
- forcing finalize stage for address

I have attached proposed patch to this mail. It duplicate some rules
from other includes, which could be removed there, but I haven't done it
yet.

--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] if-then-else in style and style options

2017-03-08 Thread Gerd Petermann
Hi Dave,

I prefer end to endif, but it would be easy to change that. I don't get the 
idea with else.
The implemented logic is that fori
f (a=b) then ...if-rules... else ...elserules... end
the term (a=b) is added to the if-rules and !(a=b) is added to the else-rules.

It seems you think of something like a switch-case-default statement ?

Gerd




Von: mkgmap-dev  im Auftrag von Dave 
Swarthout 
Gesendet: Mittwoch, 8. März 2017 09:54:29
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] if-then-else in style and style options

This is probably coming too late but I was going to suggest earlier that the 
"end" directive be changed to "endif" to be more consistent with other 
programming languages. I've been away from programming for a long time - many 
languages (Java, C++, PHP) seem to use braces to end a control loop nowadays. 
No big deal either way.

Also, in your example, would an "Else" directive before the "[0x1c resolution 
22]" the do the job? The program would still have to 'remember" that it was 
evaluating the "if " statement above, however.

Dave

On Wed, Mar 8, 2017 at 3:34 PM, Gerd Petermann 
mailto:gpetermann_muenc...@hotmail.com>> wrote:
It would not work because 1=1 is interpreted as
$1='1'
and that will probably not be true.
Same effect with '1' = '1' .

Maybe we can add a style function "true()" which always retrurns true for this?

Gerd

Von: mkgmap-dev 
mailto:mkgmap-dev-boun...@lists.mkgmap.org.uk>>
 im Auftrag von Ticker Berkin 
mailto:rwb-mkg...@jagit.co.uk>>
Gesendet: Mittwoch, 8. März 2017 09:25:34
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] if-then-else in style and style options

Hi

I think you should document that you need a dummy condition, ie

if (...) then
  1=1 {action}
  ...
  1=1 [0x1c ...]
end

(I assume this should work OK)

Ticker

On Wed, 2017-03-08 at 08:07 +, Gerd Petermann wrote:
> Hi all,
>
> while writing the documentation I noticed this possible problem case:
> The lines file in the default style contains these rules:
> boundary=administrative { name '${mkgmap:boundary_name}' }
> boundary=administrative & admin_level<3 [0x1e resolution 12]
> boundary=administrative & admin_level<5 [0x1d resolution 19]
> boundary=administrative & admin_level<7 [0x1c resolution 21]
> boundary=administrative & admin_level<9 [0x1c resolution 22]
> boundary=administrative [0x1c resolution 22]
>
> So, one may want to extract the clause boundary=administrative  like
> this:
> if (boundary=administrative) then
> { name '${mkgmap:boundary_name}' }
> admin_level<3 [0x1e resolution 12]
> admin_level<5 [0x1d resolution 19]
> admin_level<7 [0x1c resolution 21]
> admin_level<9 [0x1c resolution 22]
> [0x1c resolution 22]
> end
>
> The problem: It doesn't work because the lines
> { name '${mkgmap:boundary_name}' }
> and
> [0x1c resolution 22]
> are not a valid rules and the rule parser "forgets" that the
> boundary=administrative expression will be added.
>
> What do you think? Should mkgmap support this syntax?
>
> Gerd
> 
> Von: mkgmap-dev 
> mailto:mkgmap-dev-boun...@lists.mkgmap.org.uk>>
>  im Auftrag
> von Gerd Petermann 
> mailto:gpetermann_muenc...@hotmail.com>>
> Gesendet: Dienstag, 7. März 2017 20:10:52
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options
>
> Hi Andrzej,
>
> thanks, so I'll try to document the new syntax next.
>
> Gerd
> 
> Von: mkgmap-dev 
> mailto:mkgmap-dev-boun...@lists.mkgmap.org.uk>>
>  im Auftrag
> von Andrzej Popowski mailto:po...@poczta.onet.pl>>
> Gesendet: Dienstag, 7. März 2017 17:40:16
> An: mkgmap-dev@lists.mkgmap.org.uk
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options
>
> Hi Gerd,
>
> I have run some tests with current code and spotted no problems. I
> have
> tested both, if-then-else statement and style-option.
>
> --
> Best regards,
> Andrzej
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] if-then-else in style and style options

2017-03-08 Thread Dave Swarthout
This is probably coming too late but I was going to suggest earlier that
the "end" directive be changed to "endif" to be more consistent with other
programming languages. I've been away from programming for a long time -
many languages (Java, C++, PHP) seem to use braces to end a control loop
nowadays. No big deal either way.

Also, in your example, would an "Else" directive before the "[0x1c
resolution 22]" the do the job? The program would still have to 'remember"
that it was evaluating the "if " statement above, however.

Dave

On Wed, Mar 8, 2017 at 3:34 PM, Gerd Petermann <
gpetermann_muenc...@hotmail.com> wrote:

> It would not work because 1=1 is interpreted as
> $1='1'
> and that will probably not be true.
> Same effect with '1' = '1' .
>
> Maybe we can add a style function "true()" which always retrurns true for
> this?
>
> Gerd
> 
> Von: mkgmap-dev  im Auftrag von
> Ticker Berkin 
> Gesendet: Mittwoch, 8. März 2017 09:25:34
> An: mkgmap-dev@lists.mkgmap.org.uk
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options
>
> Hi
>
> I think you should document that you need a dummy condition, ie
>
> if (...) then
>   1=1 {action}
>   ...
>   1=1 [0x1c ...]
> end
>
> (I assume this should work OK)
>
> Ticker
>
> On Wed, 2017-03-08 at 08:07 +, Gerd Petermann wrote:
> > Hi all,
> >
> > while writing the documentation I noticed this possible problem case:
> > The lines file in the default style contains these rules:
> > boundary=administrative { name '${mkgmap:boundary_name}' }
> > boundary=administrative & admin_level<3 [0x1e resolution 12]
> > boundary=administrative & admin_level<5 [0x1d resolution 19]
> > boundary=administrative & admin_level<7 [0x1c resolution 21]
> > boundary=administrative & admin_level<9 [0x1c resolution 22]
> > boundary=administrative [0x1c resolution 22]
> >
> > So, one may want to extract the clause boundary=administrative  like
> > this:
> > if (boundary=administrative) then
> > { name '${mkgmap:boundary_name}' }
> > admin_level<3 [0x1e resolution 12]
> > admin_level<5 [0x1d resolution 19]
> > admin_level<7 [0x1c resolution 21]
> > admin_level<9 [0x1c resolution 22]
> > [0x1c resolution 22]
> > end
> >
> > The problem: It doesn't work because the lines
> > { name '${mkgmap:boundary_name}' }
> > and
> > [0x1c resolution 22]
> > are not a valid rules and the rule parser "forgets" that the
> > boundary=administrative expression will be added.
> >
> > What do you think? Should mkgmap support this syntax?
> >
> > Gerd
> > 
> > Von: mkgmap-dev  im Auftrag
> > von Gerd Petermann 
> > Gesendet: Dienstag, 7. März 2017 20:10:52
> > An: Development list for mkgmap
> > Betreff: Re: [mkgmap-dev] if-then-else in style and style options
> >
> > Hi Andrzej,
> >
> > thanks, so I'll try to document the new syntax next.
> >
> > Gerd
> > 
> > Von: mkgmap-dev  im Auftrag
> > von Andrzej Popowski 
> > Gesendet: Dienstag, 7. März 2017 17:40:16
> > An: mkgmap-dev@lists.mkgmap.org.uk
> > Betreff: Re: [mkgmap-dev] if-then-else in style and style options
> >
> > Hi Gerd,
> >
> > I have run some tests with current code and spotted no problems. I
> > have
> > tested both, if-then-else statement and style-option.
> >
> > --
> > Best regards,
> > Andrzej
> > ___
> > mkgmap-dev mailing list
> > mkgmap-dev@lists.mkgmap.org.uk
> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> > ___
> > mkgmap-dev mailing list
> > mkgmap-dev@lists.mkgmap.org.uk
> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> > ___
> > mkgmap-dev mailing list
> > mkgmap-dev@lists.mkgmap.org.uk
> > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
>



-- 
Dave Swarthout
Homer, Alaska
Chiang Mai, Thailand
Travel Blog at http://dswarthout.blogspot.com
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] if-then-else in style and style options

2017-03-08 Thread Gerd Petermann
It would not work because 1=1 is interpreted as
$1='1'
and that will probably not be true.
Same effect with '1' = '1' .

Maybe we can add a style function "true()" which always retrurns true for this?

Gerd

Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Mittwoch, 8. März 2017 09:25:34
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] if-then-else in style and style options

Hi

I think you should document that you need a dummy condition, ie

if (...) then
  1=1 {action}
  ...
  1=1 [0x1c ...]
end

(I assume this should work OK)

Ticker

On Wed, 2017-03-08 at 08:07 +, Gerd Petermann wrote:
> Hi all,
>
> while writing the documentation I noticed this possible problem case:
> The lines file in the default style contains these rules:
> boundary=administrative { name '${mkgmap:boundary_name}' }
> boundary=administrative & admin_level<3 [0x1e resolution 12]
> boundary=administrative & admin_level<5 [0x1d resolution 19]
> boundary=administrative & admin_level<7 [0x1c resolution 21]
> boundary=administrative & admin_level<9 [0x1c resolution 22]
> boundary=administrative [0x1c resolution 22]
>
> So, one may want to extract the clause boundary=administrative  like
> this:
> if (boundary=administrative) then
> { name '${mkgmap:boundary_name}' }
> admin_level<3 [0x1e resolution 12]
> admin_level<5 [0x1d resolution 19]
> admin_level<7 [0x1c resolution 21]
> admin_level<9 [0x1c resolution 22]
> [0x1c resolution 22]
> end
>
> The problem: It doesn't work because the lines
> { name '${mkgmap:boundary_name}' }
> and
> [0x1c resolution 22]
> are not a valid rules and the rule parser "forgets" that the
> boundary=administrative expression will be added.
>
> What do you think? Should mkgmap support this syntax?
>
> Gerd
> 
> Von: mkgmap-dev  im Auftrag
> von Gerd Petermann 
> Gesendet: Dienstag, 7. März 2017 20:10:52
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options
>
> Hi Andrzej,
>
> thanks, so I'll try to document the new syntax next.
>
> Gerd
> 
> Von: mkgmap-dev  im Auftrag
> von Andrzej Popowski 
> Gesendet: Dienstag, 7. März 2017 17:40:16
> An: mkgmap-dev@lists.mkgmap.org.uk
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options
>
> Hi Gerd,
>
> I have run some tests with current code and spotted no problems. I
> have
> tested both, if-then-else statement and style-option.
>
> --
> Best regards,
> Andrzej
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] if-then-else in style and style options

2017-03-08 Thread Ticker Berkin
Hi

I think you should document that you need a dummy condition, ie

if (...) then
  1=1 {action}
  ...
  1=1 [0x1c ...]
end

(I assume this should work OK)

Ticker

On Wed, 2017-03-08 at 08:07 +, Gerd Petermann wrote:
> Hi all,
> 
> while writing the documentation I noticed this possible problem case:
> The lines file in the default style contains these rules:
> boundary=administrative { name '${mkgmap:boundary_name}' }
> boundary=administrative & admin_level<3 [0x1e resolution 12]
> boundary=administrative & admin_level<5 [0x1d resolution 19]
> boundary=administrative & admin_level<7 [0x1c resolution 21]
> boundary=administrative & admin_level<9 [0x1c resolution 22]
> boundary=administrative [0x1c resolution 22]
> 
> So, one may want to extract the clause boundary=administrative  like
> this:
> if (boundary=administrative) then
> { name '${mkgmap:boundary_name}' }
> admin_level<3 [0x1e resolution 12]
> admin_level<5 [0x1d resolution 19]
> admin_level<7 [0x1c resolution 21]
> admin_level<9 [0x1c resolution 22]
> [0x1c resolution 22]
> end
> 
> The problem: It doesn't work because the lines
> { name '${mkgmap:boundary_name}' }
> and
> [0x1c resolution 22]
> are not a valid rules and the rule parser "forgets" that the
> boundary=administrative expression will be added.
> 
> What do you think? Should mkgmap support this syntax?
> 
> Gerd
> 
> Von: mkgmap-dev  im Auftrag
> von Gerd Petermann 
> Gesendet: Dienstag, 7. März 2017 20:10:52
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options
> 
> Hi Andrzej,
> 
> thanks, so I'll try to document the new syntax next.
> 
> Gerd
> 
> Von: mkgmap-dev  im Auftrag
> von Andrzej Popowski 
> Gesendet: Dienstag, 7. März 2017 17:40:16
> An: mkgmap-dev@lists.mkgmap.org.uk
> Betreff: Re: [mkgmap-dev] if-then-else in style and style options
> 
> Hi Gerd,
> 
> I have run some tests with current code and spotted no problems. I
> have
> tested both, if-then-else statement and style-option.
> 
> --
> Best regards,
> Andrzej
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] if-then-else in style and style options

2017-03-08 Thread Gerd Petermann
Hi all,

while writing the documentation I noticed this possible problem case:
The lines file in the default style contains these rules:
boundary=administrative { name '${mkgmap:boundary_name}' }
boundary=administrative & admin_level<3 [0x1e resolution 12]
boundary=administrative & admin_level<5 [0x1d resolution 19]
boundary=administrative & admin_level<7 [0x1c resolution 21]
boundary=administrative & admin_level<9 [0x1c resolution 22]
boundary=administrative [0x1c resolution 22]

So, one may want to extract the clause boundary=administrative  like this:
if (boundary=administrative) then
{ name '${mkgmap:boundary_name}' }
admin_level<3 [0x1e resolution 12]
admin_level<5 [0x1d resolution 19]
admin_level<7 [0x1c resolution 21]
admin_level<9 [0x1c resolution 22]
[0x1c resolution 22]
end

The problem: It doesn't work because the lines
{ name '${mkgmap:boundary_name}' }
and
[0x1c resolution 22]
are not a valid rules and the rule parser "forgets" that the 
boundary=administrative expression will be added.

What do you think? Should mkgmap support this syntax?

Gerd

Von: mkgmap-dev  im Auftrag von Gerd 
Petermann 
Gesendet: Dienstag, 7. März 2017 20:10:52
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] if-then-else in style and style options

Hi Andrzej,

thanks, so I'll try to document the new syntax next.

Gerd

Von: mkgmap-dev  im Auftrag von Andrzej 
Popowski 
Gesendet: Dienstag, 7. März 2017 17:40:16
An: mkgmap-dev@lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] if-then-else in style and style options

Hi Gerd,

I have run some tests with current code and spotted no problems. I have
tested both, if-then-else statement and style-option.

--
Best regards,
Andrzej
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev