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

Added Basic WMS #14

Merged
merged 3 commits into from
Jun 22, 2023
Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- OGC WMS (Basic WMS only)
- 3D Tiles

### Changed
Expand Down
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ It allows to provide links to web map services for visualization purposes.

The following services are supported:
- [3D Tiles](#3d-tiles)
- [OGC WMS](#ogc-wms)
- [OGC WMTS](#ogc-wmts)
- [TileJSON](#tilejson)
- [XYZ](#xyz)
Expand Down Expand Up @@ -44,6 +45,20 @@ Links to a [3D Tiles](https://docs.ogc.org/cs/18-053r2/18-053r2.html) implementa
| href | string | **REQUIRED**. Link to a tileset. |
| type | string | Recommended to be set to `application/json`. |

### OGC WMS

Links to a [OGC Web Map Service](https://www.ogc.org/standards/wms) (WMS) implementation (versions 1.x).
Only (tiled) "Basic WMS" is supported at this time.

| Field Name | Type | Description |
| --------------- | -------------------- | ----------- |
| rel | string | **REQUIRED**. Must be set to `wms`. |
| href | string | **REQUIRED**. Link to the WMS, without any WMS specific query parameters. |
| type | string | Recommended to be set to the media type the Capabilities document, usually `text/xml`. |
| wms:layers | \[string] | **REQUIRED**. The layers to show on the map by default. Can't be empty. |
| wms:styles | \[string] | The styles to show on the map by default. If not provided or empty, an empty string will be used for the query parameter. |
| wms:dimensions | Map\<string, string> | Any additional dimension parameters to add to the request as query parameters (e.g. the dimensions `TIME` or `ELEVATION`). |

### OGC WMTS

Links to a [OGC Web Map Tile Service](https://www.ogc.org/standards/wmts) (WMTS) implementation (versions 1.x).
Expand Down
18 changes: 17 additions & 1 deletion examples/collection.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,22 @@
"time": "2022-01-01"
}
},
{
"href": "https://maps.example.com/wms",
"rel": "wms",
"type": "text/xml",
"title": "RGB composite visualized through a WMS",
"wms:layers": [
"rgb"
],
"wms:styles": [
"default"
],
"wms:dimensions": {
"ELEVATION": "0",
"TIME": "2022-01-01"
}
},
{
"href": "https://{s}.maps.example.com/xyz/{z}/{x}/{y}.png",
"rel": "xyz",
Expand All @@ -72,4 +88,4 @@
"type": "application/json"
}
]
}
}
9 changes: 9 additions & 0 deletions examples/item.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@
"satellite"
]
},
{
"href": "https://maps.example.com/wms",
"rel": "wms",
"type": "text/xml",
"title": "RGB composite visualized through a WMS",
"wms:layers": [
"rgb"
]
},
{
"href": "https://maps.example.com/xyz/{z}/{x}/{y}.jpg",
"rel": "xyz",
Expand Down
60 changes: 52 additions & 8 deletions json-schema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,20 @@
],
"properties": {
"wmts:layer": {
"type": [
"string",
"array"
],
"minItems": 1,
"items": {
"type": "string"
}
"oneOf": [
{
"type": "string",
"minLength": 1
},
{
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
}
]
},
"wmts:dimensions": {
"type": "object",
Expand All @@ -95,6 +101,44 @@
}
]
}
},
{
"$comment": "Defines WMS links",
"if": {
"properties": {
"rel": {
"const": "wms"
}
}
},
"then": {
"required": [
"wms:layers"
],
"properties": {
"wms:layers": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"minLength": 1
}
},
"wms:styles": {
"type": "array",
"items": {
"type": "string",
"minLength": 1

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In WMS, styles can be left empty, to use the default style for each layer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thus you can provide an empty array.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought minLength means that at least one element has to be provided.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's the min length of the string.

}
},
"wms:dimensions": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
}
}
}
]
}
Expand Down