Skip to content

Commit 9b6914e

Browse files
authored
Merge pull request #1001 from MapServer/backport-1000-to-branch-8-4
[Backport branch-8-4] RFC140 updates
2 parents e6bedbf + 2c21a66 commit 9b6914e

File tree

2 files changed

+66
-29
lines changed

2 files changed

+66
-29
lines changed

conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,13 +410,13 @@ class WKTLexer(RegexLexer):
410410
r'BACKGROUNDSHADOWSIZE|BANDSITEM|BINDVALS|BROWSEFORMAT|BUFFER|CHARACTER|CLASS|CLASSITEM|'
411411
r'CLASSGROUP|CLUSTER|COLOR|COLORRANGE|COMPOSITE|COMPOP|COMPFILTER|CONFIG|'
412412
r'CONNECTION|CONNECTIONOPTIONS|CONNECTIONTYPE|DATA|DATAPATTERN|DATARANGE|DEBUG|'
413-
r'DRIVER|DUMP|EMPTY|ENCODING|END|ERROR|EXPRESSION|EXTENT|EXTENSION|FEATURE|'
413+
r'DRIVER|DUMP|EMPTY|ENCODING|END|ENV|ERROR|EXPRESSION|EXTENT|EXTENSION|FEATURE|'
414414
r'FILLED|FILTER|FILTERITEM|FOOTER|FONT|FONTSET|FORCE|FORMATOPTION|FROM|GAP|GEOMTRANSFORM|'
415415
r'GRID|GRIDSTEP|GRATICULE|GROUP|HEADER|IMAGE|IMAGECOLOR|IMAGETYPE|IMAGEQUALITY|IMAGEPATH|'
416416
r'IMAGEURL|INCLUDE|INDEX|INITIALGAP|INTERLACE|INTERVALS|JOIN|KEYIMAGE|KEYSIZE|KEYSPACING|LABEL|'
417417
r'LABELCACHE|LABELFORMAT|LABELITEM|LABELMAXSCALE|LABELMAXSCALEDENOM|'
418418
r'LABELMINSCALE|LABELMINSCALEDENOM|LABELREQUIRES|LATLON|LAYER|LEADER|LEGEND|'
419-
r'LEGENDFORMAT|LINECAP|LINEJOIN|LINEJOINMAXSIZE|LOG|MAP|MARKER|MARKERSIZE|'
419+
r'LEGENDFORMAT|LINECAP|LINEJOIN|LINEJOINMAXSIZE|LOG|MAP|MAPS|MARKER|MARKERSIZE|'
420420
r'MASK|MAXARCS|MAXBOXSIZE|MAXDISTANCE|MAXFEATURES|MAXINTERVAL|MAXSCALE|MAXSCALEDENOM|MINSCALE|'
421421
r'MINSCALEDENOM|MAXGEOWIDTH|MAXLENGTH|MAXSIZE|MAXSUBDIVIDE|MAXTEMPLATE|'
422422
r'MAXWIDTH|METADATA|MIMETYPE|MINARCS|MINBOXSIZE|MINDISTANCE|'

en/development/rfc/ms-rfc-140.txt

Lines changed: 64 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ MS RFC 140: MapServer Homepage
66

77
:Author: Seth Girvin
88
9-
:Last Updated: 2025-01-18
9+
:Last Updated: 2025-01-23
1010
:Version: MapServer 8.6
1111
:Status: Draft
1212

@@ -21,6 +21,12 @@ would offer greater convenience and maintainability.
2121
With the introduction of the :ref:`CONFIG file <config>` in MapServer 8.0, it is now possible to centrally manage information about all Mapfiles in a deployment.
2222
This would ensure that the homepage remains automatically synchronised with both the CONFIG file and the capabilities of the Mapfiles it references.
2323

24+
The homepage would be a "superset" of all available Mapfiles in a MapServer deployment, as listed in the CONFIG file.
25+
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.
26+
27+
As most MapServer deployments will likely be serving out a combination of WxS and new OGC API services for some time to come,
28+
it will allow both types to be listed together.
29+
2430
2.1 Proposed Solution
2531
=====================
2632

@@ -59,42 +65,73 @@ Requests will look as follows:
5965
As the service returns JSON any client-side library can be used to render the output. However a default HTML template will be provided
6066
following the same approach as in OGC Features API.
6167

68+
.. note::
69+
70+
Even though the JSON format is based on the OGC API, the homepage JSON service will still be generated for a Mapfile even if it only supports
71+
older WxS services.
72+
6273
JSON Structure
6374
--------------
6475

6576
JSON will be generated using the nlohmann/json and Inja approach already implemented in :ref:`MS RFC 134: OGC API Support <rfc134>`.
66-
A proposed JSON structure is shown below. Final details may vary. URLs will be constructed based on settings in each individual Mapfile.
77+
78+
The returned JSON will conform to the the `api-catalog <https://datatracker.ietf.org/doc/draft-ietf-httpapi-api-catalog/08/>`__,
79+
a draft IETF (Internet Engineering Task Force) standard. An example implementation is the `pygeoapi homepage <https://demo.pygeoapi.io/>`__
80+
(see the associated `pull request <https://github.com/geopython/demo.pygeoapi.io/pull/60/files>`__). The JSON structure is available at
81+
https://demo.pygeoapi.io/api-catalog.json. An extract is shown below:
6782

6883
.. code-block:: json
6984

7085
{
71-
"id": "TEST_MAPFILE1", // the key in the config file
72-
"name": "My_Mapfile", // the NAME in the Mapfile
73-
"title": "My Mapfile Title", // the TITLE in the Mapfile
74-
"links": [
75-
{
76-
"href": "https://demo.mapserver.org/cgi-bin/wms?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities",
77-
"title": "GetCapabilities",
78-
"type": "WMS"
79-
},
86+
"linkset": [
8087
{
81-
"href": "https://demo.mapserver.org/cgi-bin/wfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=GetCapabilities",
82-
"title": "GetCapabilities",
83-
"type": "WFS"
84-
},
85-
{
86-
"href": "https://demo.mapserver.org/cgi-bin/wcs?SERVICE=WCS&VERSION=1.0.0&REQUEST=GetCapabilities",
87-
"title": "GetCapabilities",
88-
"type": "WCS"
89-
},
90-
{
91-
"href": "https://demo.mapserver.org/cgi-bin/mapserv/localdemo/ogcapi/api?f=html",
92-
"title": "Landing Page",
93-
"type": "OGCAPI"
94-
},
95-
]
96-
}
88+
"anchor": "https://demo.pygeoapi.io/master",
89+
"service-desc": [
90+
{
91+
"href": "https://demo.pygeoapi.io/master/openapi?f=json",
92+
"title": "pygeoapi - latest GitHub 'master' version (JSON)",
93+
"type": "application/vnd.oai.openapi+json"
94+
}
95+
],
96+
"service-doc": [
97+
{
98+
"href": "https://demo.pygeoapi.io/master/openapi?f=html",
99+
"title": "pygeoapi - latest GitHub 'master' version (HTML)",
100+
"type": "text/html"
101+
}
102+
]
103+
},
104+
105+
The api-catalog specification allows for an additional ``service-meta`` property *"used to link to additional metadata about the API,
106+
and is primarily intended for machine consumption."* This can be used to add any additional properties from Mapfiles
107+
required to generate a MapServer homepage. ``service-doc`` isn't mandatory property, so WxS service links can ignore this.
108+
109+
An example of the proposed JSON and metadata is shown below:
110+
111+
.. code-block:: json
97112

113+
{
114+
"linkset": [
115+
{
116+
"anchor": "https://demo.mapserver.org/",
117+
"service-desc": [
118+
{
119+
"href": "https://demo.mapserver.org/cgi-bin/msautotest?SERVICE=WMS&VERSION=1.3.0&REQUEST=GetCapabilities",
120+
"title": "World WMS service",
121+
"type": "text/xml"
122+
}
123+
],
124+
"service-meta": {
125+
{
126+
"service-type": "wms",
127+
"title": "WMS demo server for MapServer, used in the msautotest suite",
128+
"keywords": ["layers", "list"],
129+
"mapfile": "msautotest.map",
130+
}
131+
}
132+
},
133+
134+
``href`` values will be constructed based on settings in each individual Mapfile.
98135

99136
Future Development
100137
------------------

0 commit comments

Comments
 (0)