<!doctype html>
<html>
<head>
<meta charset="UTF-8">
</head>
<body>
<div>
Hi,
</div>
<div>
<br>
</div>
<div>
some ways are inside and outside a polygone. if the way is split at the border of the polygone, you get 2 ways, one complete in and one comlete out.
</div>
<div>
<br>
</div>
<div>
@gerd
</div>
<div>
y/n is better for the first understanding :)
</div>
<div>
<br>
</div>
<div>
Greets
</div>
<div>
Arndt
</div>
<blockquote type="cite">
<div>
Gerd Petermann <
<a href="mailto:gpetermann_muenchen@hotmail.com">gpetermann_muenchen@hotmail.com</a>> hat am 3. Februar 2020 um 15:58 geschrieben:
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
Hi all,
</div>
<div>
<br>
</div>
<div>
so far I got no further feedback reg. is_in results for nodes or polygons :(
</div>
<div>
<br>
</div>
<div>
Arndt wrote in a private mail that he would prefer a solution where the line or polygon is split so that the parts do not cross the boundary. If that's not possible he would be happy with the 001...111 solution.
</div>
<div>
<br>
</div>
<div>
Instead of is_in(x,y,any)=true you would write is_in(x,y) ~ '1..'
</div>
<div>
Instead of is_in(x,y,any)=false you would write is_in(x,y) ~ '0..'
</div>
<div>
Instead of is_in(x,y,all)=true you would write is_in(x,y) ~ '1.0'
</div>
<div>
Instead of is_in(x,y,all)=false you would write is_in(x,y) ~ '0..'
</div>
<div>
<br>
</div>
<div>
Or should I use y and n (yes/no) instead of 1 and 0 to make clear that these are flags and not numbers?
</div>
<div>
Probably easier to understand.
</div>
<div>
The problem regarding polygons which are inners of multipolygons would remain unsolved:
</div>
<div>
is_in(landuse,residential)='010' doesn't tell you if your polygon is on the outer ring or on the inner ring of a multipolygon, although inner is more likely.
</div>
<div>
<br>
</div>
<div>
Gerd
</div>
<div>
<br>
</div>
<div>
________________________________________
</div>
<div>
Von: mkgmap-dev <
<a href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk">mkgmap-dev-bounces@lists.mkgmap.org.uk</a>> im Auftrag von Gerd Petermann <
<a href="mailto:gpetermann_muenchen@hotmail.com">gpetermann_muenchen@hotmail.com</a>>
</div>
<div>
Gesendet: Donnerstag, 16. Januar 2020 11:21
</div>
<div>
An: Ticker Berkin; Development list for mkgmap
</div>
<div>
Betreff: Re: [mkgmap-dev] Branch is_in ready for a first test
</div>
<div>
<br>
</div>
<div>
Hi all,
</div>
<div>
<br>
</div>
<div>
For a single point we can compute 'inside', 'on boundary', or 'outside'.
</div>
<div>
<br>
</div>
<div>
reg. the results and the method options I thought about a very different alternative:
</div>
<div>
Instead of true or false the function might return a bit string containing three digits, e.g. 001
</div>
<div>
- 1st (leftmost) bit 0 means "no point inside found", 1 means "at least one point inside found"
</div>
<div>
- 2nd bit 0 means "no point on boundary found", 1 means "at least one point on boundary found"
</div>
<div>
- 3rd bit 0 means "no point outside found", 1 means "at least one point outside" found
</div>
<div>
We can describe 2^3 combinations with that, but obviously the combinations 000 and 101 are impossible, so we have the 6 cases on Tickers list
</div>
<div>
as
</div>
<div>
1: all of the line is outside the polygon -> 001
</div>
<div>
2: some of the line is outside and the rest touches or runs along the polygon edge -> 011
</div>
<div>
3: all of the line runs along the polygon edge -> 010
</div>
<div>
4: some of the line is inside and the rest touches or runs along -> 110
</div>
<div>
5: all of the line is inside the polygon 100
</div>
<div>
6: some is inside and some outside the polygon. Obviously some point is on -> 111
</div>
<div>
<br>
</div>
<div>
This would allow to remove the 3rd parameter, but user has to remember the order of the bits when writing the style rules.
</div>
<div>
<br>
</div>
<div>
Gerd
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
________________________________________
</div>
<div>
Von: mkgmap-dev <
<a href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk">mkgmap-dev-bounces@lists.mkgmap.org.uk</a>> im Auftrag von Ticker Berkin <
<a href="mailto:rwb-mkgmap@jagit.co.uk">rwb-mkgmap@jagit.co.uk</a>>
</div>
<div>
Gesendet: Donnerstag, 16. Januar 2020 10:48
</div>
<div>
An: Development list for mkgmap
</div>
<div>
Betreff: Re: [mkgmap-dev] Branch is_in ready for a first test
</div>
<div>
<br>
</div>
<div>
Hi
</div>
<div>
<br>
</div>
<div>
My earlier postings were to get an idea of what was wanted regarding
</div>
<div>
combinations of IN/ON/OUT for 'lines' and also what was reasonable to
</div>
<div>
implement.
</div>
<div>
<br>
</div>
<div>
I didn't like some of the method keywords that I had suggested either.
</div>
<div>
<br>
</div>
<div>
The advantages of the keyword, even if ugly/unwieldy, to say what is
</div>
<div>
wanted for the different 'line' cases, over a 'details' option are
</div>
<div>
that:
</div>
<div>
- for many methods, optimisation is possible (ie can stop early, handle
</div>
<div>
the target polygons one-by-one, etc)
</div>
<div>
- the result of the 'details' would probably have to be some ugly
</div>
<div>
composite string, maybe requiring a regex test to decipher.
</div>
<div>
<br>
</div>
<div>
My summary:
</div>
<div>
<br>
</div>
<div>
For 'polygons', methods 'all' and 'any' cover the requirements.
</div>
<div>
<br>
</div>
<div>
'points' hasn't been discussed. Are methods for IN, IN or ON, ON
</div>
<div>
needed? If so, what keywords to use; 'any' and 'all' are wrong...
</div>
<div>
<br>
</div>
<div>
'lines', as per 04-Jan posting with Jan's alternative.
</div>
<div>
<br>
</div>
<div>
a) some-in-none-out IN and not OUT
</div>
<div>
b) all-in-or-on (IN or ON) and not OUT
</div>
<div>
c) all-on ON and not (OUT or IN)
</div>
<div>
d) any-in IN
</div>
<div>
e) any-in-or-on IN or ON
</div>
<div>
<br>
</div>
<div>
So, are all cases required and what keywords to use?
</div>
<div>
<br>
</div>
<div>
'all' could be used for a) or b), but with the function being called is
</div>
<div>
-in, it would more naturally apply to a). Likewise 'any' for d) rather
</div>
<div>
than e).
</div>
<div>
<br>
</div>
<div>
Ticker
</div>
<div>
<br>
</div>
<div>
<br>
</div>
<div>
On Wed, 2020-01-15 at 06:38 +0000, Gerd Petermann wrote:
</div>
<blockquote type="cite">
<div>
Hi Jan,
</div>
</blockquote>
<blockquote type="cite">
<div>
thanks for testing.
</div>
<div>
Reg. the ways: Yes, that's an error. I'll have a look at it.
</div>
<div>
Reg. your rules: I would add the clause & isin!=* in the 2nd rule to
</div>
<div>
avoid a 2nd execution of the is_in function.
</div>
<div>
Reg. ON:
</div>
<div>
The current implementation of is_in accepts only 'all' or 'any'. I
</div>
<div>
think we can also detect the cases 2 and 3 on Tickers list (1) but I
</div>
<div>
didn't like the suggested method 'all-on' in combination with the
</div>
<div>
function name is_in and I did not yet find a better alternative.
</div>
<div>
An alternative I was thinking about is to implement a 'details'
</div>
<div>
option which might return one of the values in Tickers list. We just
</div>
<div>
have to define values for points and polygons, as Tickers list is
</div>
<div>
only for rules in lines.
</div>
</blockquote>
<blockquote type="cite">
<div>
Gerd
</div>
<div>
(1)
<a href="http://gis.19327.n8.nabble.com/Test-cases-for-possible-is-in-hook" rel="noopener" target="_blank">http://gis.19327.n8.nabble.com/Test-cases-for-possible-is-in-hook</a>
</div>
<div>
-tp5954103p5954828.html
</div>
</blockquote>
<blockquote type="cite">
<div>
________________________________________
</div>
<div>
Von: mkgmap-dev <
<a href="mailto:mkgmap-dev-bounces@lists.mkgmap.org.uk">mkgmap-dev-bounces@lists.mkgmap.org.uk</a>> im Auftrag
</div>
<div>
von jan meisters <
<a href="mailto:jan_m23@gmx.net">jan_m23@gmx.net</a>>
</div>
<div>
Gesendet: Dienstag, 14. Januar 2020 23:38
</div>
<div>
An: Development list for mkgmap
</div>
<div>
Betreff: Re: [mkgmap-dev] Branch is_in ready for a first test
</div>
</blockquote>
<blockquote type="cite">
<div>
Hi Gerd, hi Ticker,
</div>
</blockquote>
<blockquote type="cite">
<div>
sorry for the delay, until the weekend I didn´t found time to test
</div>
<div>
the new versions.
</div>
</blockquote>
<blockquote type="cite">
<div>
I´m very impressed, my results now are so precise that I could revert
</div>
<div>
all the gaps I created for the first hook.
</div>
<div>
Many thanks for all your efforts to realize this accuracy!
</div>
</blockquote>
<blockquote type="cite">
<div>
Still I´m only on lines inside cemetery/allotments, so I have no clue
</div>
<div>
about the buildings in v4 samples, sorry.
</div>
</blockquote>
<blockquote type="cite">
<div>
I check for „all“ and for „any“, giving two new values and then
</div>
<div>
reduce them to one if another match, ie:
</div>
<div>
highway=* & ... & is_in(landuse,allotments,all)=true {add isin=1}
</div>
<div>
highway=* & ... & is_in(landuse,allotments,any)=true {add isin=2}
</div>
<div>
highway=* & isin=1 {set highway=path}
</div>
<div>
highway=* & isin=2 bicyle=no {set highway=path}
</div>
</blockquote>
<blockquote type="cite">
<div>
That works as I expect: reduce all-in, and any-in only if specified.
</div>
<div>
I didn´t understood yet : could ON still be a value to ask for,
</div>
<div>
beside IN and OUT?
</div>
<div>
Or has it become obsolete? In anyway, with my rule above I see no
</div>
<div>
complaint about it.
</div>
</blockquote>
<blockquote type="cite">
<div>
Only one unclear example so far I found - probably caused by the
</div>
<div>
multipolygon?
</div>
<div>
The first line is not matched by the any-rule, but the second is.
</div>
<div>
Both should match according to style:
</div>
<div>
<a href="https://www.openstreetmap.org/way/117416117" rel="noopener" target="_blank">https://www.openstreetmap.org/way/117416117</a>
</div>
<div>
<a href="https://www.openstreetmap.org/way/117416120" rel="noopener" target="_blank">https://www.openstreetmap.org/way/117416120</a>
</div>
</blockquote>
<blockquote type="cite">
<div>
As said, only one. With is_in render time is increased by only 5-10%,
</div>
<div>
pretty cheap.
</div>
<div>
Thanks to all for the ideas read here how to play with this wonderful
</div>
<div>
new option.
</div>
</blockquote>
<blockquote type="cite">
<div>
Jan
</div>
</blockquote>
<div>
_______________________________________________
</div>
<div>
mkgmap-dev mailing list
</div>
<div>
<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
</div>
<div>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noopener" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
</div>
<div>
_______________________________________________
</div>
<div>
mkgmap-dev mailing list
</div>
<div>
<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
</div>
<div>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noopener" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
</div>
<div>
_______________________________________________
</div>
<div>
mkgmap-dev mailing list
</div>
<div>
<a href="mailto:mkgmap-dev@lists.mkgmap.org.uk">mkgmap-dev@lists.mkgmap.org.uk</a>
</div>
<div>
<a href="http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev" rel="noopener" target="_blank">http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev</a>
</div>
</blockquote>
</body>
</html>