0

Here is the .map file I am using for a simple map with one layer showing the blue marble world:

MAP
  NAME   "world"
  CONFIG "MS_ERRORFILE" "/home/balajeerc/Projects/gis_project_Build_Dir/gis_project/data/logs/mapservice_errors.log"
  CONFIG "PROJ_LIB" "/home/balajeerc/Projects/gis_project_Build_Dir/gis_project/deps/proj.4-master/share/proj"
  CONFIG "ON_MISSING_DATA" "LOG"
  DEBUG 5
  EXTENT -180.000 -90.000 180.000 90.000
  SHAPEPATH "/home/balajeerc/Projects/gis_project_Build_Dir/gis_project/data/service_data/data/wms"
  IMAGECOLOR 255 255 255
  SIZE 1350 675

  WEB
    METADATA
      "wms_title" "Georbis WMS Server"
      "wms_author" "MyCompany"
      "wms_onlineresource" "http://10.0.0.8:19090/rasters/world/wms?"
      "wms_enable_request" "*"
      "wms_srs" "epsg:4326 epsg:3857"
      "wms_feature_info_mime_type" "text/html"
      "wms_format" "image/jpg"
    END
  END

  PROJECTION
    "init=epsg:4326"
  END

  LAYER
    NAME world
    TYPE RASTER
    DATA "world.tif"
    EXTENT -180.000 -90.000 180.000 90.000
    METADATA
      "wms_title" "BlueWorld Map"
      "wms_srs" "epsg:4326 epsg:3857"
      "wms_server_version" "1.1.1"
    END
    PROJECTION
      "init=epsg:4326"
    END
  END
END

Here is the WMS request I am making to the server:

http://localhost:19090/rasters/world/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetMap&FORMAT=image%2Fjpeg&TRANSPARENT=false&LAYERS=world&mode=map&CRS=EPSG%3A4326&STYLES=&WIDTH=696&HEIGHT=872&BBOX=303302.12823557947%2C-14401959.121379768%2C8834897.477313813%2C-7592337.145509986

The trouble is that even though I specify a width and height of 696 and 872 respectively, I always get an image with the original image dimensions, i.e. 1350 x 675.

Why is this the case? Like other WMS servers, I am hoping that Mapserver will also scale the base layer into the resolution I am requesting from it.

  • Because you use &mode=map which is forcing MapServer into the native CGI mode instead of WMS. Take it off and read also examples from mapserver.org/ogc/wms_server.html. Your BBOX is wrong for CRS=EPSG:4326, you must give it in degrees and lat-lon order for WMS version 1.3.0. – user30184 Nov 20 '15 at 6:33
  • Metadata item "wms_server_version" is unnecessary in your layer metadata. It belongs to another use case of cascading WMS layers and documented in mapserver.org/ogc/wms_client.html. – user30184 Nov 20 '15 at 6:40
1

As @user30184 commented:

Because you use &mode=map which is forcing MapServer into the native CGI mode instead of WMS. Take it off and read also examples from http://mapserver.org/ogc/wms_server.html. Your BBOX is wrong for CRS=EPSG:4326, you must give it in degrees and lat-lon order for WMS version 1.3.0.

Metadata item "wms_server_version" is unnecessary in your layer metadata. It belongs to another use case of cascading WMS layers and documented in http://mapserver.org/ogc/wms_client.html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.