geopython / pygeoapi

pygeoapi is a Python server implementation of the OGC API suite of standards. The project emerged as part of the next generation OGC API efforts in 2018 and provides the capability for organizations to deploy a RESTful OGC API endpoint using OpenAPI, GeoJSON, and HTML. pygeoapi is open source and released under an MIT license.
https://pygeoapi.io
MIT License
461 stars 251 forks source link

Issue serving the same collection using both, a vector tile and a raster tile providers #1583

Closed doublebyte1 closed 4 weeks ago

doublebyte1 commented 4 months ago

Description If a collection is published using a vector and a raster tile providers, only one of them will be used (the first one).

Steps to Reproduce Publish some collection using a vector tile and a raster tile providers, like in this code snippet:

            - type: tile
              name: MVT-tippecanoe
              data: tests/data/tiles/ne_110m_lakes
              options:
                bounds: [[-124.953634,-16.536406],[109.929807,66.969298]]
                zoom:
                    min: 0
                    max: 5
              format:
                    name: pbf
                    mimetype: application/vnd.mapbox-vector-tile
            - type: tile
              name: WMTSFacade
              data: https://emotional.byteroad.net/geoserver/gwc/service/wmts
              format:
                  name: png  # png or jpeg
                  mimetype: image/png
              options:
                  wmts_layer: camb:hex350_grid_mental_1920 # the layer name of the wmts
                  wmts_tile_matrix_set: WebMercatorQuad  # the name of the tile matrix set of the wmts.
                  scheme: WebMercatorQuad  # the aligning scheme in pygeoapi.
                  zoom:
                      min: 0
                      max: 20

The collection page only shows links with rel":"http://www.opengis.net/def/rel/ogc/1.0/tilesets-vector". If you invert the order of the providers in the configuration file, it will show links with rel: "rel":"http://www.opengis.net/def/rel/ogc/1.0/tilesets-raster", instead.

{
    "id":"dataset-umbrella",
    "title":"Dataset Umbrella",
    "description":"Experiment a collection with multiple providers",
    "keywords":[
        "wmts"
    ],
    "links":[
        {
            "type":"text/html",
            "rel":"canonical",
            "title":"information",
            "href":"http://www.naturalearthdata.com/downloads/110m-cultural-vectors/110m-populated-places/",
            "hreflang":"en-US"
        },
        {
            "type":"application/gzip",
            "rel":"canonical",
            "title":"download",
            "href":"http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/110m/cultural/ne_110m_populated_places_simple.zip",
            "hreflang":"en-US"
        },
        {
            "type":"application/json",
            "rel":"root",
            "title":"The landing page of this server as JSON",
            "href":"http://localhost:5000?f=json"
        },
        {
            "type":"text/html",
            "rel":"root",
            "title":"The landing page of this server as HTML",
            "href":"http://localhost:5000?f=html"
        },
        {
            "type":"application/json",
            "rel":"self",
            "title":"This document as JSON",
            "href":"http://localhost:5000/collections/dataset-umbrella?f=json"
        },
        {
            "type":"application/ld+json",
            "rel":"alternate",
            "title":"This document as RDF (JSON-LD)",
            "href":"http://localhost:5000/collections/dataset-umbrella?f=jsonld"
        },
        {
            "type":"text/html",
            "rel":"alternate",
            "title":"This document as HTML",
            "href":"http://localhost:5000/collections/dataset-umbrella?f=html"
        },
        {
            "type":"application/schema+json",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/queryables",
            "title":"Queryables for this collection as JSON",
            "href":"http://localhost:5000/collections/dataset-umbrella/queryables?f=json"
        },
        {
            "type":"text/html",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/queryables",
            "title":"Queryables for this collection as HTML",
            "href":"http://localhost:5000/collections/dataset-umbrella/queryables?f=html"
        },
        {
            "type":"application/geo+json",
            "rel":"items",
            "title":"items as GeoJSON",
            "href":"http://localhost:5000/collections/dataset-umbrella/items?f=json"
        },
        {
            "type":"application/ld+json",
            "rel":"items",
            "title":"items as RDF (GeoJSON-LD)",
            "href":"http://localhost:5000/collections/dataset-umbrella/items?f=jsonld"
        },
        {
            "type":"text/html",
            "rel":"items",
            "title":"Items as HTML",
            "href":"http://localhost:5000/collections/dataset-umbrella/items?f=html"
        },
        {
            "type":"application/json",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/tilesets-vector",
            "title":"Tiles as JSON",
            "href":"http://localhost:5000/collections/dataset-umbrella/tiles?f=json"
        },
        {
            "type":"text/html",
            "rel":"http://www.opengis.net/def/rel/ogc/1.0/tilesets-vector",
            "title":"Tiles as HTML",
            "href":"http://localhost:5000/collections/dataset-umbrella/tiles?f=html"
        }
    ],
    "extent":{
        "spatial":{
            "bbox":[
                [
                    -0.260765354541958,
                    51.409628133733456,
                    0.126720196946648,
                    51.58003067802845
                ]
            ],
            "crs":"http://www.opengis.net/def/crs/OGC/1.3/CRS84"
        }
    },
    "itemType":"tile"
}

Expected behavior pygeoapi should create links for retrieving the collection as vector and raster tiles.

Screenshots/Tracebacks

Screenshot from 2024-03-07 18-54-32

Additional context Related to the discussion on this PR: https://github.com/geopython/pygeoapi/pull/1575

doublebyte1 commented 4 months ago

I think the issue may be here:

https://github.com/geopython/pygeoapi/blame/1e424174f5c5d73391abad4e46ca378d544d489d/pygeoapi/api.py#L1246-L1248

It will only read one tile provider. One possible approach could be to create a vector-tile and raster-tile providers.

github-actions[bot] commented 1 month ago

This Issue has been inactive for 90 days. As per RFC4, in order to manage maintenance burden, it will be automatically closed in 7 days.

github-actions[bot] commented 4 weeks ago

As per RFC4, this Issue has been closed due to there being no activity for more than 90 days.