首页 > 其他分享 >【海图Maritime】隐藏MCS服务陆地要素

【海图Maritime】隐藏MCS服务陆地要素

时间:2023-07-18 14:22:25浏览次数:33  
标签:layers maxScale Maritime parentLayerId defaultVisibility 海图 subLayerIds MCS id

默认情况下,在海岸周边的海图数据,是具备陆地信息,因此在发布服务之后,是能够看到陆地要素的,如下

image

而在某些业务场景,我们需要的隐藏陆地要素,通常有两种做法

  1. 自己具备陆地要素的地图服务,那么将海图服务放在底层,陆地地图服务放在上层即可
  2. 如本身不具备完整的陆地地图服务,那么以上做法则无法满足要求,则需要对海图MCS服务进行控制,本文介绍这种处理方式

MCS服务端控制

海图数据本身是分物标对象存储,不以GIS常规的图层方式进行数据存储,在ArcGIS Maritime Server中进行数据的抽取以及图层重构,并以S52规范进行显示控制,图层配置信息写在S52DisplayProperties.xml文件,如下13个可控制图层,修改一下value值,可后台固定化配置,修改完成后,重启相应服务即可

<Parameter name="0" type="E" default="2" value="2"
           range="11000-11999,21010-21029,21031-21999,31000-31009,31012-31029,31032-31999">
    <Description>Information about the chart display</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="1" type="E" default="2" value="2"
           range="12000-12999,22000-22999,32000-32999">
    <Description>Natural and man-made features, port features</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="2" type="E" default="2" value="2"
           range="13000-13999,23000-23009,23011-23999,33000-33999">
    <Description>Depths, currents, etc</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="3" type="E" default="2" value="2"
           range="14000-14999,24000-24999,34000-34999">
    <Description>Seabed, obstructions, pipelines</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="4" type="E" default="2" value="2"
           range="15000-15999,25000-25999,35000-35999">
    <Description>Traffic routes</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="5" type="E" default="2" value="2"
           range="16000-16999,26000-26999,36000-36999">
    <Description>Special areas</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="6" type="E" default="2" value="2"
           range="17000-17999,27000-27999,37000-37999">
    <Description>Buoys, beacons, lights, fog signals, radar</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="7" type="E" default="2" value="2"
           range="18000-18999,28000-28999,38000-38999">
    <Description>Services and small craft facilities</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="8" type="E" default="2" value="1" range="31010">
    <Description>Data quality</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="9" type="E" default="2" value="1" range="31011">
    <Description>Low accuracy</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="10" type="E" default="2" value="1" range="31030,31031">
    <Description>Additional chart information</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="11" type="E" default="2" value="1" range="23010">
    <Description>Shallow water pattern</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>
<Parameter name="12" type="E" default="2" value="1" range="21030">
    <Description>Overscale warning</Description>
    <ExpectedInput code="1" value="False" />
    <ExpectedInput code="2" value="True" />
</Parameter>

图层对应关系表

id Description 备注
0 Information about the chart display 图表信息
1 Natural and man-made features, port features 路地区和人造区、港口、陆地
2 Depths, currents, etc 等深区、水流
3 Seabed, obstructions, pipelines 海底、障碍物、管道
4 Traffic routes 航路
5 Special areas 特殊区域
6 Buoys, beacons, lights, fog signals, radar 浮标、信标、灯光、雾灯、雷达
7 Services and small craft facilities 服务设施、小船
8 Data quality 数据质量
9 Low accuracy 低精度模式
10 Additional chart information 图表信息
11 Shallow water pattern 浅水模式
12 Overscale warning 超标警告

MCS浏览器端控制

观察海图MCS服务,其中请求返回的元数据信息如下,其中layers对象与S52DisplayProperties.xml文件中的图层对象信息一致,因此可以使用MapServer服务export接口的layers参数进行图层绘制的控制。

{
    "currentVersion": 10.9,
    "serviceDescription": "ArcGIS for Maritime Server's Maritime Chart Service capability is a Server Object Extension that provides both OGC WMS and Esri REST services to quickly view and query your S-57 or S-63 encrypted datasets.",
    "mapName": "Maritime Chart Service",
    "description": "",
    "copyrightText": "",
    "layers": [
        {
            "id": 0,
            "name": "Information about the chart display",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 1,
            "name": "Natural and man-made features, port features",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 2,
            "name": "Depths, currents, etc",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 3,
            "name": "Seabed, obstructions, pipelines",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 4,
            "name": "Traffic routes",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 5,
            "name": "Special areas",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 6,
            "name": "Buoys, beacons, lights, fog signals, radar",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 7,
            "name": "Services and small craft facilities",
            "defaultVisibility": true,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 8,
            "name": "Data quality",
            "defaultVisibility": false,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 9,
            "name": "Low accuracy",
            "defaultVisibility": false,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 10,
            "name": "Additional chart information",
            "defaultVisibility": false,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 11,
            "name": "Shallow water pattern",
            "defaultVisibility": false,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        },
        {
            "id": 12,
            "name": "Overscale warning",
            "defaultVisibility": false,
            "parentLayerId": -1,
            "subLayerIds": null,
            "minScale": 0,
            "maxScale": 0
        }
    ],
    "tables": [

    ],
    "spatialReference": {
        "wkid": 102100
    },
    "singleFusedMapCache": false,
    "initialExtent": {
        "xmin": 11020629.5885340851,
        "ymin": -1006021.06275513361,
        "xmax": 13747957.1129692867,
        "ymax": 2937284.43742384249,
        "spatialReference": {
            "wkid": 102100
        }
    },
    "fullExtent": {
        "xmin": -19926188.8519959711,
        "ymin": -30240971.9583862536,
        "xmax": 19926188.8519959711,
        "ymax": 30240971.9583862051,
        "spatialReference": {
            "wkid": 102100
        }
    },
    "units": "esriMeters",
    "supportedImageFormatTypes": "PNG, PDF",
    "capabilities": "Map,Query",
    "documentInfo": {
        "title": "Maritime Chart Service",
        "author": "ArcGIS for Maritime Server",
        "comments": "Not to be used for navigation.",
        "subject": "S-57 Web Services",
        "category": "S-57",
        "keywords": "S-57"
    }
}

export接口layers参数

Determines which layers appear on the exported map. There are four ways to specify which layers are shown:

  • show—Only the layers specified in this list will be exported.
  • hide—All layers except those specified in this list will be exported.
  • include—In addition to the layers exported by default, the layers specified in this list will be exported.
  • exclude—The layers exported by default excluding those specified in this list will be exported.

Syntax

//Where layerId1 and layerId2 are the layer ids returned by the  map service resource
[show | hide | include | exclude]:layerId1,layerId2

Example

layers=show:2,4,7

前端请求方式

通过defaultVisibility可以观察到,在默认请求下,id为8、9、10、11、12图层为关闭绘制状态,一般情况下不需要显示。

综合以上信息,只需额外关闭id为1的图层即可,但需注意,默认关闭的图层,如无特殊需要,也请关闭

let layer = new MapImageLayer({
    url: url,
    customParameters: {
        "layers": "show:0,2,3,4,5,6,7",
    }
});

完整demo如下

<html>

<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no" />
    <title>
        Intro to ENC Layer
    </title>
    <style>
        html,
        body,
        #viewDiv {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
        }
    </style>

    <link rel="stylesheet" href="https://js.arcgis.com/4.27/esri/themes/light/main.css" />
    <script src="https://js.arcgis.com/4.27/"></script>

    <script>
        require(["esri/Map", "esri/views/MapView", "esri/layers/MapImageLayer"], (Map, MapView, MapImageLayer) => {

            const map = new Map({
                basemap: "topo-vector"
            });


            let layer = new MapImageLayer({
                url: "https://192.168.1.34:6443/arcgis/rest/services/SampleWorldCities/MapServer/exts/MaritimeChartService/MapServer",
                customParameters: {
                    "layers": "show:0,2,3,4,5,6,7"
                }
            });

            map.add(layer);
            const view = new MapView({
                container: "viewDiv",
                map: map,
                zoom: 4,
                center:[113,23]
            });

        });
    </script>
</head>

<body>
    <div id="viewDiv"></div>
</body>

</html>

效果如下

image

标签:layers,maxScale,Maritime,parentLayerId,defaultVisibility,海图,subLayerIds,MCS,id
From: https://www.cnblogs.com/wongjzzz/p/17562817.html

相关文章

  • 云原生之使用Docker部署PESMCS Ticket工单系统
    (云原生之使用Docker部署PESMCSTicket工单系统)一、PESMCSTicket介绍PESMCSTicket是一款基于GPLv2协议发布的开源客服工单系统。二、检查本地系统环境1.检查系统版本[root@node~]#cat/etc/os-releaseNAME="CentOSLinux"VERSION="7(Core)"ID="centos"ID_LIKE=......
  • 基于OMAPL138+FPGA核心板——MCSDK开发入门(下)
    本文测试板卡为创龙科技SOM-TL138F是一款基于TIOMAP-L138(定点/浮点DSPC674x+ARM9)+紫光同创Logos/XilinxSpartan-6低功耗FPGA处理器设计的工业级核心板。核......
  • 基于OMAPL138+FPGA核心板多核软件开发组件MCSDK开发入门(上)
    本文测试板卡为创龙科技SOM-TL138F是一款基于TIOMAP-L138(定点/浮点DSPC674x+ARM9)+紫光同创Logos/XilinxSpartan-6低功耗FPGA处理器设计的工业级核心板。核......
  • [代码审计基础 15]phpmcs_v9.6 rce
    PHP:5.4.5设置调试:https://blog.csdn.net/m0_46641521/article/details/120107786版本:phpcms_v9.6.0_UTF80x01:路由分析和前一篇一样的路由,但是对输入的关键字都有了防护......
  • 通信小白基础学习---5G参数CQI与MCS\TBS
    以下内容来源于B站up主“捻叶成剑”,如有侵权,请联系本人删除!表1和表2用于eMBB大带宽     URLLC高可靠低时延PDSCH基站给用户发数据  ......
  • MCS51 串口编程 proteus 仿真
    1.下载proteus8.9中文版,按网上的安装指导破解安装,安装后的sample目录下有很多例子,可以先调出来仿真看看2.安装后一些常见的MCU的C语言编译器需要在源代码界面的系统/......
  • [SIGMOD 2022]DMCS Density Modularity based Community Search
    [SIGMOD2022]DMCS:DensityModularitybasedCommunitySearch介绍目标是找到含有查询点的社区。文章的切入点是高质量的社区一定也是高模块化的,及社区内密度高,且社......
  • 使用 vlmcsd 部署 KMS 服务器
     一、前言:vlmcsd就是一个仿真KMS管理工具,可以部署在内网或者公网可以运行在Linux、Windows等系统平台上。 由于WindowsVL都是为批量激活而诞生,KMS服务器的作用......
  • 上海图书馆 & 上海图书馆东馆 All In One
    上海图书馆&上海图书馆东馆AllInOne上海图书馆https://www.library.sh.cnhttp://www.library.sh.cn/jump/http://www.libnet.sh.cn/新版网站https://library.s......