1

I have a client for the WMS-Services of my mapserver. The client program is written in JavaScript and it uses OpenLayers (v. 2.12). The map has as a base layer "Google satellite"-Layer and the Mercator projection. The WMS layers are overlayers. Some of them have as a source data - raster data and some of them have as data - vector data.

I have no problem with WMS "raster" layers. But I have a problem with WMS "vector" layers. If my OpenLayers map is dragged too much to the left and the generated request to mapserver is started, the WMS "vector" layers go to be invisible (and it happens only on the lowest zoom level). I found out that the bbox in generated requests is in some way wrong because the mapserver response is empty: I tested the automatically generated request strings as links in my browser (Firefox or Chrome). I have modified the mapfile and I added the Mercator projection to it. But it did not help. Here is the begin of the map file:

MAP
  NAME "africa_southafrica_admin"
  PROJECTION
    "init=epsg:4326"
    "init=epsg:3857"
    "init=epsg:900913"
  END
  STATUS ON
  TRANSPARENT ON
  UNITS METERS
  WEB
    METADATA
      "wms_srs" "epsg:4326 epsg:3857 epsg:32733 epsg:900913"
      "wms_title" "ROCEEH Southafrica"
      "wms_onlineresource" "https://www.roceeh.uni-tuebingen.de/cgi-bin/mapserv?map=mapdata/MAP_88361.map"
      "wms_enable_request" "*"
      "ms_enable_modes" "*"
      "labelcache_map_edge_buffer" "-30"
    END
  END
  MAXSIZE 10000
  SIZE  2048  2048
  EXTENT -180.0 -89.0 180.0 89.0
  FONTSET "font/fontset"
  LAYER
    NAME "SRTM_90m_Screening"
    STATUS OFF
    CLASS
      STYLE
        OUTLINECOLOR 102 255 51
      END
      NAME "Satellite_SRTM_90m"
      LABEL
        TYPE BITMAP
        SIZE SMALL
        COLOR 102 255 51
      END
    END
    TOLERANCE 3
    PROJECTION
      "init=epsg:4326"
      "init=epsg:900913"
    END
    GROUP "Satellite_Data_Index"
    LABELITEM "name"
    METADATA
      "wms_title" "SRTM 90m"
      "wms_group_title" "Satellite Data Index"
      "wms_abstract" "No information available."
      "wms_include_items" "all"
      "gml_include_items" "all"
      "gml_geometries" "the_geom"
      "gml_the_geom_type" "multipolygon"
    END
  ...

Here two requests to Mapserver: the first does not work and the second is fine:

  1. https://www.roceeh.uni-tuebingen.de/cgi-bin/mapserv?map=mapdata/MAP_88361.map&FORMAT=image%2Fpng&LAYERS=SRTM_90m_Screening&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A3857&BBOX=-45940489.454273,-7333063.5634033,-18555242.460298,12831635.991646&WIDTH=1399&HEIGHT=1030

  2. https://www.roceeh.uni-tuebingen.de/cgi-bin/mapserv?map=mapdata/MAP_88361.map&FORMAT=image%2Fpng&LAYERS=SRTM_90m_Screening&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A3857&BBOX=-13203427.488628,-10777010.309341,14181819.505347,9387689.245708&WIDTH=1399&HEIGHT=1030

What I can do or how can I control the automatically generated requests to avoid the described misbehavior?

2 Answers 2

1

I have solved my problem. Perhaps not the best way... The solution was a "singleTile" option for every WMS-Layer. It was set always to true. With "singleTile: false" I solved my problem.

Actually my problem with WMS "vector" layers persisted on all zoom levels. It was simply difficult to see this.

0

I'm not sure if this will fix your problem, but the projection information in the map file is, I think, incorrect.

For example in the first PROJECTION declaration (as below), there should be just one projection, which should be the default projection for the service.

MAP
    NAME "africa_southafrica_admin"
    PROJECTION
        "init=epsg:4326"
        "init=epsg:3857"
        "init=epsg:900913"
    END

In the LAYER PROJECTION declarations (as below), there should be just one projection which should be the projection that the layer data is actually in.

LAYER
    NAME "SRTM_90m_Screening"
    ...
    PROJECTION
      "init=epsg:4326"
      "init=epsg:900913"
    END

The list of supported projections for the service is added in the WEB METADATA section

"wms_srs" "epsg:4326 epsg:3857 epsg:32733 epsg:900913"

If you want a layer to support a different set of projections you add a similar statement in the LAYER METADATA

1
  • Thanks for the answer. It did not help. I changed the mapfile layer specification: DATA "the_geom from satellite_srtm_90m" CONNECTIONTYPE POSTGIS CONNECTION "..." TYPE POLYGON TOLERANCE 3 PROJECTION "init=epsg:4326" END METADATA "wms_title" "SRTM 90m" "wms_group_title" "Satellite Data Index" "wms_abstract" "No information available." "wms_include_items" "all" "gml_include_items" "all" "gml_geometries" "the_geom" "gml_the_geom_type" "multipolygon" "wms_srs" "epsg:3857 epsg:900913" END END
    – Zara
    Apr 11, 2014 at 7:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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