Modify ↓

Opened 3 weeks ago

Closed 2 weeks ago

#24982 closed defect (fixed)

[Patch] Zoom to selection shows empty area

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

Description (last modified by GerdP)

What steps will reproduce the problem?

  1. Start JOSM
  2. Load attached file
  3. Select all nodes
  4. Press 3 for "Zoom to selection"

What is the expected result?

Two selected nodes are visible

What happens instead?

No selected object in the visible area

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

The result seems to depend on the width of the sidebar. The wider the sidebar the more likely the nodes are shown.

Revision:19665
Is-Local-Build:true
Build-Date:2026-10-25 10:45:18

Identification: JOSM/1.5 (19665 SVN en) Windows 11 64-Bit
OS Build number: Windows 10 Pro 25H2 (26200)
Memory Usage: 1948 MB / 6144 MB (714 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 (36493)
+ apache-commons (36483)
+ buildings_tools (36503)
+ comfort0 (36483)
+ ejml (36483)
+ geotools (36483)
+ jackson (36502)
+ jaxb (36483)
+ jts (36483)
+ o5m (36493)
+ opendata (36503)
+ pbf (36493)
+ photo_geotagging (36503)
+ poly (36483)
+ reverter (36503)
+ terracer (36503)
+ undelete (36503)
+ utilsplugin2 (36503)

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:
- 20142.018 W: Image not returned for tile: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=860986.6866042,6931921.2211261,863432.6715094,6934367.2060312 content type was: text/html
- 20142.018 W: Image not returned for tile: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=860986.6866042,6931921.2211261,863432.6715094,6934367.2060312 content type was: text/html
- 20142.043 W: Image not returned for tile: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=860986.6866042,6931921.2211261,865878.6564145,6936813.1909363 content type was: text/html
- 20142.043 W: Image not returned for tile: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=860986.6866042,6931921.2211261,865878.6564145,6936813.1909363 content type was: text/html
- 20142.043 W: Image not returned for tile: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=860986.6866042,6927029.2513158,870770.6262247,6936813.1909363 content type was: text/html
- 20142.043 W: Image not returned for tile: https://opendata.lgln.niedersachsen.de/doorman/noauth/dop_wms?FORMAT=image/png&TRANSPARENT=TRUE&VERSION=1.3.0&SERVICE=WMS&REQUEST=GetMap&LAYERS=ni_dop20&STYLES=&CRS=EPSG:3857&WIDTH=512&HEIGHT=512&BBOX=860986.6866042,6927029.2513158,870770.6262247,6936813.1909363 content type was: text/html
- 31519.511 E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm>
- 31519.515 E: Bad Request - <html>The OSM server 'api.openstreetmap.org' reported a bad request.<br><br>The area you tried to download is too big or your request was too large.<br>Either request a smaller area or use an export file provided by the OSM community.<br><br>Downloading a smaller area is <em>recommended</em>!<br><br>Advanced users can use one of the following options:<br><ul><li><a href="https://josm.openstreetmap.de/wiki/Help/Action/Download#DownloadfromOverpassAPI">Overpass</a></li><li><a href="https://www.geofabrik.de/data/download.html">Geofabrik</a></li><li><a href="https://planet.openstreetmap.org/">OSM Planet File</a></li></ul></html>
- 31519.528 E: org.openstreetmap.josm.io.OsmApiException: ResponseCode=400, Error Header=<You requested too many nodes (limit is 50000). Either request a smaller area, or use planet.osm>
- 31519.534 E: Bad Request - <html>The OSM server 'api.openstreetmap.org' reported a bad request.<br><br>The area you tried to download is too big or your request was too large.<br>Either request a smaller area or use an export file provided by the OSM community.<br><br>Downloading a smaller area is <em>recommended</em>!<br><br>Advanced users can use one of the following options:<br><ul><li><a href="https://josm.openstreetmap.de/wiki/Help/Action/Download#DownloadfromOverpassAPI">Overpass</a></li><li><a href="https://www.geofabrik.de/data/download.html">Geofabrik</a></li><li><a href="https://planet.openstreetmap.org/">OSM Planet File</a></li></ul></html>

Attachments (3)

zoom-problem-test.osm​ (1.3 KB ) - added by GerdP 3 weeks ago.
Dataset containing two nodes
24982.patch​ (641 bytes ) - added by GerdP 3 weeks ago.
Make sure that the calculated enlargement is not negative
24982-test.patch​ (2.3 KB ) - added by GerdP 2 weeks ago.
non regression test

Download all attachments as: .zip

Change History (14)

by GerdP, 3 weeks ago

Attachment: zoom-problem-test.osm​ added

Dataset containing two nodes

comment:1 by GerdP, 3 weeks ago

Description: modified (diff)

comment:2 by GerdP, 3 weeks ago

Version: latest → tested

comment:3 by GerdP, 3 weeks ago

Owner: changed from team to GerdP
Status: new → assigned

by GerdP, 3 weeks ago

Attachment: 24982.patch​ added

Make sure that the calculated enlargement is not negative

comment:4 by GerdP, 3 weeks ago

Summary: Zoom to selection shows empty area → [Patch] Zoom to selection shows empty area

comment:5 by GerdP, 2 weeks ago

Resolution: → fixed
Status: assigned → closed

In 19669/josm:

Fix #24982: Zoom to selection shows empty area
Make sure that the calculated enlargement is not negative

Problem was introduced with r14628 and not fixed with r14734. In some cases, the bounding box was slighlty shrinked instead of enlarged.

comment:6 by GerdP, 2 weeks ago

Milestone: → 26.09

comment:7 by gaben, 2 weeks ago

Test? :)

by GerdP, 2 weeks ago

Attachment: 24982-test.patch​ added

non regression test

comment:8 by GerdP, 2 weeks ago

The test just checks with the nodes given in my example. It fails with the old code and passes with the new. OK?

comment:9 by gaben, 2 weeks ago

Yes, thanks!

comment:10 by stoecker, 2 weeks ago

Resolution: fixed
Status: closed → reopened

comment:11 by GerdP, 2 weeks ago

Resolution: → fixed
Status: reopened → closed

In 19673/josm:

fix #24982: Zoom to selection shows empty area

  • add unit test

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain GerdP.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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