Closed huard closed 3 years ago
If this sounds about right, I'll update the documentation.
With this PR we can configure different output urls depending on the mime-type (like WMS, OpenDAP, ...). The process does not need to worry about this. It uses the the pywps FORMATS for configuring the output url for a specific mime-type (like WMS130
):
https://github.com/geopython/pywps/blob/d05483d75e753b3cda303f5c0bb778a0f9465393/pywps/inout/formats/__init__.py#L18
@tomkralidis @jachym @ldesousa Are you happy with this approach?
This looks cool, but could I ask you for adding some more descriptive example in the documatation, where you could describe the integration with GeoServer? E.g. in https://pywps.readthedocs.io/en/latest/external-tools.html ?
I don't really know how it would work, because the url for WMS/WFS is not just a path, but a request. I'll need help on this one.
From what I can quickly understand, adding a layer to GeoServer requires a call to the REST API, telling it in which workspace it should go, what is the default style, etc. The solution I propose in this PR is too basic for this. Saving to GeoServer would probably be done explicitly within the process handler:
url = store_geoserver(feature, workspace, **kwargs)
request.response['output'].url = url
ok, we have to work on the store_geoserver
function, whatever it may be
from I have no more questions, we can merge
@huard ok to merge?
I'm concerned we will need to change the config to support the GeoServer use case. Do you want to mention in the docs that this feature should be considered experimental ?
To support @jachym use case with GeoServer, I can see two options:
store_geoserver
function called explicitly inside the process handler. Developer would be responsible for the configuration. GeoServerStorage
class, that is used for certain output mime-types.In the case of 2, the configuration would probably be like:
[storage]
DODS=thredds
WMS=geoserver
*=file [or s3]
[file]
host=
outputpath=
[geoserver]
host=
workspace=
[thredds]
host=
outputpath=
I think I would prefer option 2 ...having a GeoServerStorage
class. Could this be done in another PR?
Yes, but then this PR should not be merged, as it will conflict.
I suggest, we leave the geoserver usace for now (if you are not desperately looking forward to implement it) and and make some ticket.
The GeoServer should use gsutil
python module. I think that this truly leads to GeoServer storage class - because "all the data" would be then distributed via geoserver serivices
And in the future, MapServer would be nice too ;-)
Overview
This PR proposes a mechanism that customizes the URL of an output based on its data format. By default the standard outputurl is used, but if the data format (identified by the field of the FORMATS tuple) is included in the
services
section of the configuration, then this is substituted.Related Issue / Discussion
Fixes #512
The use case for this is to run a THREDDS server or GeoServer alongside a PyWPS server, and serve some of the process outputs using dedicated services instead of a simple file url.
Additional Information
Contribution Agreement
(as per https://github.com/geopython/pywps/blob/master/CONTRIBUTING.rst#contributions-and-licensing)