Modify

Opened 40 hours ago

Last modified 6 hours ago

#24703 new defect

Moving filtered objects fails

Reported by: GerdP Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: template_report Cc:

Description

What steps will reproduce the problem?

  1. load attached file
  2. add a filter building=* addr
  3. search for building=* with enabled "all objects" checkbox, this should select 3 buildings
  4. press and hold CTRL and drag the selection by e.g. 10m

What is the expected result?

Not sure. Either all three buildings are moved by the same amount or only the two buildings which are not partly hidden.

What happens instead?

All three buildings are moved, but the filtered one is only moved a little bit. Two move commands are on the command stack, first for 15 nodes, second for 10 nodes.

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

Relative:URL: ^/trunk
Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Last:Changed Date: 2026-03-28 20:28:41 +0100 (Sat, 28 Mar 2026)
Revision:19555
Build-Date:2026-03-29 01:30:57
URL:https://josm.openstreetmap.de/svn/trunk

Identification: JOSM/1.5 (19555 en) Windows 11 64-Bit
OS Build number: Windows 10 Pro 25H2 (26200)
Memory Usage: 412 MB / 6144 MB (189 MB allocated, but free)
Java version: 21.0.2+13-LTS, Azul Systems, Inc., OpenJDK 64-Bit Server VM
Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel
Screen: \Display0 1920x1080x32bpp@60Hz (scaling 1.00×1.00)
Maximum Screen Size: 1920×1080
Best cursor sizes: 16×16→32×32, 32×32→32×32
System property file.encoding: UTF-8
System property sun.jnu.encoding: Cp1252
Locale info: en_DE
Numbers with default locale: 1234567890 -> 1234567890
VM arguments: [-Djpackage.app-version=1.5.19039, --add-modules=java.scripting,java.sql,javafx.controls,javafx.media,javafx.swing,javafx.web, --add-exports=java.base/sun.security.action=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED, --add-exports=java.desktop/com.sun.imageio.spi=ALL-UNNAMED, --add-opens=java.base/java.lang=ALL-UNNAMED, --add-opens=java.base/java.nio=ALL-UNNAMED, --add-opens=java.base/jdk.internal.loader=ALL-UNNAMED, --add-opens=java.base/jdk.internal.ref=ALL-UNNAMED, --add-opens=java.desktop/javax.imageio.spi=ALL-UNNAMED, --add-opens=java.desktop/javax.swing.text.html=ALL-UNNAMED, --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED, -Djpackage.app-path=%UserProfile%\AppData\Local\JOSM\JOSM HWConsole.exe]
Dataset consistency test: No problems found

Plugins:
+ OpeningHoursEditor (36474)
+ apache-commons (36474)
+ buildings_tools (36474)
+ comfort0 (36474)
+ ejml (36474)
+ geotools (36474)
+ jackson (36474)
+ jaxb (36474)
+ jts (36474)
+ o5m (36474)
+ opendata (36474)
+ pbf (36474)
+ photo_geotagging (36474)
+ poly (36474)
+ reverter (36474)
+ terracer (36484)
+ undelete (36474)
+ utilsplugin2 (36497)

Tagging presets:
+ c:\josm\core\resources\data\defaultpresets.xml

Map paint styles:
+ c:\josm\core\resources\styles\standard\elemstyles.mapcss

Validator rules:
+ d:\java_tools\JOSM\mygeometry.mapcss
+ https://josm.openstreetmap.de/josmfile?page=Rules/GermanySpecific&zip=1
+ c:\josm\core\resources\data\validator\combinations.mapcss
+ c:\josm\core\resources\data\validator\geometry.mapcss

Last errors/warnings:
- 00129.200 W: java.io.IOException: Attribution is not loaded yet
- 00129.200 W: java.io.IOException: Attribution is not loaded yet
- 00129.201 W: java.io.IOException: Attribution is not loaded yet
- 00129.201 W: java.io.IOException: Attribution is not loaded yet
- 00129.201 W: java.io.IOException: Attribution is not loaded yet
- 00129.202 W: java.io.IOException: Attribution is not loaded yet
- 00129.203 W: java.io.IOException: Attribution is not loaded yet
- 00129.203 W: java.io.IOException: Attribution is not loaded yet
- 00129.204 W: java.io.IOException: Attribution is not loaded yet
- 00129.205 W: java.io.IOException: Attribution is not loaded yet

Attachments (1)

demo.osm (6.6 KB ) - added by GerdP 40 hours ago.

Download all attachments as: .zip

Change History (9)

by GerdP, 40 hours ago

Attachment: demo.osm added

comment:1 by GerdP, 36 hours ago

Same problem also with Rotate or Scale action. The selection is changed when FilterModel.executeFilters() is called and this routine is called when the data is changed.

I see only two different ways to handle this. If user tries to move, scale or rotate a selection which contains hidden objects,
1) change nothing and show a warning that JOSM is unable to execute the action with this selection
2) execute the action only for the unhidden objects

comment:2 by stoecker, 36 hours ago

3) Show a dialog and offer to abort or handle only not hidden objects?

comment:3 by GerdP, 36 hours ago

OK, 3) is better. I'll try to code that.

comment:4 by GerdP, 35 hours ago

I fear 3) doesn't work :(
The check has to be performed when the first drag is noticed, and then you can only abort.

comment:5 by stoecker, 35 hours ago

Then 1 I'd suggest.

comment:6 by GerdP, 35 hours ago

Yes. My current approach simply shows a notification that the intended action was aborted when the selection contains ways which are disabled. Disabled nodes seem to be harmless.
Something like this in updateCommandWhileDragging()

        if ((mode == Mode.MOVE || mode == Mode.ROTATE || mode == Mode.SCALE)
                && ds.getSelectedWays().stream().anyMatch(Way::isDisabled)) {
            new Notification(tr("Action aborted. The selection contains ways that are hidden by filters"))
                    .setIcon(JOptionPane.WARNING_MESSAGE).show();
            return false;
        }

comment:7 by GerdP, 20 hours ago

Maybe the better alternative would be to disallow the selection of hidden objects using search (and whatever else allows this).
For example, there is no warning when I delete them, I can also add or change tags. The latter is quite dangerous because the selection is again modified after that.

I rarely use filters, so I don't know what users might expect. For sure I didn't expect that the usage of a filter may change the selection, I always thought it is only about rendering.

comment:8 by stoecker, 6 hours ago

I think it should not be possible to move any filtered (i.e. invisible) objects.

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