单个WMS从单个地图文件与多个光栅在MapServer



我在一个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层(三个来自每个层和一个来自组层)。

我怎样才能达到我想要的?我使用Mapserver 6.4.1在OL 2.11.

欢迎任何想法,提前感谢,

你可以直接使用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"

看来联合层会做你所要求的。我自己没试过。从上面链接的文档:

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

我相信您正在寻找的是在6.4中引入的TILEINDEX方法。

引用引用:

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

参见光栅和平铺索引

相关内容

  • 没有找到相关文章

最新更新