Modify

Opened 4 years ago

Closed 4 years ago

#11808 closed defect (needinfo)

Worse WMS imagery resolution in 8677 then in 8491

Reported by: slodki Owned by: slodki
Priority: normal Milestone:
Component: Core imagery Version: tested
Keywords: wms imagery zoom max-zoom regression Cc: wiktorn

Description (last modified by Don-vip)

What steps will reproduce the problem?

  1. Run JOSM
  2. Load some OSM data in new layer in Poland
  3. Refresh Imagery presets
  4. Load "Geoportal 2: Ortofotomapa (aerial image)" WMS layer
  5. Zoom in to view details of ortofoto map

What is the expected result?

In 8491 "wms:http" preset can load more detailed images. See attached example.
Using geoportal ortofoto gives following images resolutions:
[zoom in JOSM as show in main GUI ruler] -> [WMS image resolution as given by properties of WMS layer]
3.15m -> 2.39m
2.23m -> 2.39m
1.58m -> 1.19m
1.11m -> 1.19m
0.79m -> 0.6m
0.56m -> 0.6m
0.39m -> 0.6m
...
0.14m -> 0.6m
The "zoom to native resolution" command is not working for this WMS layer in 8491 version.

What happens instead?

In 8677 version "wms:http" preset is treated as "wms[20]:http" by default. This blocks images from WMS in higher resolutions. See attached example of the same settings in new JOSM version - you can see worse images resolution.

Clean 8677 JOSM gives:
[zoom in JOSM as show in main GUI ruler] -> [WMS image resolution as given by properties of WMS layer]
3.15m -> 20 (zoomlevel?)
2.23m -> 20
1.58m -> 20
1.11m -> 20
0.79m -> 20
0.56m -> 20
0.39m -> 20
...
0.14m -> 20
The "zoom to native resolution" command for WMS layer in "20" resolution sets main JOSM GUI ruler at 9.58m.

Changing WMS definition (see https://josm.openstreetmap.de/wiki/Maps/Poland?action=diff&version=41) gives better results:
3.15m -> 21 (zoomlevel?)
2.23m -> 22
1.58m -> 22
1.11m -> 22
0.79m -> 22
0.56m -> 22
0.39m -> 22
...
0.14m -> 22

Validator at https://josm.openstreetmap.de/wiki/Maps not allows max-zoom value >22.
After creation custom WMS preset directly in JOSM for geoportal ortofoto with "wms[24]:http" results are better:
3.15m -> 21 (zoomlevel?)
2.23m -> 22
1.58m -> 22
1.11m -> 23
0.79m -> 23
0.56m -> 24
0.39m -> 24
...
0.14m -> 24
It's hard to validate datails at such high zoom levels - maybe 24 zoom level is not avaiable for geoportal...

Setting native resolution for WMS images in JOSM 8677 gives following ruler value:
20 -> 9.58m
21 -> 4.79m
22 -> 2.39m
23 -> 1.2m
24 -> 0.6m

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

8491:
more detailed WMS image from previous JOSM version

8677:
pixelized WMS image from current JOSM version

Changes required:

  1. Remove hidden restriction of WMS preset definition (without max-zoom parameter) to 20 zoom level
  2. Remove restriction of JOSM wiki validator for map presets https://josm.openstreetmap.de/wiki/Maps to allow define max-zoom parameters >22 where available
  3. Change zoom treshold to load hi-res images at lover zooms (as in previous version)
  4. Optional: update map presets at wiki - add max-zoom parameter where required
Repository Root: http://josm.openstreetmap.de/svn
Build-Date: 2015-08-21 23:32:08
Last Changed Author: Don-vip
Revision: 8677
Repository UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b
Relative URL: ^/trunk
URL: http://josm.openstreetmap.de/svn/trunk
Last Changed Date: 2015-08-21 22:18:03 +0200 (Fri, 21 Aug 2015)
Last Changed Rev: 8677

Identification: JOSM/1.5 (8677 pl) Linux Slackware 14.1
Memory Usage: 432 MB / 897 MB (311 MB allocated, but free)
Java version: 1.7.0_79, Oracle Corporation, OpenJDK Server VM
Dataset consistency test: No problems found

Attachments (9)

geoportal-8491.png (374.7 KB) - added by slodki 4 years ago.
more detailed WMS image from previous JOSM version
geoportal-8677.png (275.1 KB) - added by slodki 4 years ago.
pixelized WMS image from current JOSM version
www.png (66.6 KB) - added by slodki 4 years ago.
oryginal image from web browser (not WMS)
8491-1.png (57.6 KB) - added by slodki 4 years ago.
josm 8491 image at similar zoom
8491-2.png (106.1 KB) - added by slodki 4 years ago.
josm 8491 image zoomed
8491-3.png (183.5 KB) - added by slodki 4 years ago.
josm 8491 image zoomed more
8699-1.png (42.6 KB) - added by slodki 4 years ago.
josm 8699 image at similar zoom
8699-2.png (148.2 KB) - added by slodki 4 years ago.
josm 8699 image zoomed
8699-3.png (185.2 KB) - added by slodki 4 years ago.
josm 8699 image zoomed more

Download all attachments as: .zip

Change History (19)

Changed 4 years ago by slodki

Attachment: geoportal-8491.png added

more detailed WMS image from previous JOSM version

Changed 4 years ago by slodki

Attachment: geoportal-8677.png added

pixelized WMS image from current JOSM version

comment:1 Changed 4 years ago by Don-vip

Description: modified (diff)
Keywords: regression added

comment:2 Changed 4 years ago by wiktorn

In 8695/josm:

Allow zoom levels up to zoom level 24. Addresses: #11808

comment:3 Changed 4 years ago by wiktorn

In 8696/josm:

Glue WMS zoom levels to TMS zoom levels.

Based on WMTS well known scale set (in OGC spec: http://www.opengeospatial.org/standards/wmts) GoogleMapsCompatibile
implement same zoom levels for WMS in JOSM. This change makes WMS zoom levels corresponding (identical?) to TMS zoom
levels and independent of current projection (as it was till now).

Addresses: #11808

comment:4 Changed 4 years ago by wiktorn

@slodki:
Requests 2 and 4 are done. 4 in scope of Geoportal Ortophotomap. I haven't touched any other ortophotomaps.

Request 1 - 20 is default value, that is assumed, when no max-zoom is present. As the max-zoom prevents JOSM from trying to download tiles which do not exists, its both good for performance of JOSM, as for tile servers. The default value should be the most common found "in nature". I'm not sure if any other value than 20 will be better

Request 3 - this I do not understand. From now on, WMS has some artificial "zoom levels", that helps a lot with caching the WMS imagery. If you zoom in (one tick on mouse wheel), you move "half point" closer. It means, that JOSM will still use what it has downloaded, but just rescale the images, as it is done for TMS imagery. If you zoom in again, then zoom level changes - and attempt to download new tiles is made. Do you want JOSM to download tiles at every zoom level? It will make WMS caching far less effective, and cache effectivnes was at the ground for this change.

Changed 4 years ago by slodki

Attachment: www.png added

oryginal image from web browser (not WMS)

Changed 4 years ago by slodki

Attachment: 8491-1.png added

josm 8491 image at similar zoom

Changed 4 years ago by slodki

Attachment: 8491-2.png added

josm 8491 image zoomed

Changed 4 years ago by slodki

Attachment: 8491-3.png added

josm 8491 image zoomed more

Changed 4 years ago by slodki

Attachment: 8699-1.png added

josm 8699 image at similar zoom

Changed 4 years ago by slodki

Attachment: 8699-2.png added

josm 8699 image zoomed

Changed 4 years ago by slodki

Attachment: 8699-3.png added

josm 8699 image zoomed more

comment:5 in reply to:  4 ; Changed 4 years ago by slodki

Replying to wiktorn:

Ad 1 - maybe adding such default value is good for performance, but it brakes existing presets. JOSM 8491 doesn't restrict "wms:" preset to 20 zoom level, and it displays such presets at higher zoom. If you add new default 20 max-zoom value for presets, somebody (?) has to check all already defined presets and add max-zoom parameter for broken ones.

Ad 4 - so only one preset is fixed, but many of them are still broken and needs extra parameter to be added to work as expected (in earlier JOSM versions), not only at JOSM website, but user defined also (maybe some instructions at startup page for users is needed?)

Ad 2 - ok

Ad 3 - described mechanism of refreshing wms images only at some zoom and scaling them between is ok, but the images are downloaded with to low res to be usable. Maybe you should download images with better resolution (from next zoom level) and display them smaller (download image 512x512 and display it as 300x300 or 400x400)? Or there is a problem related to dpi used for display?

Screenshots from 8491 and 8699:

  1. Original picture from geoportal web service (displayed in web browser at max zoom):

oryginal image from web browser (not WMS)

  1. Same place as displayed by JOSM 8491 at similar and next zoom levels (from wms service), info about wms layer zoom displayed: 9.55m/9.55m/4.77m

josm 8491 image at similar zoomjosm 8491 image zoomedjosm 8491 image zoomed more

  1. Same place as displayed by JOSM 8699 at similar and next zoom levels (from wms service), info about wms layer zoom displayed: 19@724x724/20@511x512/20@723x724

josm 8699 image at similar zoomjosm 8699 image zoomedjosm 8699 image zoomed more

As you can see:
a) web browser is the best, old JOSM is better, current JOSM is the worst
b) old JOSM and new version downloads new resolution of wms image at different thresholds: old between 2nd and 3rd, new between 1st and 2nd
b) I don't know why one 512x512 image is scaled to 724x724, but next one to 723x724 - changing aspect ratio is really needed?

comment:6 in reply to:  5 Changed 4 years ago by wiktorn

Replying to slodki:

Replying to wiktorn:

Ad 1 - maybe adding such default value is good for performance, but it brakes existing presets. JOSM 8491 doesn't restrict "wms:" preset to 20 zoom level, and it displays such presets at higher zoom. If you add new default 20 max-zoom value for presets, somebody (?) has to check all already defined presets and add max-zoom parameter for broken ones.

Yes, I know.

Ad 4 - so only one preset is fixed, but many of them are still broken and needs extra parameter to be added to work as expected (in earlier JOSM versions), not only at JOSM website, but user defined also (maybe some instructions at startup page for users is needed?)

That's a good idea.

Ad 3 - described mechanism of refreshing wms images only at some zoom and scaling them between is ok, but the images are downloaded with to low res to be usable. Maybe you should download images with better resolution (from next zoom level) and display them smaller (download image 512x512 and display it as 300x300 or 400x400)? Or there is a problem related to dpi used for display?

This is possible, but this would result in wasted bandwith (when you download picture say, 500x500 and downscale it to 200x200), and requires more CPU power (more images to process) and memory. But I plan to add such tunable in Imagery Preferences, so you can choose - resources conservative way, and resource hungry, but hopefully, with better quality.

As you can see:
a) web browser is the best, old JOSM is better, current JOSM is the worst

I only see the difference in number 1. Bear in mind, that you're probably taking this screenshot in Mercator projection which is not supported by WMS service. That's why you see better results by WWW service.

When you click left button on the tile, and choose "Show tile info" menu, you'll get exact URL that was used to download the tile. Please compare this tile (loaded by browser for example) with what is shown in JOSM. If this tile in browser is looking bad, then problem is due to changed queries to WMS servers, if it looks good, then it should be addressed by additional setting, that I mentioned earlier.

comment:7 Changed 4 years ago by wiktorn

For tile zoom level control see #11856

comment:8 Changed 4 years ago by wiktorn

Did you tried zoom level controls? -1 setting should give you the behaviour as described in ad 3.

Is there anything left to fix?

Last edited 4 years ago by wiktorn (previous) (diff)

comment:9 Changed 4 years ago by wiktorn

Owner: changed from team to slodki
Status: newneedinfo

comment:10 Changed 4 years ago by Don-vip

Resolution: needinfo
Status: needinfoclosed

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain slodki.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.