Re: [mkgmap-dev] More method options for is_in function

2020-02-13 Thread Arndt Röhrig


 
 
  
   Hi Ticker,
  
  
   
  
  
   thank you for help and sorry, i don´t remember that points include the access file. I move the is_in command to the line file.
  
  
   
  
  
   Now r4450 says 
  
  
   
  
  
   Error in style: Error: (lines:8): Expecting ), instead saw landuse
  
  
   
  
  
   I don´t understand that. Is that a mistake in my is_in command?
  
  
   
  
  
   highway=* & rad!=ja & laufen!=ja & tunnel!=* & bridge!=* & istdrin!=n & is_in(landuse,cemetery,all)=true {set istdrin=j}
  
  
   
  
  
   Greets
  
  
   
  
  
   Arndt
  
  
   
  
  
   
Ticker Berkin <
rwb-mkg...@jagit.co.uk> hat am 13. Februar 2020 um 10:26 geschrieben:
   
   

   
   

   
   
Hi Arndt
   
   

   
   
you have an include 'inc/access' in styles_base/points and
   
   
styles_gravel/points
   
   

   
   
which gives the error about unsupported options.
   
   

   
   
The crash is related: because the calls are textually identical, the
   
   
optimiser semi-tries to share them between points and lines processing,
   
   
it initializes one instance only, but later the correct ones are called
   
   
for the 2 contexts. I introduced this assertion error in the last
   
   
update to catch strange things like this happening. Before it would
   
   
have quietly returned "false"
   
   

   
   
Ticker
   
   

   
   

   
   
On Thu, 2020-02-13 at 06:37 +0100, Arndt Röhrig wrote:
   
   

 Hi Ticker,


 


 mkgmap tell me:


 


 6:33:39,37 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik


 Error in style: Error: (inc/access:73): Error: Third parameter 'all'


 of function is_in is not supported for this style section, valid are:


 [in, in_or_on, on]


 Error in style: Error: (inc/access:73): Error: Third parameter 'all'


 of function is_in is not supported for this style section, valid are:


 [in, in_or_on, on]


 Error in style: Error: (inc/access:73): Error: Third parameter 'all'


 of function is_in is not supported for this style section, valid are:


 [in, in_or_on, on]


 Error in style: Error: (inc/access:73): Error: Third parameter 'all'


 of function is_in is not supported for this style section, valid are:


 [in, in_or_on, on]


 Could not open style


 


 


 If i move the "is_in" command to the line file, mkgmap say:


 


 6:30:43,78 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik


 java.lang.AssertionError: invoked the non-augmented instance


 at


 uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(IsInFun


 ction.java:119)


 at


 uk.me.parabola.mkgmap.osmstyle.function.CachedFunction.value(CachedFu


 nction.java:61)


 at


 uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp.eval(EqualsOp.java:33)

   
   
...
   
   

   
   
___
   
   
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] More method options for is_in function

2020-02-13 Thread Gerd Petermann
Hi Ticker,

ah, yes, did not see the override. There is another caching mechanism in
RuleSet.resolveType(int cacheId, Element el, TypeResult result)
which might kick in. Not sure if this is relevant but you should be aware of it.

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Donnerstag, 13. Februar 2020 11:16
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Gerd

I overrode getCacheTag() to fix this aspect, and you overrode
toString() for something relating to the common sub-expressions; in
both cases including the 'kind' and all the parameters.

Yesterday, experimenting, I found it was consistent about create 2
instances, augmenting the same one twice and then using just that one
for the actual work, but this was when the calls were in the same
section. So, sometime I should investigate what happen when there valid
identical calls in 2 sections.

Ticker

On Thu, 2020-02-13 at 09:53 +, Gerd Petermann wrote:
> Hi Ticker,
>
> I think CachedFunction can't be used without changes. It uses
> getName() which just returns "is_in" (no parameters).
>
> Gerd
>
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Donnerstag, 13. Februar 2020 10:26
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
>
> Hi Arndt
>
> you have an include 'inc/access' in styles_base/points and
> styles_gravel/points
>
> which gives the error about unsupported options.
>
> The crash is related: because the calls are textually identical, the
> optimiser semi-tries to share them between points and lines
> processing,
> it initializes one instance only, but later the correct ones are
> called
> for the 2 contexts. I introduced this assertion error in the last
> update to catch strange things like this happening. Before it would
> have quietly returned "false"
>
> Ticker
>
>
> On Thu, 2020-02-13 at 06:37 +0100, Arndt Röhrig wrote:
> > Hi Ticker,
> >
> > mkgmap tell me:
> >
> > 6:33:39,37 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik
> > Error in style: Error: (inc/access:73): Error: Third parameter
> > 'all'
> > of function is_in is not supported for this style section, valid
> > are:
> > [in, in_or_on, on]
> > Error in style: Error: (inc/access:73): Error: Third parameter
> > 'all'
> > of function is_in is not supported for this style section, valid
> > are:
> > [in, in_or_on, on]
> > Error in style: Error: (inc/access:73): Error: Third parameter
> > 'all'
> > of function is_in is not supported for this style section, valid
> > are:
> > [in, in_or_on, on]
> > Error in style: Error: (inc/access:73): Error: Third parameter
> > 'all'
> > of function is_in is not supported for this style section, valid
> > are:
> > [in, in_or_on, on]
> > Could not open style
> >
> >
> > If i move the "is_in" command to the line file, mkgmap say:
> >
> > 6:30:43,78 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik
> > java.lang.AssertionError: invoked the non-augmented instance
> > at
> > uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(IsInF
> > un
> > ction.java:119)
> > at
> > uk.me.parabola.mkgmap.osmstyle.function.CachedFunction.value(Cached
> > Fu
> > nction.java:61)
> > at
> > uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp.eval(EqualsOp.java:33)
> ...
>
> ___
> 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] More method options for is_in function

2020-02-13 Thread Gerd Petermann
Hi Ticker,

I think CachedFunction can't be used without changes. It uses getName() which 
just returns "is_in" (no parameters).

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Donnerstag, 13. Februar 2020 10:26
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Arndt

you have an include 'inc/access' in styles_base/points and
styles_gravel/points

which gives the error about unsupported options.

The crash is related: because the calls are textually identical, the
optimiser semi-tries to share them between points and lines processing,
it initializes one instance only, but later the correct ones are called
for the 2 contexts. I introduced this assertion error in the last
update to catch strange things like this happening. Before it would
have quietly returned "false"

Ticker


On Thu, 2020-02-13 at 06:37 +0100, Arndt Röhrig wrote:
> Hi Ticker,
>
> mkgmap tell me:
>
> 6:33:39,37 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on]
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on]
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on]
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on]
> Could not open style
>
>
> If i move the "is_in" command to the line file, mkgmap say:
>
> 6:30:43,78 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik
> java.lang.AssertionError: invoked the non-augmented instance
> at
> uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(IsInFun
> ction.java:119)
> at
> uk.me.parabola.mkgmap.osmstyle.function.CachedFunction.value(CachedFu
> nction.java:61)
> at
> uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp.eval(EqualsOp.java:33)
...

___
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] More method options for is_in function

2020-02-13 Thread Ticker Berkin
Hi Arndt

you have an include 'inc/access' in styles_base/points and
styles_gravel/points

which gives the error about unsupported options.

The crash is related: because the calls are textually identical, the
optimiser semi-tries to share them between points and lines processing,
it initializes one instance only, but later the correct ones are called
for the 2 contexts. I introduced this assertion error in the last
update to catch strange things like this happening. Before it would
have quietly returned "false"

Ticker


On Thu, 2020-02-13 at 06:37 +0100, Arndt Röhrig wrote:
> Hi Ticker,
> 
> mkgmap tell me:
> 
> 6:33:39,37 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik 
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on] 
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on] 
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on] 
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported for this style section, valid are:
> [in, in_or_on, on] 
> Could not open style
> 
> 
> If i move the "is_in" command to the line file, mkgmap say:
> 
> 6:30:43,78 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik 
> java.lang.AssertionError: invoked the non-augmented instance 
> at
> uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(IsInFun
> ction.java:119) 
> at
> uk.me.parabola.mkgmap.osmstyle.function.CachedFunction.value(CachedFu
> nction.java:61) 
> at
> uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp.eval(EqualsOp.java:33) 
...

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

Re: [mkgmap-dev] More method options for is_in function

2020-02-12 Thread Arndt Röhrig


 
 
  
   Hi Ticker,
  
  
   
  
  
   mkgmap tell me:
  
  
   
  
  
   6:33:39,37 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik
   Error in style: Error: (inc/access:73): Error: Third parameter 'all' of function is_in is not supported for this style section, valid are: [in, in_or_on, on]
   Error in style: Error: (inc/access:73): Error: Third parameter 'all' of function is_in is not supported for this style section, valid are: [in, in_or_on, on]
   Error in style: Error: (inc/access:73): Error: Third parameter 'all' of function is_in is not supported for this style section, valid are: [in, in_or_on, on]
   Error in style: Error: (inc/access:73): Error: Third parameter 'all' of function is_in is not supported for this style section, valid are: [in, in_or_on, on]
   Could not open style
  
  
   
  
  
   
  
  
   If i move the "is_in" command to the line file, mkgmap say:
  
  
   
  
  
   6:30:43,78 - mkgmap .\tools\mkgmap-is-in-r4446 Speiche_Fabrik
   java.lang.AssertionError: invoked the non-augmented instance
   at uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(IsInFunction.java:119)
   at uk.me.parabola.mkgmap.osmstyle.function.CachedFunction.value(CachedFunction.java:61)
   at uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp.eval(EqualsOp.java:33)
   at uk.me.parabola.mkgmap.osmstyle.eval.AbstractOp.eval(AbstractOp.java:123)
   at uk.me.parabola.mkgmap.osmstyle.eval.AndOp.eval(AndOp.java:45)
   at uk.me.parabola.mkgmap.osmstyle.eval.AndOp.eval(AndOp.java:45)
   at uk.me.parabola.mkgmap.osmstyle.ActionRule.resolveType(ActionRule.java:72)
   at uk.me.parabola.mkgmap.osmstyle.RuleSet.resolveType(RuleSet.java:97)
   at uk.me.parabola.mkgmap.osmstyle.StyledConverter.convertWay(StyledConverter.java:462)
   at uk.me.parabola.mkgmap.reader.osm.ElementSaver.convert(ElementSaver.java:243)
   at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.load(OsmMapDataSource.java:161)
   at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:154)
   at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:54)
   at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:291)
   at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:287)
   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   at java.base/java.lang.Thread.run(Thread.java:834)
   java.lang.AssertionError: invoked the non-augmented instance
   at uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(IsInFunction.java:119)
   at uk.me.parabola.mkgmap.osmstyle.function.CachedFunction.value(CachedFunction.java:61)
   at uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp.eval(EqualsOp.java:33)
   at uk.me.parabola.mkgmap.osmstyle.eval.AbstractOp.eval(AbstractOp.java:123)
   at uk.me.parabola.mkgmap.osmstyle.eval.AndOp.eval(AndOp.java:45)
   at uk.me.parabola.mkgmap.osmstyle.eval.AndOp.eval(AndOp.java:45)
   at uk.me.parabola.mkgmap.osmstyle.ActionRule.resolveType(ActionRule.java:72)
   at uk.me.parabola.mkgmap.osmstyle.RuleSet.resolveType(RuleSet.java:97)
   at uk.me.parabola.mkgmap.osmstyle.StyledConverter.convertWay(StyledConverter.java:462)
   at uk.me.parabola.mkgmap.reader.osm.ElementSaver.convert(ElementSaver.java:243)
   at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.load(OsmMapDataSource.java:161)
   at uk.me.parabola.mkgmap.main.MapMaker.loadFromFile(MapMaker.java:154)
   at uk.me.parabola.mkgmap.main.MapMaker.makeMap(MapMaker.java:54)
   at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:291)
   at uk.me.parabola.mkgmap.main.Main$1.call(Main.java:287)
   at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
   at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
   at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
   at java.base/java.lang.Thread.run(Thread.java:834)
   java.lang.AssertionError: invoked the non-augmented instance
   at uk.me.parabola.mkgmap.osmstyle.function.IsInFunction.calcImpl(IsInFunction.java:119)
   at uk.me.parabola.mkgmap.osmstyle.function.CachedFunction.value(CachedFunction.java:61)
   at uk.me.parabola.mkgmap.osmstyle.eval.EqualsOp.eval(EqualsOp.java:33)
   at uk.me.parabola.mkgmap.osmstyle.eval.AbstractOp.eval(AbstractOp.java:123)
   at uk.me.parabola.mkgmap.osmstyle.eval.AndOp.eval(AndOp.java:45)
   at uk.me.parabola.mkgmap.osmstyle.eval.AndOp.eval(AndOp.java:45)
   at uk.me.parabola.mkgmap.osmstyle.ActionRule.resolveType(ActionRule.java:72)
   at uk.me.parabola.mkgmap.osmstyle.RuleSet.resolveType(RuleSet.java:97)
   at uk.me.parabola.mkgmap.osmstyle.StyledConverter.convertWay(StyledConverter.java:462)
   at uk.me.parabola.mkgmap.reader.osm.ElementSaver.convert(ElementSaver.java:243)
   at uk.me.parabola.mkgmap.reader.osm.OsmMapDataSource.load(OsmMapDataSource.java:161)
   at 

Re: [mkgmap-dev] More method options for is_in function

2020-02-12 Thread Ticker Berkin
Hi Arndt

Can you try http://www.mkgmap.org.uk/download/mkgmap-is-in-r4446.zip

If the method parameter isn't understood, it lists the acceptable
method parameters for the context (points/lines/polygons).

I couldn't reproduce the problem with the previous version I had, and I
couldn't see how the include should have effected anything.

Ticker

On Tue, 2020-02-11 at 19:23 +0100, Arndt Röhrig wrote:
> Hi Ticker,
> 
> i include "access" from lines. It´s one of the first lines.
> Move the is_in command to the line file, mkgmap runs without errors.
> But is_in doesn´t work.
> With r-4428 is the result OK.
> 
> (highway~'motorway|trunk|primary|secondary|tertiary|unclassified|mino
> r|residential|living_street|cycleway|steps') {set isin=n} 
> highway=* & rad!=ja & laufen!=ja & tunnel!=* & bridge!=* & isin!=n &
> is_in(landuse,cemetery,all)=true {set isin=j} 
> ...
> ...
> isin=j {set rad=nein}
> isin=j {set highway=tobadforbike}
> 
> Greets
> Arndt
> 
> P.S.
> My complete style is here:
> https://speichenkarte.de/ "Steuerdateien;
> 
> 
> > Ticker Berkin < rwb-mkg...@jagit.co.uk> hat am 11. Februar 2020 um
> > 16:01 geschrieben:
> > 
> > 
> > Hi Arndt
> > 
> > Are you including inc/access from points?
> > 
> > Ticker
> > 
> > On Tue, 2020-02-11 at 13:54 +0100, Arndt Röhrig wrote:
> > > Hi Ticker,
> > > 
> > > i get this:
> > > 
> > > 13:40:20,54 - mkgmap .\tools\mkgmap-is-in-r4443 Speiche_Fabrik
> > > Error in style: Error: (inc/access:73): Error: Third parameter
> > > 'all'
> > > of function is_in is not supported
> > > 
> > > Reason is, the is_in command is in the access-file :)
> > > 
> > > Thank you
> > > 
> > > Arndt
> > > 
> > > 
> > > 
> > > > Ticker Berkin < rwb-mkg...@jagit.co.uk> hat am 11. Februar 2020
> > > > um
> > > > 13:02 geschrieben:
> > > > 
> > > > 
> > > > Hi
> > > > 
> > > > I've started some initial documentation for this that will go
> > > > into
> > > > the
> > > > Style Manual.
> > > > 
> > > > The attached patch lists the options, but you might find it a
> > > > bit
> > > > unreadable.
> > > > 
> > > > With the next auto-build after this is applied, the updated
> > > > manual
> > > > appear in the branches download zip. @gerd: is this how it
> > > > happens?
> > > > 
> > > > But the simple answer to your question is, for a rule in
> > > > "lines" or
> > > > "polygons", what you have written will still work.
> > > > 
> > > > Ticker
> > > > 
> > > > On Tue, 2020-02-11 at 12:32 +0100, Arndt Röhrig wrote:
> > > > > Hi Gerd,
> > > > > 
> > > > > is_in(landuse,residential,all)=true
> > > > > 
> > > > > how do you write that now?
> > > > > 
> > > > > Greets
> > > > > Arndt
> > > > > 
> > > > > > Gerd Petermann < gpetermann_muenc...@hotmail.com> hat am
> > > > > > 10.
> > > > > > Februar 2020 um 14:14 geschrieben:
> > > > > > 
> > > > > > 
> > > > > > Hi all,
> > > > > > 
> > > > > > see
> > > > > > http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap
> > > > > > 
> > > > > > =4442
> > > > > > 
> > > > > > @Ticker:
> > > > > > I assume you are working on an alternative implementation
> > > > > > of
> > > > > > the
> > > > > > methods in IsInUtil?
> > > > > > If not I'd like to remove all the code duplication
> > > > > > introduced
> > > > > > with
> > > > > > the last patch.
> > > > > > 
> > > > > > Gerd
> > > > > > ___
> > > > > > 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
> ___
> 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] More method options for is_in function

2020-02-11 Thread Arndt Röhrig


 
 
  
   Hi Ticker,
  
  
   
  
  
   i include "access" from lines. It´s one of the first lines.
  
  
   Move the is_in command to the line file, mkgmap runs without errors. But is_in doesn´t work.
  
  
   With r-4428 is the result OK.
  
  
   
  
  
   
(highway~'motorway|trunk|primary|secondary|tertiary|unclassified|minor|residential|living_street|cycleway|steps') {set isin=n}
highway=* & rad!=ja & laufen!=ja & tunnel!=* & bridge!=* & isin!=n & is_in(landuse,cemetery,all)=true {set isin=j}
...
   
   
...
   
   
isin=j {set rad=nein}
   
  
  
   isin=j {set highway=tobadforbike}
  
  
   
  
  
   Greets
  
  
   Arndt
  
  
   
  
  
   P.S.
  
  
   My complete style is here:
  
  
   https://speichenkarte.de/ "Steuerdateien"
  
  
   
  
  
   
  
  
   
Ticker Berkin <
rwb-mkg...@jagit.co.uk> hat am 11. Februar 2020 um 16:01 geschrieben:
   
   

   
   

   
   
Hi Arndt
   
   

   
   
Are you including inc/access from points?
   
   

   
   
Ticker
   
   

   
   
On Tue, 2020-02-11 at 13:54 +0100, Arndt Röhrig wrote:
   
   

 Hi Ticker,


 


 i get this:


 


 13:40:20,54 - mkgmap .\tools\mkgmap-is-in-r4443 Speiche_Fabrik


 Error in style: Error: (inc/access:73): Error: Third parameter 'all'


 of function is_in is not supported


 


 Reason is, the is_in command is in the access-file :)


 


 Thank you


 


 Arndt


 


 


 


 
  Ticker Berkin < 
  rwb-mkg...@jagit.co.uk> hat am 11. Februar 2020 um
 
 
  13:02 geschrieben:
 
 
  
 
 
  
 
 
  Hi
 
 
  
 
 
  I've started some initial documentation for this that will go into
 
 
  the
 
 
  Style Manual.
 
 
  
 
 
  The attached patch lists the options, but you might find it a bit
 
 
  unreadable.
 
 
  
 
 
  With the next auto-build after this is applied, the updated manual
 
 
  appear in the branches download zip. @gerd: is this how it happens?
 
 
  
 
 
  But the simple answer to your question is, for a rule in "lines" or
 
 
  "polygons", what you have written will still work.
 
 
  
 
 
  Ticker
 
 
  
 
 
  On Tue, 2020-02-11 at 12:32 +0100, Arndt Röhrig wrote:
 
 
  
   Hi Gerd,
  
  
   
  
  
   is_in(landuse,residential,all)=true
  
  
   
  
  
   how do you write that now?
  
  
   
  
  
   Greets
  
  
   Arndt
  
  
   
  
  
   
Gerd Petermann < 
gpetermann_muenc...@hotmail.com> hat am 10.
   
   
Februar 2020 um 14:14 geschrieben:
   
   

   
   

   
   
Hi all,
   
   

   
   
see
   
   
http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap
   
   
=4442
   
   

   
   
@Ticker:
   
   
I assume you are working on an alternative implementation of
   
   
the
   
   
methods in IsInUtil?
   
   
If not I'd like to remove all the code duplication introduced
   
   
with
   
   
the last patch.
   
   

   
   
Gerd
   
   
___
   
   
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
   
   
 

___
mkgmap-dev mailing list

Re: [mkgmap-dev] More method options for is_in function

2020-02-11 Thread Ticker Berkin
Hi Arndt

Are you including inc/access from points?

Ticker

On Tue, 2020-02-11 at 13:54 +0100, Arndt Röhrig wrote:
> Hi Ticker,
> 
> i get this:
> 
> 13:40:20,54 - mkgmap .\tools\mkgmap-is-in-r4443 Speiche_Fabrik 
> Error in style: Error: (inc/access:73): Error: Third parameter 'all'
> of function is_in is not supported
> 
> Reason is, the is_in command is in the access-file :)
> 
> Thank you
> 
> Arndt
> 
> 
> 
> > Ticker Berkin < rwb-mkg...@jagit.co.uk> hat am 11. Februar 2020 um
> > 13:02 geschrieben:
> > 
> > 
> > Hi
> > 
> > I've started some initial documentation for this that will go into
> > the
> > Style Manual.
> > 
> > The attached patch lists the options, but you might find it a bit
> > unreadable.
> > 
> > With the next auto-build after this is applied, the updated manual
> > appear in the branches download zip. @gerd: is this how it happens?
> > 
> > But the simple answer to your question is, for a rule in "lines" or
> > "polygons", what you have written will still work.
> > 
> > Ticker
> > 
> > On Tue, 2020-02-11 at 12:32 +0100, Arndt Röhrig wrote:
> > > Hi Gerd,
> > > 
> > > is_in(landuse,residential,all)=true
> > > 
> > > how do you write that now?
> > > 
> > > Greets
> > > Arndt
> > > 
> > > > Gerd Petermann < gpetermann_muenc...@hotmail.com> hat am 10.
> > > > Februar 2020 um 14:14 geschrieben:
> > > > 
> > > > 
> > > > Hi all,
> > > > 
> > > > see 
> > > > http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap
> > > > =4442
> > > > 
> > > > @Ticker:
> > > > I assume you are working on an alternative implementation of
> > > > the
> > > > methods in IsInUtil?
> > > > If not I'd like to remove all the code duplication introduced
> > > > with
> > > > the last patch.
> > > > 
> > > > Gerd
> > > > ___
> > > > 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] More method options for is_in function

2020-02-11 Thread Arndt Röhrig


 
 
  
   Hi Ticker,
  
  
   
  
  
   i get this:
  
  
   
  
  
   13:40:20,54 - mkgmap .\tools\mkgmap-is-in-r4443 Speiche_Fabrik
   Error in style: Error: (inc/access:73): Error: Third parameter 'all' of function is_in is not supported
  
  
   
  
  
   Reason is, the is_in command is in the access-file :)
  
  
   
  
  
   Thank you
  
  
   
  
  
   Arndt
  
  
   
  
  
   
  
  
   
  
  
   
Ticker Berkin <
rwb-mkg...@jagit.co.uk> hat am 11. Februar 2020 um 13:02 geschrieben:
   
   

   
   

   
   
Hi
   
   

   
   
I've started some initial documentation for this that will go into the
   
   
Style Manual.
   
   

   
   
The attached patch lists the options, but you might find it a bit
   
   
unreadable.
   
   

   
   
With the next auto-build after this is applied, the updated manual
   
   
appear in the branches download zip. @gerd: is this how it happens?
   
   

   
   
But the simple answer to your question is, for a rule in "lines" or
   
   
"polygons", what you have written will still work.
   
   

   
   
Ticker
   
   

   
   
On Tue, 2020-02-11 at 12:32 +0100, Arndt Röhrig wrote:
   
   

 Hi Gerd,


 


 is_in(landuse,residential,all)=true


 


 how do you write that now?


 


 Greets


 Arndt


 


 
  Gerd Petermann < 
  gpetermann_muenc...@hotmail.com> hat am 10.
 
 
  Februar 2020 um 14:14 geschrieben:
 
 
  
 
 
  
 
 
  Hi all,
 
 
  
 
 
  see 
  http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap
 
 
  =4442
 
 
  
 
 
  @Ticker:
 
 
  I assume you are working on an alternative implementation of the
 
 
  methods in IsInUtil?
 
 
  If not I'd like to remove all the code duplication introduced with
 
 
  the last patch.
 
 
  
 
 
  Gerd
 
 
  ___
 
 
  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] More method options for is_in function

2020-02-11 Thread Ticker Berkin
Hi

I've started some initial documentation for this that will go into the
Style Manual.

The attached patch lists the options, but you might find it a bit
unreadable.

With the next auto-build after this is applied, the updated manual
appear in the branches download zip. @gerd: is this how it happens?

But the simple answer to your question is, for a rule in "lines" or
"polygons", what you have written will still work.

Ticker

On Tue, 2020-02-11 at 12:32 +0100, Arndt Röhrig wrote:
> Hi Gerd,
> 
> is_in(landuse,residential,all)=true
> 
> how do you write that now?
> 
> Greets 
> Arndt
> 
> > Gerd Petermann < gpetermann_muenc...@hotmail.com> hat am 10.
> > Februar 2020 um 14:14 geschrieben:
> > 
> > 
> > Hi all,
> > 
> > see http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap
> > =4442
> > 
> > @Ticker:
> > I assume you are working on an alternative implementation of the
> > methods in IsInUtil?
> > If not I'd like to remove all the code duplication introduced with
> > the last patch.
> > 
> > Gerd
> > ___
> > 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-devIndex: doc/styles/rules.txt
===
--- doc/styles/rules.txt	(revision 4443)
+++ doc/styles/rules.txt	(working copy)
@@ -282,6 +282,23 @@
 Retrieves the id of the OSM element. This can be useful for style debugging purposes. Note that due to internal changes like merging, cutting etc. 
 some element ids are changed and some have a faked id > 4611686018427387904.  
 
+|is_in(tag,value,method)   | x | x  |  |
++true+ if the element is in polygon(s) having the specified +tag+=+value+ according to the +method+, +false+ otherwise.
+The methods available depend to the Style section:
+"points":
+ +in+ - the Node is within a polygon.
+ +in_or_on+ - it is within or on the edge.
+ +on+ - it is on the edge.
+"lines":
+ +all+ - part of the Way is within the polygon(s), none is outside; it might touch an edge. 
+ +all_in_or_on+ - none is outside. This is useful for the negative - is_in(...,all_in_or_on)=false - for processing a line that is outside the polgon(s).
+ +on+ - it runs along the edge.
+ +any+ - part is within.
+ +any_in_or_on+ - part is within or in the edge.
+"polygons":
+ +all+ - all of the closed Way is within the polygon(s).
+ +any" - some is within.
+
 |
 
 The following rule matches for all service ways longer than 50m.
___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Re: [mkgmap-dev] More method options for is_in function

2020-02-11 Thread Ticker Berkin
Hi Gerd

OK - If we merge so that, for a node on a shared edge, is_in(...,on) is
false, then is_in(...,in) should be true, so must merge for this as
well.

Ticker

PS: please can you commit my previous patch so that I can do the next
stages

On Tue, 2020-02-11 at 10:16 +, Gerd Petermann wrote:
> Hi Ticker,
> 
> "but this isn't necessary for the IN/IN_OR_ON"
> Why not for IN?
> 
> Gerd
> 
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Dienstag, 11. Februar 2020 11:07
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
> 
> Hi Gerd
> 
> Case 1 looks like 2 independent polygons that happen to be touching.
> Before Wood2 is planted, Tree1 is on the edge of Wood1. Should
> mapping
> Wood2 change this state? - I don't know. If these get merged anyway
> to
> handle mp-cutting then we have forced the answer - it will no longer
> be
> ON.
> 
> Yes to the rest. POINT ON test should invoke merging, but this isn't
> necessary for the IN/IN_OR_ON
> 
> Ticker
> 
> 
> On Tue, 2020-02-11 at 09:43 +, Gerd Petermann wrote:
> > Hi Ticker,
> > 
> > I've attached a sample file. Assume point rule
> > natural=tree & isin(landuse,forest,ON)=true {...}
> > 
> > For me, tree1 is not ON, but IN, so result should be false
> > ON would be okay for tree2 and tree4
> > The node tree3 is obbiously IN but if multipolygon cutting devides
> > the mp exactly on the line it would be on two boundaries unless we
> > merge them again for the test.
> > 
> > Reg. performance it probably doesn't matter much, these cases are
> > rare and the point-in-polygon test is rather fast compared to the
> > line-in-polygon test.
> > 
> > Gerd
> > 
> > 
> > ____
> > Von: mkgmap-dev  im Auftrag
> > von Ticker Berkin 
> > Gesendet: Dienstag, 11. Februar 2020 10:05
> > An: Development list for mkgmap
> > Betreff: Re: [mkgmap-dev] More method options for is_in function
> > 
> > Hi Gerd
> > 
> > It's important to handle the polygons as merged for the LINE and
> > POLYGON processing, so that internal splitting by multi-polygon
> > processing doesn't affect the answer relating to ON queries. For
> > overlapping polygons, however, the ON query is ambiguous and I'm
> > not
> > sure how much effort it is worth taking to resolve it with respect
> > to
> > the edges of one polygon that are within the other.
> > 
> > I've just seen your next posting.
> > 
> > For POINTs: I agree, much the same as above applies to the ON
> > query.
> > 
> > So, we need to decide on the policy for ON queries relating to the
> > OSM
> > defined edges of one polygon within another polygon, or just ignore
> > the
> > issue on the grounds that the situation is unlikely and it is an
> > arbitr
> > ary decision anyway.
> > 
> > Ticker
> > 
> > On Tue, 2020-02-11 at 08:31 +, Gerd Petermann wrote:
> > > Hi Ticker,
> > > 
> > > my understanding is that is_in(.., 'on') returns true if the
> > > point
> > > is
> > > on the boundary, not in or out.
> > > With line and polygon rules we merge overlapping polygons before
> > > we
> > > test, so I tried to do something similar with points.
> > > 
> > > Gerd
> > > 
> > > 
> > > Von: mkgmap-dev  im
> > > Auftrag
> > > von Ticker Berkin 
> > > Gesendet: Dienstag, 11. Februar 2020 09:24
> > > An: Development list for mkgmap
> > > Betreff: Re: [mkgmap-dev] More method options for is_in function
> > > 
> > > Hi Gerd
> > > 
> > > Yes, overlapping polygons was the case I was thinking about. I'd
> > > say
> > > that is_in(.., 'on') should be true if ON the edge of one,
> > > regardless
> > > of being IN the other.
> > > 
> > > Can you commit my last change and then, if you are not changing
> > > IsInUtil at the moment, I'd like to move some of the code around.
> > > I'll
> > > also start some documentation for the Style Manual.
> > > 
> > > Ticker
> > > 
> > > On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> > > > Hi Ticker,
> > > > 
> > > > reg. POINT is_in(..., 'on') : You think about the case that a
> > > > point
> > > > is inside one polygon and on boundary of anoth

Re: [mkgmap-dev] More method options for is_in function

2020-02-11 Thread Arndt Röhrig


 
 
  
   Hi Gerd,
  
  
   
  
  
   is_in(landuse,residential,all)=true
  
  
   
  
  
   how do you write that now?
  
  
   
  
  
   Greets 
  
  
   Arndt
  
  
   
  
  
   
Gerd Petermann <
gpetermann_muenc...@hotmail.com> hat am 10. Februar 2020 um 14:14 geschrieben:
   
   

   
   

   
   
Hi all,
   
   

   
   
see 
http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=4442
   
   

   
   
@Ticker:
   
   
I assume you are working on an alternative implementation of the methods in IsInUtil?
   
   
If not I'd like to remove all the code duplication introduced with the last patch.
   
   

   
   
Gerd
   
   
___
   
   
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] More method options for is_in function

2020-02-11 Thread Gerd Petermann
Hi Ticker,

"but this isn't necessary for the IN/IN_OR_ON"
Why not for IN?

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Dienstag, 11. Februar 2020 11:07
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Gerd

Case 1 looks like 2 independent polygons that happen to be touching.
Before Wood2 is planted, Tree1 is on the edge of Wood1. Should mapping
Wood2 change this state? - I don't know. If these get merged anyway to
handle mp-cutting then we have forced the answer - it will no longer be
ON.

Yes to the rest. POINT ON test should invoke merging, but this isn't
necessary for the IN/IN_OR_ON

Ticker


On Tue, 2020-02-11 at 09:43 +, Gerd Petermann wrote:
> Hi Ticker,
>
> I've attached a sample file. Assume point rule
> natural=tree & isin(landuse,forest,ON)=true {...}
>
> For me, tree1 is not ON, but IN, so result should be false
> ON would be okay for tree2 and tree4
> The node tree3 is obbiously IN but if multipolygon cutting devides
> the mp exactly on the line it would be on two boundaries unless we
> merge them again for the test.
>
> Reg. performance it probably doesn't matter much, these cases are
> rare and the point-in-polygon test is rather fast compared to the
> line-in-polygon test.
>
> Gerd
>
>
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Dienstag, 11. Februar 2020 10:05
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
>
> Hi Gerd
>
> It's important to handle the polygons as merged for the LINE and
> POLYGON processing, so that internal splitting by multi-polygon
> processing doesn't affect the answer relating to ON queries. For
> overlapping polygons, however, the ON query is ambiguous and I'm not
> sure how much effort it is worth taking to resolve it with respect to
> the edges of one polygon that are within the other.
>
> I've just seen your next posting.
>
> For POINTs: I agree, much the same as above applies to the ON query.
>
> So, we need to decide on the policy for ON queries relating to the
> OSM
> defined edges of one polygon within another polygon, or just ignore
> the
> issue on the grounds that the situation is unlikely and it is an
> arbitr
> ary decision anyway.
>
> Ticker
>
> On Tue, 2020-02-11 at 08:31 +, Gerd Petermann wrote:
> > Hi Ticker,
> >
> > my understanding is that is_in(.., 'on') returns true if the point
> > is
> > on the boundary, not in or out.
> > With line and polygon rules we merge overlapping polygons before we
> > test, so I tried to do something similar with points.
> >
> > Gerd
> >
> > ____
> > Von: mkgmap-dev  im Auftrag
> > von Ticker Berkin 
> > Gesendet: Dienstag, 11. Februar 2020 09:24
> > An: Development list for mkgmap
> > Betreff: Re: [mkgmap-dev] More method options for is_in function
> >
> > Hi Gerd
> >
> > Yes, overlapping polygons was the case I was thinking about. I'd
> > say
> > that is_in(.., 'on') should be true if ON the edge of one,
> > regardless
> > of being IN the other.
> >
> > Can you commit my last change and then, if you are not changing
> > IsInUtil at the moment, I'd like to move some of the code around.
> > I'll
> > also start some documentation for the Style Manual.
> >
> > Ticker
> >
> > On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> > > Hi Ticker,
> > >
> > > reg. POINT is_in(..., 'on') : You think about the case that a
> > > point
> > > is inside one polygon and on boundary of another? Should not
> > > happen
> > > with correct OSM data but the question is also what result you
> > > want
> > > to get.
> > > reg. isComplete():
> > > This is about input data where not all coords are known and thus
> > > the
> > > geometry of the way is undefined. Should never happen with normal
> > > input.
> > > I am not sure but I think splitting at tile borders did not yet
> > > happen with the polygons, only the preparation is done by adding
> > > nodes at the tile border.
> > >
> > > Gerd
> > >
> > > 
> > > Von: mkgmap-dev  im
> > > Auftrag
> > > von Ticker Berkin 
> > > Gesendet: Montag, 10. Februar 2020 18:09
> > > An: Development list for mkgmap
> > > Betreff: Re: [mkgmap-dev] More method options for is_in function
> > 

Re: [mkgmap-dev] More method options for is_in function

2020-02-11 Thread Ticker Berkin
Hi Gerd

Case 1 looks like 2 independent polygons that happen to be touching.
Before Wood2 is planted, Tree1 is on the edge of Wood1. Should mapping
Wood2 change this state? - I don't know. If these get merged anyway to
handle mp-cutting then we have forced the answer - it will no longer be
ON.

Yes to the rest. POINT ON test should invoke merging, but this isn't
necessary for the IN/IN_OR_ON

Ticker
 

On Tue, 2020-02-11 at 09:43 +, Gerd Petermann wrote:
> Hi Ticker,
> 
> I've attached a sample file. Assume point rule
> natural=tree & isin(landuse,forest,ON)=true {...}
> 
> For me, tree1 is not ON, but IN, so result should be false
> ON would be okay for tree2 and tree4
> The node tree3 is obbiously IN but if multipolygon cutting devides
> the mp exactly on the line it would be on two boundaries unless we
> merge them again for the test.
> 
> Reg. performance it probably doesn't matter much, these cases are
> rare and the point-in-polygon test is rather fast compared to the
> line-in-polygon test.
> 
> Gerd
> 
> 
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Dienstag, 11. Februar 2020 10:05
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
> 
> Hi Gerd
> 
> It's important to handle the polygons as merged for the LINE and
> POLYGON processing, so that internal splitting by multi-polygon
> processing doesn't affect the answer relating to ON queries. For
> overlapping polygons, however, the ON query is ambiguous and I'm not
> sure how much effort it is worth taking to resolve it with respect to
> the edges of one polygon that are within the other.
> 
> I've just seen your next posting.
> 
> For POINTs: I agree, much the same as above applies to the ON query.
> 
> So, we need to decide on the policy for ON queries relating to the
> OSM
> defined edges of one polygon within another polygon, or just ignore
> the
> issue on the grounds that the situation is unlikely and it is an
> arbitr
> ary decision anyway.
> 
> Ticker
> 
> On Tue, 2020-02-11 at 08:31 +, Gerd Petermann wrote:
> > Hi Ticker,
> > 
> > my understanding is that is_in(.., 'on') returns true if the point
> > is
> > on the boundary, not in or out.
> > With line and polygon rules we merge overlapping polygons before we
> > test, so I tried to do something similar with points.
> > 
> > Gerd
> > 
> > ____________
> > Von: mkgmap-dev  im Auftrag
> > von Ticker Berkin 
> > Gesendet: Dienstag, 11. Februar 2020 09:24
> > An: Development list for mkgmap
> > Betreff: Re: [mkgmap-dev] More method options for is_in function
> > 
> > Hi Gerd
> > 
> > Yes, overlapping polygons was the case I was thinking about. I'd
> > say
> > that is_in(.., 'on') should be true if ON the edge of one,
> > regardless
> > of being IN the other.
> > 
> > Can you commit my last change and then, if you are not changing
> > IsInUtil at the moment, I'd like to move some of the code around.
> > I'll
> > also start some documentation for the Style Manual.
> > 
> > Ticker
> > 
> > On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> > > Hi Ticker,
> > > 
> > > reg. POINT is_in(..., 'on') : You think about the case that a
> > > point
> > > is inside one polygon and on boundary of another? Should not
> > > happen
> > > with correct OSM data but the question is also what result you
> > > want
> > > to get.
> > > reg. isComplete():
> > > This is about input data where not all coords are known and thus
> > > the
> > > geometry of the way is undefined. Should never happen with normal
> > > input.
> > > I am not sure but I think splitting at tile borders did not yet
> > > happen with the polygons, only the preparation is done by adding
> > > nodes at the tile border.
> > > 
> > > Gerd
> > > 
> > > 
> > > Von: mkgmap-dev  im
> > > Auftrag
> > > von Ticker Berkin 
> > > Gesendet: Montag, 10. Februar 2020 18:09
> > > An: Development list for mkgmap
> > > Betreff: Re: [mkgmap-dev] More method options for is_in function
> > > 
> > > Hi Gerd
> > > 
> > > I've re-implemented the POINT test within IsInFunction, using the
> > > stopping methods etc, which are now coded, but only relevant for
> > > this
> > > context at the moment. This implementat

Re: [mkgmap-dev] More method options for is_in function

2020-02-11 Thread Gerd Petermann
Hi Ticker,

I've attached a sample file. Assume point rule
natural=tree & isin(landuse,forest,ON)=true {...}

For me, tree1 is not ON, but IN, so result should be false
ON would be okay for tree2 and tree4
The node tree3 is obbiously IN but if multipolygon cutting devides the mp 
exactly on the line it would be on two boundaries unless we merge them again 
for the test.

Reg. performance it probably doesn't matter much, these cases are rare and the 
point-in-polygon test is rather fast compared to the line-in-polygon test.

Gerd



Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Dienstag, 11. Februar 2020 10:05
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Gerd

It's important to handle the polygons as merged for the LINE and
POLYGON processing, so that internal splitting by multi-polygon
processing doesn't affect the answer relating to ON queries. For
overlapping polygons, however, the ON query is ambiguous and I'm not
sure how much effort it is worth taking to resolve it with respect to
the edges of one polygon that are within the other.

I've just seen your next posting.

For POINTs: I agree, much the same as above applies to the ON query.

So, we need to decide on the policy for ON queries relating to the OSM
defined edges of one polygon within another polygon, or just ignore the
issue on the grounds that the situation is unlikely and it is an arbitr
ary decision anyway.

Ticker

On Tue, 2020-02-11 at 08:31 +, Gerd Petermann wrote:
> Hi Ticker,
>
> my understanding is that is_in(.., 'on') returns true if the point is
> on the boundary, not in or out.
> With line and polygon rules we merge overlapping polygons before we
> test, so I tried to do something similar with points.
>
> Gerd
>
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Dienstag, 11. Februar 2020 09:24
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
>
> Hi Gerd
>
> Yes, overlapping polygons was the case I was thinking about. I'd say
> that is_in(.., 'on') should be true if ON the edge of one, regardless
> of being IN the other.
>
> Can you commit my last change and then, if you are not changing
> IsInUtil at the moment, I'd like to move some of the code around.
> I'll
> also start some documentation for the Style Manual.
>
> Ticker
>
> On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> > Hi Ticker,
> >
> > reg. POINT is_in(..., 'on') : You think about the case that a point
> > is inside one polygon and on boundary of another? Should not happen
> > with correct OSM data but the question is also what result you want
> > to get.
> > reg. isComplete():
> > This is about input data where not all coords are known and thus
> > the
> > geometry of the way is undefined. Should never happen with normal
> > input.
> > I am not sure but I think splitting at tile borders did not yet
> > happen with the polygons, only the preparation is done by adding
> > nodes at the tile border.
> >
> > Gerd
> >
> > ________________
> > Von: mkgmap-dev  im Auftrag
> > von Ticker Berkin 
> > Gesendet: Montag, 10. Februar 2020 18:09
> > An: Development list for mkgmap
> > Betreff: Re: [mkgmap-dev] More method options for is_in function
> >
> > Hi Gerd
> >
> > I've re-implemented the POINT test within IsInFunction, using the
> > stopping methods etc, which are now coded, but only relevant for
> > this
> > context at the moment. This implementation has other advantage in
> > that
> > the method can control the onBoundary condition. Also the logic in
> > calcInsideness can give the wrong answer for POINT is_in(...,
> > 'on').
> >
> > I didn't want to change IsInUtil while you are working on it and
> > I'm
> > not sure yet of the best way to handle the LINE/POLYGON versions.
> >
> > There are a couple of aspects of these that occur to me:
> >
> > It would be clearer to test for kind=POINT/LINE/POLYGON etc rather
> > than
> > el instanceof.
> >
> > w.isComplete():
> > - Will this will cause different answers depending on tile
> > splitting,
> > or is the complete polygon represented; even the bits outside the
> > tile?
> > - The ANY methods should be processed and will be correct.
> >
> > Thanks for spotting my error with tstMethod.
> >
> > This patch also improves the method error message; listing the
> > possible
> > methods for the cont

Re: [mkgmap-dev] More method options for is_in function

2020-02-11 Thread Ticker Berkin
Hi Gerd

It's important to handle the polygons as merged for the LINE and
POLYGON processing, so that internal splitting by multi-polygon
processing doesn't affect the answer relating to ON queries. For
overlapping polygons, however, the ON query is ambiguous and I'm not
sure how much effort it is worth taking to resolve it with respect to
the edges of one polygon that are within the other.
 
I've just seen your next posting.

For POINTs: I agree, much the same as above applies to the ON query.

So, we need to decide on the policy for ON queries relating to the OSM
defined edges of one polygon within another polygon, or just ignore the
issue on the grounds that the situation is unlikely and it is an arbitr
ary decision anyway.

Ticker

On Tue, 2020-02-11 at 08:31 +, Gerd Petermann wrote:
> Hi Ticker,
> 
> my understanding is that is_in(.., 'on') returns true if the point is
> on the boundary, not in or out.
> With line and polygon rules we merge overlapping polygons before we
> test, so I tried to do something similar with points.
> 
> Gerd
> 
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Dienstag, 11. Februar 2020 09:24
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
> 
> Hi Gerd
> 
> Yes, overlapping polygons was the case I was thinking about. I'd say
> that is_in(.., 'on') should be true if ON the edge of one, regardless
> of being IN the other.
> 
> Can you commit my last change and then, if you are not changing
> IsInUtil at the moment, I'd like to move some of the code around.
> I'll
> also start some documentation for the Style Manual.
> 
> Ticker
> 
> On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> > Hi Ticker,
> > 
> > reg. POINT is_in(..., 'on') : You think about the case that a point
> > is inside one polygon and on boundary of another? Should not happen
> > with correct OSM data but the question is also what result you want
> > to get.
> > reg. isComplete():
> > This is about input data where not all coords are known and thus
> > the
> > geometry of the way is undefined. Should never happen with normal
> > input.
> > I am not sure but I think splitting at tile borders did not yet
> > happen with the polygons, only the preparation is done by adding
> > nodes at the tile border.
> > 
> > Gerd
> > 
> > ____________________
> > Von: mkgmap-dev  im Auftrag
> > von Ticker Berkin 
> > Gesendet: Montag, 10. Februar 2020 18:09
> > An: Development list for mkgmap
> > Betreff: Re: [mkgmap-dev] More method options for is_in function
> > 
> > Hi Gerd
> > 
> > I've re-implemented the POINT test within IsInFunction, using the
> > stopping methods etc, which are now coded, but only relevant for
> > this
> > context at the moment. This implementation has other advantage in
> > that
> > the method can control the onBoundary condition. Also the logic in
> > calcInsideness can give the wrong answer for POINT is_in(...,
> > 'on').
> > 
> > I didn't want to change IsInUtil while you are working on it and
> > I'm
> > not sure yet of the best way to handle the LINE/POLYGON versions.
> > 
> > There are a couple of aspects of these that occur to me:
> > 
> > It would be clearer to test for kind=POINT/LINE/POLYGON etc rather
> > than
> > el instanceof.
> > 
> > w.isComplete():
> > - Will this will cause different answers depending on tile
> > splitting,
> > or is the complete polygon represented; even the bits outside the
> > tile?
> > - The ANY methods should be processed and will be correct.
> > 
> > Thanks for spotting my error with tstMethod.
> > 
> > This patch also improves the method error message; listing the
> > possible
> > methods for the context.
> > 
> > Ticker
> > 
> > On Mon, 2020-02-10 at 13:14 +, Gerd Petermann wrote:
> > > Hi all,
> > > 
> > > see
> > > http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=4
> > > 44
> > > 2
> > > 
> > > @Ticker:
> > > I assume you are working on an alternative implementation of the
> > > methods in IsInUtil?
> > > If not I'd like to remove all the code duplication introduced
> > > with
> > > the last patch.
> > > 
> > > Gerd
> > > ___
> > > 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] More method options for is_in function

2020-02-11 Thread Gerd Petermann
Hi Ticker,

thinking again about it we should probably do this with points:
If point is and inside of any polygon but on boundary of more than one polygon, 
merge those and check if it is inside the merged area.

Gerd


Von: mkgmap-dev  im Auftrag von Gerd 
Petermann 
Gesendet: Dienstag, 11. Februar 2020 09:31
An: Ticker Berkin; Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Ticker,

my understanding is that is_in(.., 'on') returns true if the point is on the 
boundary, not in or out.
With line and polygon rules we merge overlapping polygons before we test, so I 
tried to do something similar with points.

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Dienstag, 11. Februar 2020 09:24
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Gerd

Yes, overlapping polygons was the case I was thinking about. I'd say
that is_in(.., 'on') should be true if ON the edge of one, regardless
of being IN the other.

Can you commit my last change and then, if you are not changing
IsInUtil at the moment, I'd like to move some of the code around. I'll
also start some documentation for the Style Manual.

Ticker

On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> Hi Ticker,
>
> reg. POINT is_in(..., 'on') : You think about the case that a point
> is inside one polygon and on boundary of another? Should not happen
> with correct OSM data but the question is also what result you want
> to get.
> reg. isComplete():
> This is about input data where not all coords are known and thus the
> geometry of the way is undefined. Should never happen with normal
> input.
> I am not sure but I think splitting at tile borders did not yet
> happen with the polygons, only the preparation is done by adding
> nodes at the tile border.
>
> Gerd
>
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Montag, 10. Februar 2020 18:09
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
>
> Hi Gerd
>
> I've re-implemented the POINT test within IsInFunction, using the
> stopping methods etc, which are now coded, but only relevant for this
> context at the moment. This implementation has other advantage in
> that
> the method can control the onBoundary condition. Also the logic in
> calcInsideness can give the wrong answer for POINT is_in(..., 'on').
>
> I didn't want to change IsInUtil while you are working on it and I'm
> not sure yet of the best way to handle the LINE/POLYGON versions.
>
> There are a couple of aspects of these that occur to me:
>
> It would be clearer to test for kind=POINT/LINE/POLYGON etc rather
> than
> el instanceof.
>
> w.isComplete():
> - Will this will cause different answers depending on tile splitting,
> or is the complete polygon represented; even the bits outside the
> tile?
> - The ANY methods should be processed and will be correct.
>
> Thanks for spotting my error with tstMethod.
>
> This patch also improves the method error message; listing the
> possible
> methods for the context.
>
> Ticker
>
> On Mon, 2020-02-10 at 13:14 +, Gerd Petermann wrote:
> > Hi all,
> >
> > see
> > http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=444
> > 2
> >
> > @Ticker:
> > I assume you are working on an alternative implementation of the
> > methods in IsInUtil?
> > If not I'd like to remove all the code duplication introduced with
> > the last patch.
> >
> > Gerd
> > ___
> > 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] More method options for is_in function

2020-02-11 Thread Gerd Petermann
Hi Ticker,

my understanding is that is_in(.., 'on') returns true if the point is on the 
boundary, not in or out.
With line and polygon rules we merge overlapping polygons before we test, so I 
tried to do something similar with points.

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Dienstag, 11. Februar 2020 09:24
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Gerd

Yes, overlapping polygons was the case I was thinking about. I'd say
that is_in(.., 'on') should be true if ON the edge of one, regardless
of being IN the other.

Can you commit my last change and then, if you are not changing
IsInUtil at the moment, I'd like to move some of the code around. I'll
also start some documentation for the Style Manual.

Ticker

On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> Hi Ticker,
>
> reg. POINT is_in(..., 'on') : You think about the case that a point
> is inside one polygon and on boundary of another? Should not happen
> with correct OSM data but the question is also what result you want
> to get.
> reg. isComplete():
> This is about input data where not all coords are known and thus the
> geometry of the way is undefined. Should never happen with normal
> input.
> I am not sure but I think splitting at tile borders did not yet
> happen with the polygons, only the preparation is done by adding
> nodes at the tile border.
>
> Gerd
>
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Montag, 10. Februar 2020 18:09
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
>
> Hi Gerd
>
> I've re-implemented the POINT test within IsInFunction, using the
> stopping methods etc, which are now coded, but only relevant for this
> context at the moment. This implementation has other advantage in
> that
> the method can control the onBoundary condition. Also the logic in
> calcInsideness can give the wrong answer for POINT is_in(..., 'on').
>
> I didn't want to change IsInUtil while you are working on it and I'm
> not sure yet of the best way to handle the LINE/POLYGON versions.
>
> There are a couple of aspects of these that occur to me:
>
> It would be clearer to test for kind=POINT/LINE/POLYGON etc rather
> than
> el instanceof.
>
> w.isComplete():
> - Will this will cause different answers depending on tile splitting,
> or is the complete polygon represented; even the bits outside the
> tile?
> - The ANY methods should be processed and will be correct.
>
> Thanks for spotting my error with tstMethod.
>
> This patch also improves the method error message; listing the
> possible
> methods for the context.
>
> Ticker
>
> On Mon, 2020-02-10 at 13:14 +, Gerd Petermann wrote:
> > Hi all,
> >
> > see
> > http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=444
> > 2
> >
> > @Ticker:
> > I assume you are working on an alternative implementation of the
> > methods in IsInUtil?
> > If not I'd like to remove all the code duplication introduced with
> > the last patch.
> >
> > Gerd
> > ___
> > 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] More method options for is_in function

2020-02-11 Thread Ticker Berkin
Hi Gerd

Yes, overlapping polygons was the case I was thinking about. I'd say
that is_in(.., 'on') should be true if ON the edge of one, regardless
of being IN the other.

Can you commit my last change and then, if you are not changing
IsInUtil at the moment, I'd like to move some of the code around. I'll
also start some documentation for the Style Manual.

Ticker

On Mon, 2020-02-10 at 18:48 +, Gerd Petermann wrote:
> Hi Ticker,
> 
> reg. POINT is_in(..., 'on') : You think about the case that a point
> is inside one polygon and on boundary of another? Should not happen
> with correct OSM data but the question is also what result you want
> to get.
> reg. isComplete():
> This is about input data where not all coords are known and thus the
> geometry of the way is undefined. Should never happen with normal
> input.
> I am not sure but I think splitting at tile borders did not yet
> happen with the polygons, only the preparation is done by adding
> nodes at the tile border.
> 
> Gerd
> 
> 
> Von: mkgmap-dev  im Auftrag
> von Ticker Berkin 
> Gesendet: Montag, 10. Februar 2020 18:09
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev] More method options for is_in function
> 
> Hi Gerd
> 
> I've re-implemented the POINT test within IsInFunction, using the
> stopping methods etc, which are now coded, but only relevant for this
> context at the moment. This implementation has other advantage in
> that
> the method can control the onBoundary condition. Also the logic in
> calcInsideness can give the wrong answer for POINT is_in(..., 'on').
> 
> I didn't want to change IsInUtil while you are working on it and I'm
> not sure yet of the best way to handle the LINE/POLYGON versions.
> 
> There are a couple of aspects of these that occur to me:
> 
> It would be clearer to test for kind=POINT/LINE/POLYGON etc rather
> than
> el instanceof.
> 
> w.isComplete():
> - Will this will cause different answers depending on tile splitting,
> or is the complete polygon represented; even the bits outside the
> tile?
> - The ANY methods should be processed and will be correct.
> 
> Thanks for spotting my error with tstMethod.
> 
> This patch also improves the method error message; listing the
> possible
> methods for the context.
> 
> Ticker
> 
> On Mon, 2020-02-10 at 13:14 +, Gerd Petermann wrote:
> > Hi all,
> > 
> > see
> > http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=444
> > 2
> > 
> > @Ticker:
> > I assume you are working on an alternative implementation of the
> > methods in IsInUtil?
> > If not I'd like to remove all the code duplication introduced with
> > the last patch.
> > 
> > Gerd
> > ___
> > 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] More method options for is_in function

2020-02-10 Thread Gerd Petermann
Hi Ticker,

reg. POINT is_in(..., 'on') : You think about the case that a point is inside 
one polygon and on boundary of another? Should not happen with correct OSM data 
but the question is also what result you want to get.
reg. isComplete():
This is about input data where not all coords are known and thus the geometry 
of the way is undefined. Should never happen with normal input.
I am not sure but I think splitting at tile borders did not yet happen with the 
polygons, only the preparation is done by adding nodes at the tile border.

Gerd


Von: mkgmap-dev  im Auftrag von Ticker 
Berkin 
Gesendet: Montag, 10. Februar 2020 18:09
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] More method options for is_in function

Hi Gerd

I've re-implemented the POINT test within IsInFunction, using the
stopping methods etc, which are now coded, but only relevant for this
context at the moment. This implementation has other advantage in that
the method can control the onBoundary condition. Also the logic in
calcInsideness can give the wrong answer for POINT is_in(..., 'on').

I didn't want to change IsInUtil while you are working on it and I'm
not sure yet of the best way to handle the LINE/POLYGON versions.

There are a couple of aspects of these that occur to me:

It would be clearer to test for kind=POINT/LINE/POLYGON etc rather than
el instanceof.

w.isComplete():
- Will this will cause different answers depending on tile splitting,
or is the complete polygon represented; even the bits outside the tile?
- The ANY methods should be processed and will be correct.

Thanks for spotting my error with tstMethod.

This patch also improves the method error message; listing the possible
methods for the context.

Ticker

On Mon, 2020-02-10 at 13:14 +, Gerd Petermann wrote:
> Hi all,
>
> see
> http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=4442
>
> @Ticker:
> I assume you are working on an alternative implementation of the
> methods in IsInUtil?
> If not I'd like to remove all the code duplication introduced with
> the last patch.
>
> Gerd
> ___
> 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] More method options for is_in function

2020-02-10 Thread Ticker Berkin
Hi Gerd

I've re-implemented the POINT test within IsInFunction, using the
stopping methods etc, which are now coded, but only relevant for this
context at the moment. This implementation has other advantage in that
the method can control the onBoundary condition. Also the logic in
calcInsideness can give the wrong answer for POINT is_in(..., 'on').

I didn't want to change IsInUtil while you are working on it and I'm
not sure yet of the best way to handle the LINE/POLYGON versions.

There are a couple of aspects of these that occur to me:

It would be clearer to test for kind=POINT/LINE/POLYGON etc rather than
el instanceof.

w.isComplete(): 
- Will this will cause different answers depending on tile splitting,
or is the complete polygon represented; even the bits outside the tile?
- The ANY methods should be processed and will be correct.

Thanks for spotting my error with tstMethod.

This patch also improves the method error message; listing the possible
methods for the context.

Ticker

On Mon, 2020-02-10 at 13:14 +, Gerd Petermann wrote:
> Hi all,
> 
> see 
> http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap=4442
> 
> @Ticker:
> I assume you are working on an alternative implementation of the
> methods in IsInUtil?
> If not I'd like to remove all the code duplication introduced with
> the last patch.
> 
> Gerd
> ___
> mkgmap-dev mailing list
> mkgmap-dev@lists.mkgmap.org.uk
> http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-devIndex: src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java
===
--- src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java	(revision 4443)
+++ src/uk/me/parabola/mkgmap/osmstyle/function/IsInFunction.java	(working copy)
@@ -21,6 +21,7 @@
 import java.util.stream.Collectors;
 
 import uk.me.parabola.imgfmt.app.Area;
+import uk.me.parabola.imgfmt.app.Coord;
 import uk.me.parabola.mkgmap.reader.osm.Element;
 import uk.me.parabola.mkgmap.reader.osm.ElementSaver;
 import uk.me.parabola.mkgmap.reader.osm.FeatureKind;
@@ -39,27 +40,33 @@
 public class IsInFunction extends StyleFunction {
 
 	private enum MethodArg {
-		// TODO: also maybe aliases, which flags can stop processing, etc
 
-		POINT_IN("in", FeatureKind.POINT),
-		POINT_IN_OR_ON("in_or_on", FeatureKind.POINT),
-		POINT_ON("on", FeatureKind.POINT),
+		//   can stop when: IN ON OUT
+		POINT_IN("in",FeatureKind.POINT,true,  false, false),
+		POINT_IN_OR_ON("in_or_on",FeatureKind.POINT,true,  true,  false),
+		POINT_ON("on",FeatureKind.POINT,false, true,  false),
 
-		LINE_SOME_IN_NONE_OUT("all", FeatureKind.POLYLINE),
-		LINE_ALL_IN_OR_ON("all_in_or_on", FeatureKind.POLYLINE),
-		LINE_ALL_ON("on", FeatureKind.POLYLINE),
-		LINE_ANY_IN("any", FeatureKind.POLYLINE),
-		LINE_ANY_IN_OR_ON("any_in_or_on", FeatureKind.POLYLINE),
+		LINE_SOME_IN_NONE_OUT("all",  FeatureKind.POLYLINE, false, false, true),
+		LINE_ALL_IN_OR_ON("all_in_or_on", FeatureKind.POLYLINE, false, false, true),
+		LINE_ALL_ON("on", FeatureKind.POLYLINE, true,  false, true),
+		LINE_ANY_IN("any",FeatureKind.POLYLINE, true,  false, false),
+		LINE_ANY_IN_OR_ON("any_in_or_on", FeatureKind.POLYLINE, true,  true,  false),
 
-		POLYGON_ALL("all", FeatureKind.POLYGON),
-		POLYGON_ANY("any", FeatureKind.POLYGON);
+		POLYGON_ALL("all",FeatureKind.POLYGON,  false, false, true),
+		POLYGON_ANY("any",FeatureKind.POLYGON,  true,  false, false);
 
 		private final String methodName;
 		private final FeatureKind kind;
+		private final boolean stopIn;
+		private final boolean stopOn;
+		private final boolean stopOut;
 
-		MethodArg(String methodName, FeatureKind kind) {
+		MethodArg(String methodName, FeatureKind kind, boolean stopIn, boolean stopOn, boolean stopOut) {
 			this.methodName = methodName;
 			this.kind = kind;
+			this.stopIn = stopIn;
+			this.stopOn = stopOn;
+			this.stopOut = stopOut;
 		}
 
 		public String toString() {
@@ -70,19 +77,14 @@
 			return kind;
 		}
 
-/*
-following 3 methods are not implement yet and not applicable to current interface of IsInUtil.calcInsideness
-An idea was that it would call setIn/On/Out and logic flags here would know if this was enough to
-determine the answer and stop further processing. probably with flag per IN/ON/OUT for each enum...
-*/
 		public boolean canStopIn() {
-			return false;
+			return stopIn;
 		}
 		public boolean canStopOn() {
-			return false;
+			return stopOn;
 		}
 		public boolean canStopOut() {
-			return false;
+			return stopOut;
 		}
 	}
 
@@ -96,10 +98,10 @@
 
 	public IsInFunction() {
 		super(null);
-		reqdNumParams = 3; // ??? maybe have something to indicate variable...
+		reqdNumParams = 3;
 		// 1: polygon tagName
 		// 2: value for above tag
-		// 3: method keyword, eg any, all, on...