closed ways and multi-polygon relations

Hi Gerd I'd hoped and expected that all polygons were fed into the 'lines' style processing in a similar manner, regardless of their origin as either a closed OSM way or generated by multiPolygonRelation. This would allow simple testing using just 'is_closed()=true' to effect lines around polygons if required. Instead I find that, for a few examples I've looked at in detail, for each outer way in a relation a way is passed into 'lines'. They all have identical tags (from the relation) and is_closed()=false. It is difficult to determine if these correspond directly to the ways in the relation. In the generated map, the line around the area might be in multiple segments, so some logic appears to have merged some of the ways but not others. In my example is seems as if merging has been prevented when the original ways have conflicting tags (maybe just the name=) Given that it isn't possible to differentiate the multiple outer ways when passed in from multiPolygon, why doesn't it just pass in the joined way that will be passed to the 'polygons' processing. Also, assuming that later processing is joining some of these parts, what stops it joining them all. I can give you details of my example if required, but just having: mkgmap:mp_created=true & is_closed()=false {echotags 'mpNotClosed'} in 'lines' then looking for consecutive identical 'Way generated from...' output and checking that there is only 1 output polygon will yield a lot. Another difference between closed ways and multi-polygons is that with a closed way the object is passed through the rules of 'lines' concatenated with 'polygons' and all the facilties of stopping after a match/continue/with_actions work in a nice way, whereas with a multi -polygon, even if it matches in 'lines', it is passed through 'polygons' as well; so extra conditions will is needed in 'polygons' to determine if matched in 'lines' Regards Ticker

Hi Ticker, I don't understand what you expect here. The ways with tag mkgmap:mp_created are the result of the joining process. Normally they are closed. Is the one way that is reported a part of a broken MP? Maybe you expect that the members of a MP rel do also have a special tag? That would be something that you have to do in the relations style file. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 22. November 2018 17:03 An: mkgmap development Betreff: [mkgmap-dev] closed ways and multi-polygon relations Hi Gerd I'd hoped and expected that all polygons were fed into the 'lines' style processing in a similar manner, regardless of their origin as either a closed OSM way or generated by multiPolygonRelation. This would allow simple testing using just 'is_closed()=true' to effect lines around polygons if required. Instead I find that, for a few examples I've looked at in detail, for each outer way in a relation a way is passed into 'lines'. They all have identical tags (from the relation) and is_closed()=false. It is difficult to determine if these correspond directly to the ways in the relation. In the generated map, the line around the area might be in multiple segments, so some logic appears to have merged some of the ways but not others. In my example is seems as if merging has been prevented when the original ways have conflicting tags (maybe just the name=) Given that it isn't possible to differentiate the multiple outer ways when passed in from multiPolygon, why doesn't it just pass in the joined way that will be passed to the 'polygons' processing. Also, assuming that later processing is joining some of these parts, what stops it joining them all. I can give you details of my example if required, but just having: mkgmap:mp_created=true & is_closed()=false {echotags 'mpNotClosed'} in 'lines' then looking for consecutive identical 'Way generated from...' output and checking that there is only 1 output polygon will yield a lot. Another difference between closed ways and multi-polygons is that with a closed way the object is passed through the rules of 'lines' concatenated with 'polygons' and all the facilties of stopping after a match/continue/with_actions work in a nice way, whereas with a multi -polygon, even if it matches in 'lines', it is passed through 'polygons' as well; so extra conditions will is needed in 'polygons' to determine if matched in 'lines' Regards Ticker _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Gerd What I was expecting was that multiPolygonRelation generates 1 closed way per distinct outer polyon and this has just the tags of the relation. This is passed to 'lines' and 'polygons' matching. My example is relation/1371699 which uses 9 ways (a mix of existing roads and ways just created for the purpose) as outers to define a single polygon. What I'm seeing, with these in 'lines': name='Littleton' & place=village & is_closed()=true {echotags 'lineLitVilTrue'} name='Littleton' & place=village & is_closed()=false {echotags 'lineLitVilFalse'} name='Littleton' & place=village [0x12 resolution 22] 1/ is no output from lineLitVilTrue 2/ 9 identical ways from lineLitVilFalse; I've removed some admin tags: Way generated from 1371699 [landuse=residential, mkgmap:cache_area_size=99714.294, mkgmap:mp_created=true, mkgmap:stylefilter=polyline, name=Littleton, place=village] lineLitVilFalse Way generated from 1371699 [landuse=residential, mkgmap:cache_area_size=99714.294, mkgmap:mp_created=true, mkgmap:stylefilter=polyline, name=Littleton, place=village] lineLitVilFalse etc 3/ using GPSMapEdit, the generated line looks to be in 4 segments, some of the outers from the relation have been joined, but it looks like it has avoided joining where the base way tags conflict. With this in 'polygons': name='Littleton' & place=village {echotags 'polyLitVil'} and, as in default style: place=village [0x03 resolution 22] I get: JoinedWay generated from 94665254 [landuse=residential, mkgmap:cache_area_size=99714.294, mkgmap:mp_created=true, mkgmap:stylefilter=polygon, name=Littleton, place=village] polyLitVil which is as expected, and it shows correctly on the map. I'm pretty sure the relation and have just loaded the latest data from geofabrik . I get about 4500 messages running 1 map tile with this in 'lines': mkgmap:mp_created=true & is_closed()=false {echotags 'mpNotClosed'} Ticker On Thu, 2018-11-22 at 16:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I don't understand what you expect here. The ways with tag mkgmap:mp_created are the result of the joining process. Normally they are closed. Is the one way that is reported a part of a broken MP? Maybe you expect that the members of a MP rel do also have a special tag? That would be something that you have to do in the relations style file.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 22. November 2018 17:03 An: mkgmap development Betreff: [mkgmap-dev] closed ways and multi-polygon relations
Hi Gerd
I'd hoped and expected that all polygons were fed into the 'lines' style processing in a similar manner, regardless of their origin as either a closed OSM way or generated by multiPolygonRelation. This would allow simple testing using just 'is_closed()=true' to effect lines around polygons if required.
Instead I find that, for a few examples I've looked at in detail, for each outer way in a relation a way is passed into 'lines'. They all have identical tags (from the relation) and is_closed()=false. It is difficult to determine if these correspond directly to the ways in the relation.
In the generated map, the line around the area might be in multiple segments, so some logic appears to have merged some of the ways but not others. In my example is seems as if merging has been prevented when the original ways have conflicting tags (maybe just the name=)
Given that it isn't possible to differentiate the multiple outer ways when passed in from multiPolygon, why doesn't it just pass in the joined way that will be passed to the 'polygons' processing.
Also, assuming that later processing is joining some of these parts, what stops it joining them all.
I can give you details of my example if required, but just having:
mkgmap:mp_created=true & is_closed()=false {echotags 'mpNotClosed'}
in 'lines' then looking for consecutive identical 'Way generated from...' output and checking that there is only 1 output polygon will yield a lot.
Another difference between closed ways and multi-polygons is that with a closed way the object is passed through the rules of 'lines' concatenated with 'polygons' and all the facilties of stopping after a match/continue/with_actions work in a nice way, whereas with a multi -polygon, even if it matches in 'lines', it is passed through 'polygons' as well; so extra conditions will is needed in 'polygons' to determine if matched in 'lines'
Regards Ticker
_______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev

Hi Ticker, okay, I can reproduce the results. I was wrong, the ways with mkgmap:mp_created=true and mkgmap:stylefilter=polyline are in fact copies of the original way members of the MP and those are typically not closed. No idea why it is implemented this way. Looks wrong to me. Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 22. November 2018 19:16 An: mkgmap development Betreff: Re: [mkgmap-dev] closed ways and multi-polygon relations Hi Gerd What I was expecting was that multiPolygonRelation generates 1 closed way per distinct outer polyon and this has just the tags of the relation. This is passed to 'lines' and 'polygons' matching. My example is relation/1371699 which uses 9 ways (a mix of existing roads and ways just created for the purpose) as outers to define a single polygon. What I'm seeing, with these in 'lines': name='Littleton' & place=village & is_closed()=true {echotags 'lineLitVilTrue'} name='Littleton' & place=village & is_closed()=false {echotags 'lineLitVilFalse'} name='Littleton' & place=village [0x12 resolution 22] 1/ is no output from lineLitVilTrue 2/ 9 identical ways from lineLitVilFalse; I've removed some admin tags: Way generated from 1371699 [landuse=residential, mkgmap:cache_area_size=99714.294, mkgmap:mp_created=true, mkgmap:stylefilter=polyline, name=Littleton, place=village] lineLitVilFalse Way generated from 1371699 [landuse=residential, mkgmap:cache_area_size=99714.294, mkgmap:mp_created=true, mkgmap:stylefilter=polyline, name=Littleton, place=village] lineLitVilFalse etc 3/ using GPSMapEdit, the generated line looks to be in 4 segments, some of the outers from the relation have been joined, but it looks like it has avoided joining where the base way tags conflict. With this in 'polygons': name='Littleton' & place=village {echotags 'polyLitVil'} and, as in default style: place=village [0x03 resolution 22] I get: JoinedWay generated from 94665254 [landuse=residential, mkgmap:cache_area_size=99714.294, mkgmap:mp_created=true, mkgmap:stylefilter=polygon, name=Littleton, place=village] polyLitVil which is as expected, and it shows correctly on the map. I'm pretty sure the relation and have just loaded the latest data from geofabrik . I get about 4500 messages running 1 map tile with this in 'lines': mkgmap:mp_created=true & is_closed()=false {echotags 'mpNotClosed'} Ticker On Thu, 2018-11-22 at 16:18 +0000, Gerd Petermann wrote:
Hi Ticker,
I don't understand what you expect here. The ways with tag mkgmap:mp_created are the result of the joining process. Normally they are closed. Is the one way that is reported a part of a broken MP? Maybe you expect that the members of a MP rel do also have a special tag? That would be something that you have to do in the relations style file.
Gerd
________________________________________ Von: mkgmap-dev <mkgmap-dev-bounces@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkgmap@jagit.co.uk> Gesendet: Donnerstag, 22. November 2018 17:03 An: mkgmap development Betreff: [mkgmap-dev] closed ways and multi-polygon relations
Hi Gerd
I'd hoped and expected that all polygons were fed into the 'lines' style processing in a similar manner, regardless of their origin as either a closed OSM way or generated by multiPolygonRelation. This would allow simple testing using just 'is_closed()=true' to effect lines around polygons if required.
Instead I find that, for a few examples I've looked at in detail, for each outer way in a relation a way is passed into 'lines'. They all have identical tags (from the relation) and is_closed()=false. It is difficult to determine if these correspond directly to the ways in the relation.
In the generated map, the line around the area might be in multiple segments, so some logic appears to have merged some of the ways but not others. In my example is seems as if merging has been prevented when the original ways have conflicting tags (maybe just the name=)
Given that it isn't possible to differentiate the multiple outer ways when passed in from multiPolygon, why doesn't it just pass in the joined way that will be passed to the 'polygons' processing.
Also, assuming that later processing is joining some of these parts, what stops it joining them all.
I can give you details of my example if required, but just having:
mkgmap:mp_created=true & is_closed()=false {echotags 'mpNotClosed'}
in 'lines' then looking for consecutive identical 'Way generated from...' output and checking that there is only 1 output polygon will yield a lot.
Another difference between closed ways and multi-polygons is that with a closed way the object is passed through the rules of 'lines' concatenated with 'polygons' and all the facilties of stopping after a match/continue/with_actions work in a nice way, whereas with a multi -polygon, even if it matches in 'lines', it is passed through 'polygons' as well; so extra conditions will is needed in 'polygons' to determine if matched in 'lines'
Regards 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

Hi Gerd,
are in fact copies of the original way members of the MP and those are typically not closed
I see 3 possible solutions: 1. Convert multipolygon ways to a proper, continuous outline. 2. Return is_closed() as true, when mkgmap:mp_created is true. 3. Add info to documentation, that lines with mkgmap:mp_created=true are part of a closed outline, but not necessary result in is_closed()=true. I would suggest solution 3. I assume that is_closed() means, that object could be a polygon, while mkgmap:mp_created=true or area=yes describe a more complex object, but essentially a kind of polygon too. -- Best regards, Andrzej

Hi, first I'd like to say it works as intended, see http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=1694 Unfortunately WanMil is no longer active here, so I have no way to ask him why he deicded to use copies of the original ways instead of the joined way. Anyway, for ways with mkgmap:mp_created=true one should not use is_closed(), the important information is in mkgmap:stylefilter. I think the current implementation is not good because it creates lots of objects instead of a few, maybe only one. Each one is processed in the style and later the mergel-ine algo tries to put them together again. Gerd popej wrote
Hi Gerd,
are in fact copies of the original way members of the MP and those are typically not closed
I see 3 possible solutions: 1. Convert multipolygon ways to a proper, continuous outline. 2. Return is_closed() as true, when mkgmap:mp_created is true. 3. Add info to documentation, that lines with mkgmap:mp_created=true are part of a closed outline, but not necessary result in is_closed()=true.
I would suggest solution 3.
I assume that is_closed() means, that object could be a polygon, while mkgmap:mp_created=true or area=yes describe a more complex object, but essentially a kind of polygon too.
-- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html

Hi I like the solution to have the same behaviour as a polygon that comes from a closed way: the joined way is passed to a concatenation of the lines and polygons rules. It has the tags of the relation and mkgmap:mp_created=true but mkgmap:stylefilter=poly{line/gon} is not added. The option that was removed in Rev 1694 was: --process-boundary-relations When reading OSM files, boundary relations are processed. By default they are not processed because most of the boundary relations are incomplete due to splitting of OSM files. When processing these incomplete multipolygons additional artificial boundary lines are created on the tile bounds. and the logic added is commented: // 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. Assuming there isn't a problem now when parts of a multipolygon are outside the tile, I don't see any problem with the suggested solution. Is there any other difficulty with bounds processing, ie does bounds.zip feed in to mp processing and act as a replacement for relations where type=boundary or is it simply used for filling in location details? In the mean time I'm happy to use (is_closed() | mkgmap:mp_created=true) in 'lines' and convoluted logic in 'polygons' where I need to prevent a shape being generated because I only wanted a line. As a slight aside, I think that 'lines' should never {add area=yes} just because it is dealing with a polygon. It can be tested, with an assumption of yes or no, depending on the context, to chose a line or a polygon. Regards Ticker On Fri, 2018-11-23 at 01:12 -0600, Gerd Petermann wrote:
Hi,
first I'd like to say it works as intended, see http://www.mkgmap.org.uk/websvn/revision.php?repname=mkgmap&rev=1694
Unfortunately WanMil is no longer active here, so I have no way to ask him why he deicded to use copies of the original ways instead of the joined way. Anyway, for ways with mkgmap:mp_created=true one should not use is_closed(), the important information is in mkgmap:stylefilter. I think the current implementation is not good because it creates lots of objects instead of a few, maybe only one. Each one is processed in the style and later the mergel-ine algo tries to put them together again.
Gerd
popej wrote
Hi Gerd,
are in fact copies of the original way members of the MP and those are typically not closed
I see 3 possible solutions: 1. Convert multipolygon ways to a proper, continuous outline. 2. Return is_closed() as true, when mkgmap:mp_created is true. 3. Add info to documentation, that lines with mkgmap:mp_created=true are part of a closed outline, but not necessary result in is_closed()=true.
I would suggest solution 3.
I assume that is_closed() means, that object could be a polygon, while mkgmap:mp_created=true or area=yes describe a more complex object, but essentially a kind of polygon too.
-- Sent from: http://gis.19327.n8.nabble.com/Mkgmap-Development-f5324443.html _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
participants (3)
-
Andrzej Popowski
-
Gerd Petermann
-
Ticker Berkin