﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
23229	JOSM-mapcss Limited Parent - Child selectors for nodes with OSM hierarchy relation, way, node	pierzen	team	"JOSM-mapcss parent-child selectors could be enhanced to offer more possibilities to select/render nodes

With MapCSS, we can use a child selector which matches only if both the parent and the child object match. 
- relation[type=route][route=foot] > way {...}
- way[natural] > node {...}

But there are restrictions that limit working with the OSM hierarchy Relation - Ways - Nodes.
 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.

**Examples**
    Nodes from ways part of a relation not selected
    - relation[type=mutlipolygon][natural=water] > way {set .natural_relation;}
    > way.natural_relation > node {...} selects no node

    Nodes from a way.class are not selected    
    - way[place=islet], way[place=island]  {set .isl;}
    > way.isl > node {...} selects no node
    
==== What steps will reproduce the problem?
1. open file natural-way-and-relation.osm
2. 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

==== What is the expected result?
1. Selection of way[natural], ways are rendered with casing-color:green
2. Selection of ways from a relation[type=multipolygon][natural=water], ways are rendered with color:red. 
3. Selection of nodes from these ways, nodes are rendered with symbol-stroke-color:red. 

==== What happens instead?
Trying 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.

Trying 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. 

==== Please provide any additional information below. 
**Reproduce the problem**
Load in JOSM the OSM file natural-way-and-relation.osm and the MAPCSS style
natural_way_node_childs_selectors.mapcss

[[Image(natural_way_node_childs_selectors_reproduce_problem.png)]]

**Expected result**

[[Image(natural_way_node_childs_selectors_expected_results.png)]]

{{{
Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-08-29 13:38:40 +0200 (Tue, 29 Aug 2023)
Revision:18822
Build-Date:2023-08-30 01:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (18822 fr) Windows 10 64-Bit
OS Build number: Windows 10 Pro 2009 (19045)
Memory Usage: 325 MB / 1024 MB (127 MB allocated, but free)
Java version: 17.0.1+12-LTS, Microsoft, OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1366×768 (scaling 1.00×1.00)
Maximum Screen Size: 1366×768
Best cursor sizes: 16×16→32×32, 32×32→32×32
Environment variable LANG: fr
Environment variable LC_ALL: fr.UTF8
System property file.encoding: Cp1252
System property sun.jnu.encoding: Cp1252
Locale info: fr_CA
Numbers with default locale: 1234567890 -> 1234567890
Dataset consistency test: No problems found

Plugins:
+ apache-commons (36034)
+ ejml (35924)
+ geotools (36068)
+ jackson (36034)
+ jaxb (36118)
+ jts (36004)
+ opendata (36126)
+ todo (133)
+ utilsplugin2 (36134)

Map paint styles:
- https://josm.openstreetmap.de/josmfile?page=Styles/Admin_Boundaries&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/LayerChecker&zip=1
- d:\osm\mapcss\Health_Boundaries_v2d.mapcss
- d:\osm\mapcss\test_class.mapcss
- https://github.com/hotosm/HDM-JOSM-style/archive/master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/HealthBoundary&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Fixme&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Highway_Nodes&zip=1
- https://github.com/osmlab/appledata/archive/josm_paint_inline_validation.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/LessObtrusiveNodes&zip=1
- https://github.com/MissingMaps/josm_styles/archive/master.zip
- d:\osm\josm\way_nonodes.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_buildings&zip=1
- https://raw.githubusercontent.com/OpenSeaMap/josm/master/INT1_Seamark.mapcss
- https://www.openrailwaymap.org/styles/standard.zip
- https://github.com/GlassOceanos/indoor-JOSM-style/archive/master.zip
- https://josm.openstreetmap.de/josmfile?page=Styles/HealthBoundary&zip=1
- https://josm.openstreetmap.de/josmfile?page=Styles/Coloured_Streets&zip=1
+ D:\osm\mapcss\natural_way_node_childs_selectors.mapcss
- https://josm.openstreetmap.de/josmfile?page=Styles/Waterways&zip=1

Validator rules:
- C:\Program Files (x86)\josm\plugins\FeaturesMajorTags.validator.mapcss

Last errors/warnings:
- 00001.557 W: extended font config - overriding 'filename.Myanmar_Text=mmrtext.ttf' with 'MMRTEXT.TTF'
- 00001.560 W: extended font config - overriding 'filename.Mongolian_Baiti=monbaiti.ttf' with 'MONBAITI.TTF'
- 00030.580 E: Skipping to the next rule, because of an error: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "" "">"" ""> """" at line 37, column 42.
- 00030.613 E: Skipping to the next rule, because of an error: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "" ""{"" ""{ """" at line 122, column 1.
- 00030.657 E: Skipping to the next rule, because of an error: org.openstreetmap.josm.gui.mappaint.mapcss.parsergen.ParseException: Encountered "" ""{"" ""{ """" at line 167, column 1.
- 00032.755 E: Impossible de trouver l'image ""icons/water-color.png""
- 00032.758 W: Mappaint style ""standard"" (colored waterways) icon ""icons/water-color.png"" not found.
}}}
"	enhancement	new	normal		Core			mapcss parent child selector	
