Opened 3 years ago

Last modified 23 months ago

#22940 new enhancement

add autofix for node[ŧype=multipolygon] and most way[type=multipolygon] — at Version 1

Reported by: marc_marc Owned by: team
Priority: normal Milestone:
Component: Core validator Version:
Keywords: template_report type multipolygon Cc:

Description (last modified by taylor.smock)

What steps will reproduce the problem?

  1. create a node with natural=tree type=multipolygon
  2. create a way with landuse=residential type=multipolygon
  3. run the validator

What is the expected result?

have a autofix for both

What happens instead?

the validator detect the issue without a autofix
https://josm.openstreetmap.de/browser/trunk/resources/data/validator/geometry.mapcss#L90
https://josm.openstreetmap.de/browser/trunk/resources/data/validator/geometry.mapcss#L139

proposed enhancement

node[type=multipolygon] {
    throwError: tr("{0} on a node. Should be used in a relation", "{0.tag}");
    fixRemove: "type";
}

way!:closed[type=multipolygon] {
    throwError: tr("{0} on a way. Should be used in a relation", "{0.tag}"); 
    fixRemove: "type";
}

way:area-style[type=multipolygon] {
    throwError: tr("{0} on a way. Should be used in a relation", "{0.tag}"); 
    fixRemove: "type";
}

I didn't combine both way with way[type=multipolygon] because some wrong usage of way[type=multipolygon] mean area=yes (for ex when converting a relation type=multipolygon highway=pedestrian into a closed way)

Please provide any additional information below. Attach a screenshot if possible.

URL:https://josm.openstreetmap.de/svn/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2023-05-09 19:06:23 +0200 (Tue, 09 May 2023)
Build-Date:2023-05-10 01:30:56
Revision:18722
Relative:URL: ^/trunk

Identification: JOSM/1.5 (18722 fr) Linux CentOS Linux release 7.9.2009 (Core)
Memory Usage: 473 MB / 1717 MB (220 MB allocated, but free)
Java version: 1.8.0_362-b08, Red Hat, Inc., OpenJDK 64-Bit Server VM
Look and Feel: javax.swing.plaf.metal.MetalLookAndFeel
Screen: :0.0 1600×900 (scaling 1.00×1.00)
Maximum Screen Size: 1600×900
Best cursor sizes: 16×16→16×16, 32×32→32×32
Environment variable LANG: fr.utf8
System property file.encoding: UTF-8
System property sun.jnu.encoding: UTF-8
Locale info: fr_CH
Numbers with default locale: 1234567890 -> 1234567890
Desktop environment: GNOME-Classic:GNOME
Java package: java-1.8.0-openjdk:x86_64-1.8.0.362.b08
WebStart package: icedtea-web:x86_64-1.7.1
VM arguments: [-Dicedtea-web.bin.name=javaws.itweb, -Dicedtea-web.bin.location=/usr/bin/javaws.itweb]

Change History (1)

comment:1 by taylor.smock, 3 years ago

Description: modified (diff)

We'd probably want to do something like this:

node[type=multipolygon] {
    throwError: tr("{0} on a node. Should be used in a relation", "{0.tag}");
    fixRemove: "type";
}

way!:closed[type=multipolygon],
way:area-style[type=multipolygon] {
    throwError: tr("{0} on a way. Should be used in a relation", "{0.tag}"); 
    fixRemove: "type";
}
way[type=multipolygon]:

Anyway, looking at taginfo:tags/type=multipolygon, it seems to be a very rare occurrence. If there are tools causing this to happen, we should fix those, since I don't think people are intentionally adding type=multipolygon to node/way objects.

And the current issues can be dealt with via a MapRoulette task.

Note: See TracTickets for help on using tickets.