GM15: WMS calculation error

TobWenTobWen Global Mapper UserPosts: 65Trusted User
edited March 2014 in Bug Report
I'm using this WMS in GM15 trial:
http://www.wms.nrw.de/geobasis/wms_nw_dtk10?SERVICE=WMS&SRS=EPSG:31466&VERSION=1.1.1

I checked my WMS traffic and got this:


2561172.752,5672078.903,2564548.835,5674240.549&WIDTH=1277HEIGHT=817

Let's debug this:


2564548.835 - 2561172.752 = 3376.083
5674240.549 - 5672078.903 = 2161.646

1277 / 3376.083 = 0.378248994
817 / 2161.646 = 0.377952727

Actually, this can't be correct since the pixel has to be square and 0,377952756 (based on 96 ppi, like GM15 is).

So, the correct coordates should be:
2561172.752
5672078.903
2564551.481
5674240.549

Comments

  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2014
    It looks like this is for fixed download of the entire screen which is done by default for added WMS layers. It turns out there was a calculation in there to set the download size to get square pixels, but it wasn't also updating the right or bottom of the rectangle but was just using the screen bounds intersected with the layer bounds. I have updated the request bounds to adjust for the square pixels, although it's always going to be a change less than 1 pixel in size so you likely won't even be able to see a difference.

    I have placed a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15.zip with the latest changes for you to try. Simply download that file and extract the contents into your existing v15.xx installation folder to give it a try. If you are using the 64-bit v15 version there is a new build at http://www.bluemarblegeo.com/downloads/global-mapper/global_mapper15_64bit.zip .

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • TobWenTobWen Global Mapper User Posts: 65Trusted User
    edited March 2014
    Thanks for the fix. It's not about 1 px, let me explain you the background:
    I played around with WMS caching, but I've never got a hit... Now it works, great.

    Important question:
    Resampling is switched off in "Raster Options" for the WMS, but it still resamples. Could you fix this please?
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2014
    If you go near the bottom of the Advanced section of the General tab of the Configuration dialog there is a setting called 'Disable Automatic Interpolation of Zoomed-Out Display'. If you check that then the resampling of layers, including WMS layers, marked as 'No Resampling' when zoomed out past a 1:1 pixel mapping will no longer be done automatically to create a better looking display.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • TobWenTobWen Global Mapper User Posts: 65Trusted User
    edited March 2014
    Thanks again.

    Back to the main problem: I've just read, WMS 1.3 can send not square pixel size. I hope my bug report and your patch didn't break this.
  • global_mapperglobal_mapper Administrator Posts: 17,238
    edited March 2014
    For non-tiled WMS (the default when displaying) the original WMS source pixel size doesn't really matter, Global Mapper will basically just pass in the display bounding box and pixel size in the projection used by the WMS source, then reproject and resample that to the display as needed. A new image is fetched whenever you zoom or pan.

    If you export or switch to tile-based drawing for the WMS source then the source is set to a fixed number of zoom levels (up to the maximum resolution of the source) and then tiled to 512x512 tiles covering the entire source bounds, then the tiles needed for a view/export are downloaded as needed. This allows caching so if you hit the same area again at around the same zoom scale you can get cached results rather than having to re-download. The tiles will have square pixels in the native projection of the WMS source, but if the WMS source has non-square pixels that is fine, the server should just resample those to fit the requested bounds and pixel size.

    Thanks,

    Mike
    Global Mapper Guru
    geohelp@bluemarblegeo.com
    Blue Marble Geographics for Coordinate Conversion, Image Reprojection and Vector Translation
  • TobWenTobWen Global Mapper User Posts: 65Trusted User
    edited March 2014
    Yeah, sure. But I want to create as little load as possible to the WMS. WMS is very heavy-load when rendering images and realtime without caching. I'll test everything (even with non-square pixels) and report again.

    Thanks for your fixings.
Sign In or Register to comment.