[MapServer-dev] RFC-140 - MapServer Homepage

Seth G sethg at geographika.co.uk
Wed Jan 22 07:27:01 PST 2025


Thanks Tom - that pygeoapi pull request is good timing!

After reviewing and reading some of the associated documents, I'm planning to update the RFC with the notes below.

pygeoapi has implemented a JSON service for their homepage at [1] (pull request at [2].
This implements the api-catalog, a draft IETF (Internet Engineering Task Force) standard [3]. 
The Link Set format is described at [4]. It is proposed this approach is used to generate JSON for a MapServer "homepage". 
The generated JSON format can be seen at https://demo.pygeoapi.io/api-catalog.json, with an extract below:

{
  "linkset": [
    {
      "anchor": "https://demo.pygeoapi.io/master", 
      "service-desc": [
        {
          "href": "https://demo.pygeoapi.io/master/openapi?f=json", 
          "title": "pygeoapi - latest GitHub 'master' version (JSON)", 
          "type": "application/vnd.oai.openapi+json"
        }
      ], 
      "service-doc": [
        {
          "href": "https://demo.pygeoapi.io/master/openapi?f=html", 
          "title": "pygeoapi - latest GitHub 'master' version (HTML)", 
          "type": "text/html"
        }
      ]
    }, 

The spec allows for an additional "service-meta" property "used to link to additional metadata about the API, 
and is primarily intended for machine consumption." I think this can be used to add any additional properties from Mapfiles
we'd need to generate a MapServer homepage.
"service-doc" isn't mandatory, so WxS service links can ignore this. An example of the proposed JSON and metadata is shown below:

{
  "linkset": [
    {
      "anchor": "https://demo.mapserver.org/", 
      "service-desc": [
        {
          "href": "https://demo.mapserver.org/cgi-bin/msautotest?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities", 
          "title": "World WMS service", 
          "type": "text/xml"
        }
      ], 
      "service-meta": {
         {
           "type": "wms",
           "title": "WMS demo server for MapServer, used in the msautotest suite",
           "keywords": ["layers", "list"],
           "mapfile": "msautotest.map",
         }
      }
    }, 

Seth

[1] https://demo.pygeoapi.io/
[2] https://github.com/geopython/demo.pygeoapi.io/pull/60/files
[3] https://datatracker.ietf.org/doc/draft-ietf-httpapi-api-catalog/08/
[4] https://www.rfc-editor.org/rfc/rfc9264.html


--
web:https://geographika.net & https://mapserverstudio.net
mastodon: @geographika at mastodon.social

On Sun, Jan 19, 2025, at 5:10 PM, Tom Kralidis wrote:
> Seth: thanks for this RFC.  IETF has  api-catalog (draft, [1]) which I think would be a good candidate for this RFC.  This is also an item for review in the OGC API - Records SWG [2].
> 
> Overall it looks pretty close to the RFC proposal.  We can consider using api-catalog as a baseline and we can extend the JSON accordingly as needed for anything specific to our needs.
> 
> Cheers
> 
> ..Tom
> 
> [1] https://datatracker.ietf.org/doc/draft-ietf-httpapi-api-catalog
> [2] https://github.com/opengeospatial/ogcapi-records/issues/355
> 
> 
> 
> 
> On Sat, Jan 18, 2025 at 5:39 PM Seth G via MapServer-dev <mapserver-dev at lists.osgeo.org> wrote:
>> Looking again at the landing page JSON at https://demo.mapserver.org/cgi-bin/mapserv/localdemo/ogcapi?f=json it is in the same format, so as you suggested could simply be expanded with links to WxS services, or even CGI generated responses. This would also more easily allow template reuse. 
>> 
>> Seth
>> 
>> --
>> web:https://geographika.net & https://mapserverstudio.net
>> mastodon: @geographika at mastodon.social
>> 
>> On Sat, Jan 18, 2025, at 11:33 PM, Seth G via MapServer-dev wrote:
>> > Hi Even,
>> >
>> > Thanks for your valuable feedback. 
>> >
>> > The homepage would be a "superset" of all available Mapfiles in a 
>> > MapServer deployment, as listed in the CONFIG file. Each individual 
>> > Mapfile would still have its own OGC API landing page, so the homepage 
>> > is best described as a directory of all landing pages. 
>> >
>> > As most MapServer deployments will likely be serving out a combination 
>> > of WxS and new OGC API services for some time to come, it will allow 
>> > both types to be listed together (I'm unaware of a OGC API spec that 
>> > would cover this). 
>> >
>> > In regard to the JSON used for links, I was modelling it as closely as 
>> > possible to OGC API conventions. Looking at the pygeoapi demo home 
>> > page, it provides a set of links in a common format, so I'll likely 
>> > switch to this format/approach:
>> >
>> > https://demo.pygeoapi.io/stable?f=json
>> >
>> > A few of the "rel" values are defined as below, and can be reused:
>> >
>> > alternate     Provides an alternate representation (e.g., HTML version of a 
>> > resource).
>> > service-desc  Links to the machine-readable API description (e.g., 
>> > OpenAPI JSON).
>> > service-doc   Links to the human-readable API documentation (e.g., 
>> > OpenAPI HTML).
>> > conformance   Lists the standards and conformance classes supported by 
>> > the API.
>> >
>> > I'll update the RFC with the above,
>> >
>> > Seth
>> >
>> > --
>> > web:https://geographika.net & https://mapserverstudio.net
>> > mastodon: @geographika at mastodon.social
>> >
>> > On Sat, Jan 18, 2025, at 12:39 PM, Even Rouault wrote:
>> >> Seth,
>> >>
>> >> Thanks for putting this together. I'm wondering how much your proposal 
>> >> relates/intersects with the concept of the landing page of OGC API 
>> >> services ? You mention some connection with it, but it is not 
>> >> immediately clear to me  the exact nature of the connection. Perhaps it 
>> >> is just a matter of clarifying. I have put zero thoughts in it, but it 
>> >> would feel weird to invent a MapServer specific thing, so I'm naively 
>> >> wondering if we can't we just adopt the landing page formalism (for the 
>> >> JSON part), and potentially extend it by exposing old WxS services as 
>> >> well in the links as you suggest? I'm also wondering if there's some 
>> >> best practice used by other projects on how to expose for things like
>> >>
>> >> {
>> >>              "href": 
>> >> "https://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities",
>> >>              "title": "GetCapabilities",
>> >>              "type": "WMS"
>> >>          },
>> >>
>> >> so they can be interoperably consumed.
>> >>
>> >> Even
>> >>
>> >> Le 18/01/2025 à 09:11, Seth G via MapServer-dev a écrit :
>> >>> Hi devs,
>> >>>
>> >>> I've drafted an RFC with an approach of creating a MapServer homepage based on the MAPs referenced in a mapserver.conf file. This will allow MapServer installations to easily advertise available services, dynamically.
>> >>>
>> >>> Text available in pull request at https://github.com/MapServer/MapServer-documentation/pull/996
>> >>>
>> >>> Comments and thoughts appreciated,
>> >>> Thanks,
>> >>>
>> >>> Seth
>> >>>
>> >>> --
>> >>> web:https://geographika.net & https://mapserverstudio.net
>> >>> mastodon: @geographika at mastodon.social
>> >>> _______________________________________________
>> >>> MapServer-dev mailing list
>> >>> MapServer-dev at lists.osgeo.org
>> >>> https://lists.osgeo.org/mailman/listinfo/mapserver-dev
>> >>
>> >> -- 
>> >> http://www.spatialys.com
>> >> My software is free, but my time generally not.
>> >> Butcher of all kinds of standards, open or closed formats. At the end, 
>> >> this is just about bytes.
>> > _______________________________________________
>> > MapServer-dev mailing list
>> > MapServer-dev at lists.osgeo.org
>> > https://lists.osgeo.org/mailman/listinfo/mapserver-dev
>> _______________________________________________
>> MapServer-dev mailing list
>> MapServer-dev at lists.osgeo.org
>> https://lists.osgeo.org/mailman/listinfo/mapserver-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-dev/attachments/20250122/c3d280eb/attachment.htm>


More information about the MapServer-dev mailing list