Modify

Opened 13 months ago

Last modified 13 months ago

#23229 new enhancement

JOSM-mapcss Limited Parent - Child selectors for nodes with OSM hierarchy relation, way, node

Reported by: pierzen Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: mapcss parent child selector Cc:

Description (last modified by pierzen)

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


Expected result


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.

Attachments (4)

Change History (11)

comment:1 by pierzen, 13 months ago

Description: modified (diff)

comment:2 by pierzen, 13 months ago

Summary: JOSM-mapcss does not return nodes from nested relation, way, child selectorsJOSM-mapcss does not return nodes from nested relation, way, node child selectors

comment:3 by gaben, 13 months ago

Description: modified (diff)
Owner: changed from team to pierzen
Status: newneedinfo

Thanks for your report, however your ticket is incomplete and therefore not helpful in its current form.

Please add all needed information according to this list:

  • The required parts of the Status Report from your JOSM.
  • Describe what behaviour you expected.
  • Describe what did happen instead.
  • Describe if and how the issue is reproducible.
  • Add any relevant information like error messages or screenshots.

To ensure that all technical relevant information is contained, create new tickets by clicking in JOSMs Main Menu on Helpsource:trunk/resources/images/bug.svg Report Bug.

Remember: This is a generic notice so we don't need to write the same stuff again and again. It may only apply in parts to the specific case!



Please attach the status report.

by pierzen, 13 months ago

comment:4 by pierzen, 13 months ago

Description: modified (diff)
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

comment:5 by pierzen, 13 months ago

Description: modified (diff)

comment:6 by gaben, 13 months ago

Owner: changed from pierzen to team
Status: needinfonew

comment:7 by pierzen, 13 months ago

To say it more simply, I propose to have the ability to style nodes based on characteristics of grandparents,the relation. One more direct syntax for the selector could be formulated as relation[type=route][route=foot] > way > node {...}

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to pierzen.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.