From 0f86491784eca133958adc9bf767524b64c010b4 Mon Sep 17 00:00:00 2001 From: Thorben Westerhuys Date: Fri, 26 Feb 2021 16:43:27 +0100 Subject: [PATCH] Adds WMS layer support --- README.md | 18 ++++++++++++++++-- datapackage.json | 13 +++++++++++++ schemas/snapshot.json | 35 +++++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a77b784..e540acc 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,10 @@ a Snapshots (Spatial Data Package) also require (technical details see below) 1. a `view` – Defining how the map can be rendered 1. a `source` – Listing data sources 1. `resource`s added to a `view` to be either - - a simple-style GeoJSON – for Lines, Polygons, Markers - - a simple-style-extended GeoJSON – for Circles + - a simple-style GeoJSON – supporting Lines, Polygons, Markers + - a simple-style-extended GeoJSON – supporting Circles - a mapbox style URL – for a background map + - a [WMS](https://www.ogc.org/standards/wms) layer ### Examples @@ -56,6 +57,7 @@ Possible Mediatypes - `application/geo+json`: GeoJSON with [Mapbox Simple Styles](https://github.com/mapbox/simplestyle-spec) - `application/vnd.simplestyle-extended`: GeoJSON with [Extended Simple Styles](https://github.com/cividi/simplestyle-extended-spec) - `application/vnd.mapbox-vector-tile`: Mapbox URI for styled vector tiles +- `application/vnd.wms`: WMS URI and parameters (see example below) ### Views @@ -123,6 +125,18 @@ For a map view compatible with the [Gemeindescan-Project](https://bitbucket.org/ }] } }, + { + "name": "wms-bauzonen", + "title": "Geo Admin: Bauzonen Schweiz (harmonisiert)", + "mediatype": "application/vnd.wms", + "path": "https://wms.geo.admin.ch", + "parameters": { + "format": "image/png", + "transparent": true, + "layers": "ch.are.bauzonen", + "opacity": 0.5 + } + }, { "path": "mapbox://styles/gemeindescan/ckc4sha4310d21iszp8ri17u2", "mediatype": "application/vnd.mapbox-vector-tile", diff --git a/datapackage.json b/datapackage.json index f4b37b5..5052abb 100644 --- a/datapackage.json +++ b/datapackage.json @@ -1,4 +1,5 @@ { + "$schema": "./schemas/snapshot.json", "name": "gemeindescan-snapshot-sample", "title": "Gemeindescan Snapshot Sample", "keywords": ["europe", "switzerland", "gemeindescan", "geodata"], @@ -8871,6 +8872,18 @@ }] } }, + { + "name": "wms-bauzonen", + "title": "Geo Admin: Bauzonen Schweiz (harmonisiert)", + "mediatype": "application/vnd.wms", + "path": "https://wms.geo.admin.ch", + "parameters": { + "format": "image/png", + "transparent": true, + "layers": "ch.are.bauzonen", + "opacity": 0.5 + } + }, { "path": "mapbox://styles/gemeindescan/ckc4sha4310d21iszp8ri17u2", "mediatype": "application/vnd.mapbox-vector-tile", diff --git a/schemas/snapshot.json b/schemas/snapshot.json index e503051..fd0e8d5 100644 --- a/schemas/snapshot.json +++ b/schemas/snapshot.json @@ -261,6 +261,41 @@ } } }, + { + "required": ["name", "path", "mediatype","parameters"], + "description": "A WMS data resource.", + "properties": { + "mediatype": { + "pattern": "^application\/vnd\\.wms$" + }, + "parameters": { + "type": "object", + "required": ["format","transparent","layers","opacity"], + "description": "Parameters how to request the WMS layer via Leaflet.", + "properties": { + "format": { + "type": "string", + "pattern": "image\/png", + "description": "The WMS tile type." + }, + "transparent": { + "type": "boolean", + "description": "If the PNG tiles should support transparency." + }, + "layers": { + "type": "string", + "description": "The WMS layer name." + }, + "opacity": { + "description": "Opacity of the layer.", + "type": "number", + "minimum": 0, + "maximum": 1 + } + } + } + } + }, { "required": ["name", "path", "mediatype"], "properties": {