来自单个mapfile的单个WMS,在MapServer中有多个栅格

时间:2015-05-20 14:36:25

标签: layer raster mapserver map-files

我在一个mapfile中有几个栅格,我把它们放在像这样的层中:

LAYER
    NAME            "Layer 1"
    GROUP           "All Layers"
    TYPE            RASTER
    STATUS          ON
    DATA            "layer1.png"

    PROJECTION
        "init=epsg:4326"
    END

    METADATA
        "wms_title"         "Layer 1"
        "wms_srs"           "EPSG:4326"
        "wms_group_title"   "All layers"
        "wms_abstract"          "No abstract"
        "wms_server_version"        "1.1.1"
        "wms_format"            "image/png"
        "wms_include_items"     "all"
        "gml_include_items"     "all"
        "gml_geom_type"         "raster"
    END
END

LAYER
    NAME            "Layer 2"
    GROUP           "All Layers"
    TYPE            RASTER
    STATUS          ON
    DATA            "layer2.png"

    PROJECTION
        "init=epsg:4326"
    END

    METADATA
        "wms_title"         "Layer 2"
        "wms_srs"           "EPSG:4326"
        "wms_group_title"   "All layers"
        "wms_abstract"          "No abstract"
        "wms_server_version"        "1.1.1"
        "wms_format"            "image/png"
        "wms_include_items"     "all"
        "gml_include_items"     "all"
        "gml_geom_type"         "raster"
    END
END

LAYER
    NAME            "Layer 3"
    GROUP           "All Layers"
    TYPE            RASTER
    STATUS          ON
    DATA            "layer3.png"

    PROJECTION
        "init=epsg:4326"
    END

    METADATA
        "wms_title"         "Layer 3"
        "wms_srs"           "EPSG:4326"
        "wms_group_title"   "All layers"
        "wms_abstract"          "No abstract"
        "wms_server_version"        "1.1.1"
        "wms_format"            "image/png"
        "wms_include_items"     "all"
        "gml_include_items"     "all"
        "gml_geom_type"         "raster"
    END
END

问题是我希望将一个WMS图层(在GroupTitle中命名)作为此mapfile的输出(因为它只是一个mapfile),而是我有四个WMS图层(三个来自每个LAYER,一个来自GROUP LAYER)。

我怎样才能实现我想要的目标?我在OL 2.11中使用Mapserver 6.4.1。

预先感谢任何想法,

3 个答案:

答案 0 :(得分:1)

似乎Union Layer可以满足您的要求。我自己没试过。从上面链接的文档:

LAYER
  NAME "union-layer"
  TYPE POINT
  STATUS DEFAULT
  CONNECTIONTYPE UNION
  CONNECTION "layer1,layer2,layer3" # reference to the source layers
  PROCESSING "ITEMS=itemname1,itemname2,itemname3"
  ...
END
LAYER
  NAME "layer1"
  TYPE POINT
  STATUS OFF
  CONNECTIONTYPE OGR
  CONNECTION ...
  ...
END

答案 1 :(得分:1)

您可以使用GROUP元素:

LAYER
    NAME           "layer1"
    GROUP           "both_layers"
    STATUS         OFF
    TYPE           RASTER
    DATA           "layer1.tif"
END

LAYER
    NAME           "layer2"
    GROUP           "both_layers"
    STATUS         OFF
    TYPE           RASTER
    DATA           "layer2.tif"
END

然后在WMS请求中引用“both_layers”。

答案 2 :(得分:1)

我相信你所寻找的是6.4中引入的TILEINDEX方法。

引用参考文献:

  

处理非常大的栅格图层时,将光栅图像分割成许多较小的图像通常很方便,性能更高。每个文件都是可用于显示的较大光栅镶嵌的图块。形成图层的文件列表可以存储在shapefile中,其中多边形表示每个文件的占用空间以及文件的名称。

请参阅Rasters and Tile Indexing