Skip to content
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
Binary file added workshop/content/docs/assets/images/map_3395.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workshop/content/docs/assets/images/map_3857.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workshop/content/docs/assets/images/map_4326.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workshop/content/docs/assets/images/oam1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added workshop/content/docs/assets/images/oam2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 60 additions & 6 deletions workshop/content/docs/publishing/ogcapi-maps.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,17 @@ title: Exercise 4 - Maps of geospatial data via OGC API - Maps
[OGC API - Maps](https://ogcapi.ogc.org/maps) provides a Web API to access
any geospatial data as a georeferenced map image.

* [OGC API - Maps](https://docs.ogc.org/DRAFTS/20-058.html)
* [OGC API - Maps](https://docs.ogc.org/is/20-058/20-058.html)

Here are a few things that a client can request from a OGC API - Maps server:

* Request a visual representation of one or more geospatial data layers in different styles;
* Select by area, time and resolution of interest;
* Change parameters such as the width, height and coordinate reference systems.

!!! note

While OGC API - Maps is great for providing dynamic maps on the Web, if your data has can be based on a set tiling scheme, and the resulting maps do not need to be dynamically generated, [OGC API - Tiles](./ogcapi-tiles.md) provides a suitable approach to serve efficiently using less server resources.

## pygeoapi support

Expand All @@ -17,7 +27,7 @@ pygeoapi supports the OGC API - Maps specification, using [MapServer MapScript](

See [the official documentation](https://docs.pygeoapi.io/en/latest/publishing/ogcapi-maps.html) for more information on supported map backends

## Publish a raster dataset
## Publish a vector dataset

In this section we'll be exposing a Geopackage file available at `workshop/exercises/data/airport.gpkg` location using [MapServer MapScript](https://www.mapserver.org/mapscript). This data can be consumed with various clients which are compliant with OGC APIs - Maps. List of few such clients can be found [here](https://github.com/opengeospatial/ogcapi-maps/blob/master/implementations.adoc#clients). Here we can also pass style in *.sld* format. Which can be generated on [Geoserver](https://docs.geoserver.org/stable/en/user/styling/index.html), [QGIS](https://www.qgistutorials.com/en/docs/3/basic_vector_styling.html), etc.

Expand Down Expand Up @@ -66,15 +76,54 @@ In this section we'll be exposing a Geopackage file available at `workshop/exerc
table: airport
```

!!! note
After the server has started you can access the collection page here:

See [the official documentation](https://docs.pygeoapi.io/en/latest/publishing/ogcapi-maps.html) for more information on supported map backends
http://localhost:5000/collections/airports

And the map here:

http://localhost:5000/collections/airports/map?f=png

![](../assets/images/map_4326.png){ width=50% }

!!! note

The airport data is published as **both** a map and a feature collection through a single endpoint (`/collections/airports`). How is this made possible in the above configuration?

## pygeoapi as a WMS proxy
The map comes with the default CRS84 CRS, but you can easily change it with the `crs` parameter:

http://localhost:5000/collections/airports/map?f=png&crs=EPSG:3857

You can also adjust other parameters (such as bounding box (`bbox`), bounding box CRS (`bbox-crs`), as well as `width` and `height` to create custom maps:

http://localhost:5000/collections/airports/map?f=png&bbox-crs=OGC:CRS84&bbox=-142,42,-52,84

![](../assets/images/map_bbox.png){ width=50% }

http://localhost:5000/collections/airports/map?f=png&width=400&height=400

![](../assets/images/map_square.png){ width=50% }


!!! note

See the [OGC API - Maps Standard](https://docs.ogc.org/is/20-058/20-058.html) for more details about the map parameters.

!!! note

OGC API - Maps supports CRS from Compact URIs (CURIEs, i.e. `EPSG:4326`, `CRS84`), safe CURIEs (e.g.: `[EPSG:4326]`, `[CRS84]`) and URIs:

<http://localhost:5000/collections/airports/map?f=png&crs=https://www.opengis.net/def/crs/EPSG/0/3857>

<http://localhost:5000/collections/airports/map?f=png&crs=https://www.opengis.net/def/crs/EPSG/0/3395>

| ![map](../assets/images/map_4326.png) | ![map](../assets/images/map_3857.png) | ![map](../assets/images/map_3395.png) |
|:---:|:---:|:---:|
| EPSG:4326 | EPSG:3857 | EPSG:3395 |

You can read more about the different ways of expressing CRSs on the maps section of the [pygeoapi documentation](https://docs.pygeoapi.io/en/latest/publishing/ogcapi-maps.html).

## OPTIONAL: pygeoapi as a WMS proxy

You can check the "pygeoapi as a Bridge to Other Services" section to learn how to [publish WMS as OGC API - Maps](../advanced/bridges.md#publishing-wms-as-ogc-api-maps).

Expand All @@ -90,9 +139,14 @@ QGIS added support for API's providing rendered image layers via its raster supp
- Open the `Add raster layer panel`.
- Select `OGCAPI` for Source type.
- Add the local endpoint as source `http://localhost:5000/collections/airports`.
- Select `PNG` as image format.
- Select `MAP` as API.
- Finally add the layer to the map.


![](../assets/images/oam1.png){ width=50% }

![](../assets/images/oam2.png){ width=50% }

### OWSLib

[OWSLib](https://owslib.readthedocs.io) is a Python library to interact with OGC Web Services and supports a number of OGC APIs including OGC API - Maps.
Expand Down
8 changes: 6 additions & 2 deletions workshop/content/docs/publishing/ogcapi-tiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pygeoapi supports the core OGC API - Tiles specification, and is able to adverti

!!! note

pygeoapi currently supports two well known Tile Matrix Sets: `WorldCRS84Quad` and `WebMercatorQuad`. Their definition is published on the [/TileMatrixSets](https://demo.pygeoapi.io/master/TileMatrixSets) end point.
By default, pygeoapi supports two well known Tile Matrix Sets: `WorldCRS84Quad` and `WebMercatorQuad`. Their definition is published on the [/TileMatrixSets](https://demo.pygeoapi.io/master/TileMatrixSets) end point. For additional TMS support, please check the [pygeoapi documentation](https://docs.pygeoapi.io/en/latest/publishing/ogcapi-tiles.html#providing-custom-tile-matrix-set-definitions).

## Publish pre-rendered vector tiles

Expand Down Expand Up @@ -60,7 +60,7 @@ Let's generate the tiles as the first step using tippecanoe:
```

!!! note
Please note that the tippecanoe tool requires the input file to be in WGS84, and it always outputs tiles in WebMercator.
Please note that the tippecanoe tool requires the input file to be in `WGS84`, and **always** outputs tiles in `WebMercator`.

!!! question "Update the pygeoapi configuration"

Expand Down Expand Up @@ -268,6 +268,10 @@ QGIS supports OGC API Vector Tiles via the [Vector Tiles Layer](https://docs.qgi

![](../assets/images/qgis-vtiles-hyderabad3.png){ width=100% }

Note that with vector tiles, you can render styles according to attributes. To try it, load the styles file on `exercises/data/hyderabad/style-vector.qml`.

![](../assets/images/vector-tiles-styles.png){ width=100% }

### LeafletJS

[LeafletJS](https://leafletjs.com) is a popular JavaScript library to add interactive maps to websites. LeafletJS does not support OGC API's explicitly, however can interact with OGC API by using the results of the API directly.
Expand Down
10 changes: 7 additions & 3 deletions workshop/content/docs/standards.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,18 @@ functionality to users, as well as software implementation.

pygeoapi implements numerous OGC API standards and draft standards. In addition, it is compliance certified and even a Reference Implementation (RI) for some of them. Compliance certification is important to remove interoperability risks. RI are always compliance certified. From OGC [Compliance Testing Program Policies & Procedures 08-134r11](https://docs.ogc.org/pol/08-134r11.html#toc26):

!!! [Citation](https://docs.ogc.org/pol/08-134r11.html#toc17)
!!! Citation

Candidate Products that pass all the tests in a Compliance Test Package, and that OGC has reviewed and certified as having passed those tests, are considered compliant with that Implementation Standard version.

Candidate Products that pass all the tests in a Compliance Test Package, and that OGC has reviewed and certified as having passed those tests, are considered compliant with that Implementation Standard version.
Source: <https://docs.ogc.org/pol/08-134r11.html#toc17>

!!! [Citation](https://docs.ogc.org/pol/08-134r11.html#term-reference-implementation-_ri_)
!!! Citation

A Reference Implementation is a fully functional, licensed copy of a tested, branded software that has passes the test for an associated conformance class in a version of an Implementation Standard and that is free and publicly available for testing via a web service or download.

Source: <https://docs.ogc.org/pol/08-134r11.html#term-reference-implementation-_ri_>


| Standard | pygeoapi status | Included in this workshop |
|----------------------------------------|--------------------------|---------------------------|
Expand Down
Loading
Loading