-
-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QGIS Server API support (WFS3 & C.) #144
Comments
@pblottiere @rldhont any comment? |
Hi @elpaso, Firstly, thanks a lot for taking a look to WFS 3! It's clearly a matter of interest on which we're a bit late. About the OpenAPI management, I like your approach as well as the proposed implementation. Indeed, it's simple and pretty straightforward. Considering the future WFS3 service, how do you plan to reuse current classes/methods of the WFS 1.X module? Is it possible? Or do we want to write a specific module (i.e a dedicated shared library)? But in brief: +1 |
Thanks for the feedback! I believe we'd need a brand new library for WFS3 but maybe we can factorize something common. |
Hi @elpaso, Yes, moving to WFS3 require to adapt the routing workflow of the requests to be more RESTful. My deux cents that it is only a beginning to a more larger step towards REST api AMHA, instead of adding path support as fallback to the current request routing (based solely on SERVICE) I would be in favor to refactor the server so as to put the path routing on top and let the actual behavior as the '/' root path fallback. The idea is to implement path request rooting using of the actual qgsService implementation. |
@dmarteau thanks for the feedback! About the dispatching, I liked the idea to have some kind of "home" page API responding to Instead we could route the actual services through a But those are really details, and once the dispatching logic is in place they can be easily changed along the way or better: why don't we refactor the actual services to be APIs themselves? For instance we could have the WFS service to respond to |
Yes, that scratched my mind also :-)
I completely agree with that, and I'm pretty sure that's the correct solution. Also, looking at your proposal for api interface, I'm pretty convinced that we could reuse the actual implementation to turn it into APIs managment. |
QGIS Server API support (WFS3 & C.)
Date 2019/05/07
Author Alessandro Pasotti (@elpaso)
Contact elpaso at itopen dot it
maintainer @elpaso
Version QGIS 3.10 (maybe)
Summary
Provided that OGC is moving towards OpenAPI for WFS3 (and probably other services too), we need to rework the dispatcher system in QGIS Server (now based on
SERVICE=...
query string parameter).Hereby I'm proposing a new QGIS Server API (very similar to the existing API for service modules) that would allow to register endpoints to a certain path.
Proposed Solution
Here is how it's supposed to work:
The new dispatcher inside the
QgsServerser
s handle request method will first check if the request contains anySERVICE
parameter, if it does it assumes it is a legacy OGC service, if not, before bailing out with an "unsupported service" error it will check for any registered api that matches the request path.The a.m. test API would for instance respond to this call:
The
QgsServerApi
interface (abstract class) would expose some limited methods and since the first use case of this API will probably be WFS3, along the way we could expect some more methods to be factored out and become part of the interface.This is a preliminary implementation:
Example(s)
See example in previous paragraph.
Further considerations/limitations
The proposed system will match the first API and the order matters: for example it will not be able to activate two different endpoints if the root path of one of them starts with the root path of another previously added one, for example:
Affected Files
Mainly
qgsserver.h
and the server registry and interfaces.Performance Implications
The impact on existing code is negligible.
Backwards Compatibility
No issues
Votes
(required)
The text was updated successfully, but these errors were encountered: