柿子树备忘录

vuePress-theme-reco 柿子树    2023
柿子树备忘录

Choose mode

  • dark
  • auto
  • light
首页
个人笔记
  • Web
  • GIS
  • Database
  • DevOps
  • 可视化
地图故事
生活点滴
归档
关于我
author-avatar

柿子树

109

Article

73

Tag

首页
个人笔记
  • Web
  • GIS
  • Database
  • DevOps
  • 可视化
地图故事
生活点滴
归档
关于我
  • GIS理论基础

    • GIS基础知识
    • 地图坐标系统
  • GeoServer笔记

    • 思维导图
    • 一、OGC简述

    • 二、基本使用

    • 三、服务标准

      • WMS简述
      • WFS简述
      • WCS简述
      • WMTS简述
    • 四、图层加载

    • 五、服务端开发

  • Openlayers

    • 思维导图
    • 一、快速起步

    • 二、ol结构体系

    • 三、数据源加载

    • 四、常用控件

    • 五、几何对象与Style样式

    • 六、事件交互

    • 七、OGC服务

    • 八、常用示例

  • CesiumJS

    • 思维导图
  • WorldWind

    • WorldWindJava 学习笔记
    • OpenGL中的坐标系

WCS简述

vuePress-theme-reco 柿子树    2023

WCS简述

ac 2020-03-29 WCS

# 1. Coverages

在介绍Web Coverage Service之前,我们先了解一下Coverages。

Coverages表示位于空间/时间上的同构值集合,例如时空传感器、图像、模拟和统计数据。比如一维的时间序列、二维图像、三维(x,y,t)图像时间序列和(x,y,z)地球物理体元模型,以及4D的(x,y,z,t)气候和海洋数据。

Coverages可以以任何合适的格式编码(如GML、JSON、GeoTIFF或Net-CDF),并且可以进行分区。它可以由单个文档(流或文件)或一组分层组织的文档表示,每个文档都可以单独编码,例如,domain set、range type和metadata 可以编码成易于解析的GML、JSON、或RDF,而range set是用一些紧凑的二进制格式编码的,如NetCDF或JPEG2000。这样的分区允许在空间、时间或混合中平铺覆盖,从而支持镶嵌、时间交错覆盖和有效的可子集数据集。

OGC的Coverage Implementation Schema(CIS)通过建立一个具体的、可互操作的、符合性可测试的覆盖结构来指定OGC coverage model

下图是AbstractCoverage接口的类图:

abstractCoverageStructure
  • coverage­Function:描述如何获得Coverage位置的范围值

  • envelope:Coverage 的 bounding box

  • DomainSet:coverage 切确的位置,描述边界(envelope)。通过一个轴的有序列表来定义,这些轴的上界和下界建立了每个轴的范围

  • rangeSet:coverage 实际范围值,每一个都与domain set中定义的一个直接位置相关联。

  • rangeType:coverage 结构的描述和技术元数据,是一个SWE Common规范中的DataRecord,另外还可以添加一个插补指令。

  • metadata:特定的元数据,允许单独的扩展

Coverages独立于服务定义,因此可以通过各种OGC服务类型进行访问,例如WCS。

# 2. WCS(Web Coverage Service)

OGC 网络覆盖服务 (WCS) 支持将地理空间数据作为Coverage进行电子检索,为如何请求地理空间图像的栅格源提供了一个标准接口。

WCS Spec Hierachy

# 3. WCS的核心操作

WCS可以执行以下操作:

Operation Description
GetCapabilities 检索服务器数据的列表,以及有效的WCS操作和参数
DescribeCoverage 检索完整描述请求覆盖范围的XML文档。
GetCoverage 返回特定格式的Coverage

# 3.1 GetCapabilities

参数列表:

name description
service=wcs 服务名称,固定为"wcs"
version 版本
request=GetCapabilities 操作

KVP形式:

http://localhost:8080/geoserver/ows?service=wcs&version=1.0.0&request=GetCapabilities

XML形式:

http://localhost:8080/geoserver/wcs

<GetCapabilities
  service="WCS"
  version="1.0.0"
  xmlns="http://www.opengis.net/wcs"
  xmlns:nurc="http://www.nurc.nato.int"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wcs http://schemas.opengis.net/wcs/1.0.0/wcsCapabilities.xsd"/>
1
2
3
4
5
6
7

响应示例:

响应结果包含服务description服务描述、Capability服务能力、ContentMetadata服务器中提供的栅格数据信息(栅格图层)。

<?xml version="1.0" encoding="UTF-8"?>
<wcs:WCS_Capabilities version="1.0.0" xmlns:wcs="http://www.opengis.net/wcs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs http://localhost:8080/geoserver/schemas/wcs/1.0.0/wcsCapabilities.xsd" updateSequence="367">
    <wcs:Service>
        <wcs:metadataLink about="http://geoserver.sourceforge.net/html/index.php" xlink:type="simple" metadataType="other"/>
        <wcs:description>This server implements the WCS specification 1.0 and 1.1.1, it's reference implementation of WCS 1.1.1. All layers published by this service are available on WMS also.
     </wcs:description>
        <wcs:name>WCS</wcs:name>
        <wcs:label>Web Coverage Service</wcs:label>
        <wcs:keywords>
            <wcs:keyword>WCS</wcs:keyword>
            <wcs:keyword>WMS</wcs:keyword>
            <wcs:keyword>GEOSERVER</wcs:keyword>
        </wcs:keywords>
        <wcs:responsibleParty>
           ...
        </wcs:responsibleParty>
        <wcs:fees>NONE</wcs:fees>
        <wcs:accessConstraints>NONE</wcs:accessConstraints>
    </wcs:Service>
    <wcs:Capability>
        <wcs:Request>
            <wcs:GetCapabilities>
               ...
            </wcs:GetCapabilities>
            <wcs:DescribeCoverage>
                ...
            </wcs:DescribeCoverage>
            <wcs:GetCoverage>
                ...
            </wcs:GetCoverage>
        </wcs:Request>
        <wcs:Exception>
            <wcs:Format>application/vnd.ogc.se_xml</wcs:Format>
        </wcs:Exception>
    </wcs:Capability>
    <wcs:ContentMetadata>
        <wcs:CoverageOfferingBrief>
            <wcs:description>Generated from arcGridSample</wcs:description>
            <wcs:name>nurc:Arc_Sample</wcs:name>
            <wcs:label>A sample ArcGrid file</wcs:label>
            <wcs:lonLatEnvelope srsName="urn:ogc:def:crs:OGC:1.3:CRS84">
                <gml:pos>-180.0 -90.0</gml:pos>
                <gml:pos>180.0 90.0</gml:pos>
            </wcs:lonLatEnvelope>
            <wcs:keywords>
                <wcs:keyword>WCS</wcs:keyword>
                <wcs:keyword>arcGridSample</wcs:keyword>
                <wcs:keyword>arcGridSample_Coverage</wcs:keyword>
            </wcs:keywords>
        </wcs:CoverageOfferingBrief>
        ...
    </wcs:ContentMetadata>
</wcs:WCS_Capabilities>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

# 3.2 DescribeCoverage

获取地图服务器中某个coverage描述。

参数列表:

name description data type m/o
service 服务类型 String,固定为"WCS" m
version 版本 String m
extension 辅助信息 Extension o
coverageId coverage的标识 NCName,(工作空间+图层名) m
request 操作类型 String,固定为DescribeCoverage m

服务类型要大写"WCS"

KVP形式:

http://localhost:8080/geoserver/ows?service=WCS&request=describecoverage&coverageid=Pk50095&version=1.0.0

http://localhost:8080/geoserver/ows?service=WCS&request=describecoverage&identifiers=Pk50095&version=1.1.0

XML形式:

http://localhost:8080/geoserver/wcs

<DescribeCoverage
  version="1.0.0"
  service="WCS"
  xmlns="http://www.opengis.net/wcs"
  xmlns:nurc="http://www.nurc.nato.int"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wcs http://schemas.opengis.net/wcs/1.0.0/describeCoverage.xsd">
    <Coverage>nurc:Pk50095</Coverage>
</DescribeCoverage>
1
2
3
4
5
6
7
8
9

响应结果示例:

<?xml version="1.0" encoding="UTF-8"?>
<wcs:CoverageDescription xmlns:wcs="http://www.opengis.net/wcs" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ogc="http://www.opengis.net/ogc" xmlns:ows="http://www.opengis.net/ows/1.1" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wcs http://localhost:8080/geoserver/schemas/wcs/1.0.0/describeCoverage.xsd" version="1.0.0">
    <wcs:CoverageOffering>
        <wcs:description>Generated from img_sample2</wcs:description>
        <wcs:name>nurc:Pk50095</wcs:name>
        <wcs:label>Pk50095</wcs:label>
        <wcs:lonLatEnvelope srsName="urn:ogc:def:crs:OGC:1.3:CRS84">
            <gml:pos>12.999446822650462 46.722110379286</gml:pos>
            <gml:pos>13.308182612644663 46.91359611878293</gml:pos>
        </wcs:lonLatEnvelope>
        <wcs:keywords>
            <wcs:keyword>WCS</wcs:keyword>
            <wcs:keyword>img_sample2</wcs:keyword>
            <wcs:keyword>Pk50095</wcs:keyword>
        </wcs:keywords>
        <wcs:domainSet>
            <wcs:spatialDomain>
                <gml:Envelope srsName="EPSG:32633">
                    <gml:pos>347649.93086859107 5176214.082539256</gml:pos>
                    <gml:pos>370725.976428591 5196961.352859256</gml:pos>
                </gml:Envelope>
                <gml:RectifiedGrid dimension="2" srsName="EPSG:32633">
                    <gml:limits>
                        <gml:GridEnvelope>
                            <gml:low>0 0</gml:low>
                            <gml:high>544 489</gml:high>
                        </gml:GridEnvelope>
                    </gml:limits>
                    <gml:axisName>E</gml:axisName>
                    <gml:axisName>N</gml:axisName>
                    <gml:origin>
                        <gml:pos>347671.1015525911 5196940.182175256</gml:pos>
                    </gml:origin>
                    <gml:offsetVector>42.34136799999989 0.0</gml:offsetVector>
                    <gml:offsetVector>0.0 -42.34136800000026</gml:offsetVector>
                </gml:RectifiedGrid>
            </wcs:spatialDomain>
        </wcs:domainSet>
        <wcs:rangeSet>
            <wcs:RangeSet>
                <wcs:name>Pk50095</wcs:name>
                <wcs:label>Pk50095</wcs:label>
                <wcs:axisDescription>
                    <wcs:AxisDescription>
                        <wcs:name>Band</wcs:name>
                        <wcs:label>Band</wcs:label>
                        <wcs:values>
                            <wcs:interval>
                                <wcs:min>1</wcs:min>
                                <wcs:max>3</wcs:max>
                            </wcs:interval>
                        </wcs:values>
                    </wcs:AxisDescription>
                </wcs:axisDescription>
            </wcs:RangeSet>
        </wcs:rangeSet>
        <wcs:supportedCRSs>
            <wcs:requestResponseCRSs>EPSG:32633</wcs:requestResponseCRSs>
        </wcs:supportedCRSs>
        <wcs:supportedFormats nativeFormat="WorldImage">
            <wcs:formats>ARCGRID</wcs:formats>
            <wcs:formats>GeoTIFF</wcs:formats>
            <wcs:formats>GIF</wcs:formats>
            <wcs:formats>IMAGEMOSAIC</wcs:formats>
            <wcs:formats>JPEG</wcs:formats>
            <wcs:formats>PNG</wcs:formats>
            <wcs:formats>TIFF</wcs:formats>
        </wcs:supportedFormats>
        <wcs:supportedInterpolations default="nearest neighbor">
            <wcs:interpolationMethod>nearest neighbor</wcs:interpolationMethod>
            <wcs:interpolationMethod>bilinear</wcs:interpolationMethod>
            <wcs:interpolationMethod>bicubic</wcs:interpolationMethod>
            <wcs:interpolationMethod>bicubic_2</wcs:interpolationMethod>
        </wcs:supportedInterpolations>
    </wcs:CoverageOffering>
</wcs:CoverageDescription>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76

这里的<gml:axisName>标签为下面getCoverage请求中维度dimension参数的可选值。

# 3.3 GetCoverage

GetCoverage请求WCS服务处理特定coverage,并返回空间数据。它可以检索覆盖率的子集,结果可以是覆盖率本身或对它的引用。

GetCoverage请求最强大的功能是它子集域(高度和时间)和范围的能力。它还可以进行重采样,以不同的数据格式编码,并以不同的方式返回结果文件。

image-20210702165344490

请求参数列表:

name description data type m/o
service 服务类型 String,固定为"WCS" m
version String m
extension Any o
coverageId coverage标识 NCName m
format 返回格式 anyURI o
mediaType 如果存在,强制多部分编码 anyURI,固定为“multipart/related” o
dimensionSubset DimensionSubset o

dimensionSubset:从服务器获取数据时修剪或切片维度

format参数应该是describecoverage操作返回结果中<wcs:supportedFormats>标签下的类型,默认是coverage原来的格式;

dimensionSubset由一组coverage的dimension设置的子集规则(subseting specifications)组成。

DimensionSubset structure
name definition data type Multiplicity
dimension Name of dimension along which to subset NCName one(mandatory)

一个GetCoverage请求中最多包含一个subsetibt操作,且每个dimension维度最多包含一个针对coverage的的subsetting操作。常见的dimension有:

  • 地理坐标的经纬度(dimension=Long,dimension=Lat)
  • 投影坐标的XY轴(dimension=E,dimension=N)

根据dimensionSubset是裁剪还是分割操作,其对应了两个子类:

  • DimensionTrim
  • DimensionSlice

# 3.3.1 DimensionTrim

DimensionTrim有trimLow和trimHigh两个属性,用来指定某个维度dimension下的裁剪区间,但不能超过coverage原始数据的gml:Envelope范围。比如coverage在x轴下的最大值为H,最小值为L,则有L<=trimLow<=trimHigh<=H。

示例:

<?xml version="1.0" encoding="UTF-8"?>
<wcs:GetCoverage service="WCS" version="2.0.1"
  xmlns:wcs="http://www.opengis.net/wcs/2.0"
  xmlns:crs="http://www.opengis.net/spec/WCS_service-extension_crs/1.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.opengis.net/wcs/2.0 http://schemas.opengis.net/wcs/2.0/wcsAll.xsd">
  <wcs:CoverageId>nurc__mosaic</wcs:CoverageId>
  <wcs:DimensionTrim>
    <wcs:Dimension>Long</wcs:Dimension>
    <wcs:TrimLow>8</wcs:TrimLow>
    <wcs:TrimHigh>10</wcs:TrimHigh>
  </wcs:DimensionTrim>
  <wcs:DimensionTrim>
    <wcs:Dimension>Lat</wcs:Dimension>
    <wcs:TrimLow>38.5</wcs:TrimLow>
    <wcs:TrimHigh>43.5</wcs:TrimHigh>
  </wcs:DimensionTrim>
  <wcs:Extension>
    <crs:subsettingCrs>
      http://www.opengis.net/def/crs/EPSG/0/4326
    </crs:subsettingCrs>
  </wcs:Extension>
</wcs:GetCoverage>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
image-20210705110546049

# 3.3.2 DimensionSlice

Dimension有一个slicePoint属性,用来指定某个dimension维度分割的位置点,但不能超过coverage中gml:Envelope的范围。

这里没有找到相关操作示例。

# 3.3.3 服务扩展

Range Subsetting Extension

该扩展定义了从WCS服务器提供的coverage中检索选定的range组件.

选择是基于coverage中定义的range type,其中由可识别的组件(<swe:DataRecord>)给出。在某些域中,这些range组件定义的range type称为“通道”、“波段”或“变量”。

image-20210706110821141

RangeSubset: Used to select a subset of coverage fields to the dataset.

Subset: Trim or slice a dimension when fetching data from the server

示例:

以GeoServer自带的nurc:mosaic图层为示例数据,我们可以在编辑图层中看到Coverage波段详情:

image-20210706134553852

  1. 选择RED_BAND波段的子集,即导出的coverage为RED_BAND单一波段的tiff文件

    http://localhost:8080/geoserver/wcs?SERVICE=WCS&REQUEST=GetCoverage&VERSION=2.0.1&CoverageId=nurc__mosaic&RANGESUBSET=RED_BAND

    image-20210705110546049

# 参考文章

[1] OGC Coverage Implementation Schema http://docs.opengeospatial.org/is/09-146r8/09-146r8.html

[2] Web Coverage Service https://www.ogc.org/standards/wcs

[3] WCS reference https://docs.geoserver.org/latest/en/user/services/wcs/reference.html

[4] OGC® Web Coverage Service Interface Standard -Range Subsetting Extension https://portal.ogc.org/files/12-040