geopython / pycsw

pycsw is an OGC CSW server implementation written in Python. pycsw fully implements the OpenGIS Catalogue Service Implementation Specification [Catalogue Service for the Web]. Initial development started in 2010 (more formally announced in 2011). The project is certified OGC Compliant, and is an OGC Reference Implementation. pycsw allows for the publishing and discovery of geospatial metadata via numerous APIs (CSW 2/CSW 3, OpenSearch, OAI-PMH, SRU). Existing repositories of geospatial metadata can also be exposed, providing a standards-based metadata and catalogue component of spatial data infrastructures. pycsw is Open Source, released under an MIT license, and runs on all major platforms (Windows, Linux, Mac OS X). Please read the docs at https://pycsw.org/docs for more information.
https://pycsw.org
MIT License
207 stars 155 forks source link

how to transform a WMS/WFS iso19139 transferoption to record.geojson? #814

Open pvgenuchten opened 1 year ago

pvgenuchten commented 1 year ago

Description

Following the discussion at https://github.com/opengeospatial/ogcapi-records/issues/95, to capture enough detail on a association in record.geojson so a client is able to bind to the service advertised, we need some mapping from for example the iso19139 transfer-options model to a template+variables structure as suggested in record.geojson.

iso

<gmd:MD_DigitalTransferOptions>
          <gmd:onLine>
            <gmd:CI_OnlineResource>
              <gmd:linkage>
                <gmd:URL>https://service.pdok.nl/hwh/wsdiensteninspire/wms/v1_0?service=wms&amp;request=getcapabilities</gmd:URL>
              </gmd:linkage>
              <gmd:protocol>
                <gmx:Anchor xlink:href="http://www.opengis.net/def/serviceType/ogc/wms">OGC:WMS</gmx:Anchor>
              </gmd:protocol>
              <gmd:name>
                <gco:CharacterString>kabel</gco:CharacterString>
              </gmd:name>
              <gmd:description>
                <gmx:Anchor xlink:href="http://inspire.ec.europa.eu/metadata-codelist/OnLineDescriptionCode/accessPoint">accessPoint</gmx:Anchor>
              </gmd:description>
            </gmd:CI_OnlineResource>
          </gmd:onLine>

record geojson

{
   "rel": "map",
   "type": "image/png",
   "title": "Ozone map",
   "href": "https://geo.woudc.org/ows?service=WMS&version=1.3.0&request=GetMap&crs={crs}&bbox={bbox}&layers=totalozone&width={width}&height={height}&format=image/png",
   "templated": true,
   "variables": {
      "crs": {
         "description": "...",
         "type": "string",
         "enum": [ "EPSG:4326", "EPSG:3857" ]
      },
      "bbox": {
         "description": "...",
         "type": "array",
         "items": {
            "type": "number",
            "format": "double"
         },
         "minItems": 4,
         "maxItems": 4
      },
      "width": {
         "description": "...",
         "type": "number",
         "format": "integer",
         "minimum": 600,
         "maximum": 5000
      },
      "height": {
         "description": "...",
         "type": "number",
         "format": "integer",
         "minimum": 600,
         "maximum": 5000
      }
   }
}

In general clients like qgis/openlayers will know how to interact with a wms, so i'm a bit reluctant to capture the full structure of a wms getmap into the record. A minimal requirement though is to capture the fact that the endpoint is a WMS and the relevant layer(s) at that endpoint. For which the current spec does not provide guidance. what do people think?

tomkralidis commented 3 months ago

Thinking out loud: one approach could be to add the appropriate binding information to the links column in pycsw (which is a JSON) when ingesting an ISO document and then generate accordingly from .../items or .../items/{itemId}. Thoughts?