Skip to content

WMS with a GPKG-based layer : different responses, depending on version (1.1.1 vs 1.3.0) #7450

Description

@FilipGh

Software environment

  • Mapserver 8.2.0
  • Mapcache 1.14.0
  • Gdal V3.8.4
  • Alma Linux V8

Problem description

(see discussion on mapserver-users)
WMS Getmap responses depend on version V1.1.1 vs V1.3.0:

For example:

Image Image

Some explanations

(see https://www.mail-archive.com/[email protected]/msg29229.html, thanks to @jratike80)

  • 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

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"

Workarounds

Adding some processing directives in the LAYER definition:
PROCESSING "OVERSAMPLE_RATIO=1.0"

An other option is to modify CRS value in the WMS/V1.3.0 request (instead of EPSG:4326):
CRS=CRS:84

How to reproduce

Here is the mapserver file:

MAP
    NAME "Services_WMS"
    STATUS ON

    PROJECTION
        'init=epsg:4326'
    END

    EXTENT -180.000000 -90.000000 180.000000 90.000000
    MAXSIZE 1000

    LAYER
        NAME "Image_Layer"
        STATUS ON
        TYPE RASTER
        DATA "osm_3_levels.gpkg"

        PROJECTION
            'init=epsg:4326'
        END

        # paramètres de connection
        PROCESSING "CLOSE_CONNECTION=DEFER"
        PROCESSING "GAMMA=0.5"

        METADATA
            "wms_name" "Image_Layer"
            "wms_title" "Couche image"
            "wms_abstract" "Affichage de la couche image"
        END
    END #LAYER

END

The GPKG file, containing OSM up to ZoomLevel=3 can be found on the following link:
https://drive.google.com/file/d/1XjduR5L6aoSRuKEKYb9hBNB07Gv7_-P2/view?usp=drivesdk

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions