Changes between Version 3 and Version 4 of Ticket #23229


Ignore:
Timestamp:
2023-10-12T03:30:15+02:00 (2 years ago)
Author:
pierzen
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23229

    • Property Summary JOSM-mapcss does not return nodes from nested relation, way, node child selectorsJOSM-mapcss Limited Parent - Child selectors for nodes with OSM hierarchy relation, way, node
  • Ticket #23229 – Description

    v3 v4  
    1 Trying to select both ways and nodes from a relation, ways are selected and colored apporpriately but selector for nodes from the ways do not select and color the nodes part of these ways.
     1JOSM-mapcss parent-child selectors could be enhanced to offer more possibilities to select/render nodes
    22
    3 The example below shows the mapcss to reproduce the problem. The part 1 selects successfully all ways from a [natural=water] relation. But the second section returns no nodes, this with no error message.
     3With MapCSS, we can use a child selector which matches only if both the parent and the child object match.
     4- relation[type=route][route=foot] > way {...}
     5- way[natural] > node {...}
    46
    5 1.  way child selector from relation - works fine
     7But there are restrictions that limit working with the OSM hierarchy Relation - Ways - Nodes.
     8 with selectors that. It is not possible, for example, to select nodes for ways that are part of a [natural=water] relation if we define a selector to set a class. Similarly, it is not possible to create a selector for a node that is child of both a [natural=water] relation and a waterway way.
    69
    7 {{{#!mapcss
    8     relation[type=multipolygon][natural=water] > way::lnatural_way, area[natural] > way::lnatural_way
    9     {
    10        set .natural_way; z-index:50;
    11        color: red;  width: 2; opacity:1;
    12     }
     10**Examples**
     11    Nodes from ways part of a relation not selected
     12    - relation[type=mutlipolygon][natural=water] > way {set .natural_relation;}
     13    > way.natural_relation > node {...} selects no node
    1314
    14 }}}
     15    Nodes from a way.class are not selected   
     16    - way[place=islet], way[place=island]  {set .isl;}
     17    > way.isl > node {...} selects no node
     18   
     19==== What steps will reproduce the problem?
     201. open file natural-way-and-relation.osm
     212. Press F12 (Preference), select Mappaint button on the left, Select the + Button on the right to Add as active style the attached mapcss style natural_way_node_childs_selectors.mapcss
    1522
    16 2.  way child selector from ways selected - returns nothing - no error reported
     23==== What is the expected result?
     241. Selection of way[natural], ways are rendered with casing-color:green
     252. Selection of ways from a relation[type=multipolygon][natural=water], ways are rendered with color:red.
     263. Selection of nodes from these ways, nodes are rendered with symbol-stroke-color:red.
    1727
    18 {{{#!mapcss
    19     way.natural_way > node 
    20     {
    21        set .natural_water_way_node;
    22        symbol-shape:pentagon;  symbol-size:46; symbol-stroke-color:black;
    23        symbol-stroke-width:2; symbol-stroke-opacity:1;
    24        symbol-fill-color:red; symbol-fill-opacity:1;
    25     }
    26 }}}
     28==== What happens instead?
     29Trying to select both ways and nodes from a relation, ways are selected and colored appropriately but selector for nodes from the ways do not select and color the nodes part of these ways.
    2730
     31Trying to select both ways and nodes from a relation[type=multipolygon][natural=water], ways are rendered and colored as expected but it seems that they are processed as area. Node Child selectors from **way.class > node** do not select nodes and render them.
     32
     33==== Please provide any additional information below.
     34**Reproduce the problem**
     35Load in JOSM the OSM file natural-way-and-relation.osm and the MAPCSS style
     36natural_way_node_childs_selectors.mapcss
     37
     38[[Image(natural_way_node_childs_selectors_reproduce_problem.png)]]
     39
     40**Expected result**
     41
     42[[Image(natural_way_node_childs_selectors_expected_results.png)]]