Modify

Opened 17 months ago

Last modified 8 months ago

#22940 new enhancement

[Patch] add autofix for node[type=multipolygon] and most way[type=multipolygon]

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]

Attachments (0)

Change History (2)

comment:1 by taylor.smock, 17 months 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.

comment:2 by skyper, 8 months ago

Keywords: type multipolygon added
Summary: add autofix for node[ŧype=multipolygon] and most way[type=multipolygon][Patch] add autofix for node[type=multipolygon] and most way[type=multipolygon]

This can happen if you change a multipolygon into closed ways and copy all tags from the MP to the way.
As we already have the warning, I'd go with the auto-fix to save the mappers time and mouse distances.

Last edited 8 months ago by skyper (previous) (diff)

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 marc_marc.
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.