[MapServer-users] WMS with a GPKG-based layer : different responses, dependending on version (1.1.1 vs 1.3.0)

Rahkonen Jukka jukka.rahkonen at maanmittauslaitos.fi
Fri Feb 27 06:27:47 PST 2026


Hi,

Thank you for the test package. I think I know what happens and I have a fix or a workaround for you.

I added some more debugging first, not sure if all these were really needed.

CONFIG MS_ERRORFILE "c:\ms4w_data\test2\errorfile.txt"
CONFIG "CPL_DEBUG" "ON"
CONFIG "PROJ_DEBUG" "ON"

The MS_ERRORFILE shows what is the difference.


WMS 1.1.0 is using method "msDrawRasterLayerGDAL()"

msDrawRasterLayerGDAL(): Entering transform.
msDrawRasterLayerGDAL(): src=0,0,4096,2048, dst=0,10,994,498

WMS 1.3.0 probably believes that is must do warping and it selects to use method "msDrawGDAL(Image_Layer)"

msResampleGDALToMap in effect: cellsize = 0.181087
msDrawGDAL(Image_Layer): using RAW_WINDOW=0 0 4096 2048, dst=0,0,1988,994

I do not understand the details, but in WMS 1.3.0 case the values in "dst" (destination) are about doubled.

The Apache error log shows that depending on the WMS version, GDAL selects different overview levels from the GeoPackage, either "overview 1024 x 512" or "overview 2048 x 1024"

Maybe the best fix for this case would be to make Mapserver consider that EPSG:4326 and CRS:84 are the same and no warping is needed between those two. And therefore there is no need to select the other code path.

As a workaround, see https://mapserver.org/input/raster.html and add this line into your LAYER:
PROCESSING "OVERSAMPLE_RATIO=1.0"
Oversampling means that higher resolution data than what is needed for the output is read in for warping. That improves the quality of the warped result. That is fine for orthophotos and scanned maps, but in your use case the better resolution overview contains also different data from another zoom level.

I tried also "PROCESSING ALLOW_OVERSAMPLE=NO" but for some reason it did not work for me. I was testing with a bit old MapServer version 8.3.0-dev  (MS4W 5.0.0).

-Jukka Rahkonen-

________________________________________
Lähettäjä: Philippe Ghesquiere <philippe.ghesquiere at airbus.com>
Lähetetty: Perjantai 27. helmikuuta 2026 14.40
Vastaanottaja: Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi>
Kopio: MapServer Users <mapserver-users at lists.osgeo.org>; Sylvain Pomeon <sylvain.pomeon at airbus.com>
Aihe: Re: [MapServer-users] WMS with a GPKG-based layer : different responses, dependending on version (1.1.1 vs 1.3.0)

Hi Jukka,I finally manage to upload a TGZ containing:a 3 level OSM GPKG filea mapserver configuration filehttps://drive.google.com/file/d/1XjduR5L6aoSRuKEKYb9hBNB07Gv7_-P2/view?usp=drivesdkLet me know if you manage to download it and if you have enough information to reproduceThanksPhilippeOn Fri, Feb 27, 2026 at 10:32 AM Rahkonen Jukka <jukka.rahkonen at maanmittauslaitos.fi> wrote:Hi,Do you have any possibility to make a complete re-producible test case with a small raster GeoPackage and a minimal mapfile? I know I could do such myself, but even I am curious to try what happens I am also somewhat lazy. And because I am just another MapServer user I do not feel hard pressure.-Jukka Rahkonen-The information in this e-mail is confidential. The contents may not be disclosed or used by anyone other than the addressee. Access to this e-mail by anyone else is unauthorised.If you are not the intended recipient, please notify Airbus immediately and delete this e-mail.Airbus cannot accept any responsibility for the accuracy or completeness of this e-mail as it has been sent over public networks. If you have any concerns over the content of this message or its Accuracy or Integrity, please contact Airbus immediately.All outgoing e-mails from Airbus are checked using regularly updated virus scanning software but you should take whatever measures you deem to be appropriate to ensure that this message and any attachments are virus free.


More information about the MapServer-users mailing list