Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds WMS layer support #9

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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",
Expand Down
13 changes: 13 additions & 0 deletions datapackage.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "./schemas/snapshot.json",
"name": "gemeindescan-snapshot-sample",
"title": "Gemeindescan Snapshot Sample",
"keywords": ["europe", "switzerland", "gemeindescan", "geodata"],
Expand Down Expand Up @@ -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",
Expand Down
35 changes: 35 additions & 0 deletions schemas/snapshot.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down