将地图发布到OGC API-地图

OGC API - Maps 以Web地图的形式提供地理空间数据。

要将数据添加到pygeapi,可以使用中的数据集示例 配置 作为基线,并进行相应的修改。

提供者

下面列出了pygeoapi核心特性提供程序,以及支持的查询参数列表。

供应商

口技

宽度/高度

MapScript

WMSFacade

下面是基于支持的提供程序的特定连接示例。

连接示例

MapScript

MapScript 是MapServer用于地图渲染的脚本接口。

要通过MapScript发布地图,需要数据路径和图层类型 (options.type )。要设置数据样式,请设置 options.style 。如果未指定样式,则将使用默认设置呈现该层。

地图服务器图层类型 (options.type ):

  • MS_LAYER_POINT

  • MS_LAYER_LINE

  • MS_LAYER_POLYGON

  • MS_LAYER_RASTER

当前支持的样式文件 (options.style ):

  • OGC样式的层描述符(SLD)

  • MapServer类包括(即带有类定义的文件片段)

providers:
    - type: map
      name: MapScript
      data: /path/to/data.shp
      options:
          type: MS_LAYER_POINT
          layer: foo_name
          style: ./foo.sld
      format:
         name: png
         mimetype: image/png

WMSFacade

要通过PYGEOAPI(WMS基本URL)发布WMS (data )和层名称 (options.layer )是必需的。可选的样式名称可通过 options.style

providers:
    - type: map
      name: WMSFacade
      data: https://demo.mapserver.org/cgi-bin/msautotest
      options:
          layer: world_latlong
          style: default
      format:
            name: png
            mimetype: image/png

数据可视化示例

  • 列出所有集合*http://localhost:5000/collections

  • DataSet*http://localhost:5000/collections/foo概述

  • 地图(默认格式)*http://localhost:5000/collections/foo/map

  • 使用BBox子集映射*http://localhost:5000/collections/foo/map?bbox=-142,42,-52,84

  • 使用BBox和时态子集映射*http://localhost:5000/collections/foo/map?bbox=-142,42,-52,84&DateTime=2020-04-10T14:11:00Z

  • 使用bbox和bbox映射-crs*http://localhost:5000/collections/foo/map?bbox-crs=http%3A%2F%2Fwww.opengis.net%2Fdef%2Fcrs%2FEPSG%2F0%2F3857&bbox=4.022369384765626%2C50.690447870569436%2C4.681549072265626%2C51.00260125274477&width=800&height=600&transparent