Replies: 18 comments
-
|
Did you configure the server to support input paths ? |
Beta Was this translation helpful? Give feedback.
-
|
No, I did not have a config file added. But I changed it now. Now the flask server starts with: service = pywps.Service([Buffer(), MyBuffer(), Centroids(), LeastCostPath()], ['pywps.cfg', ])
app = flask.Flask(__name__)
app.route('/wps', methods=['GET', 'POST'])(lambda: service)
if __name__ == '__main__':
app.run()Full file can be found here allowedinputpaths=/tmp:/var/lib/pywps/downloads:/var/lib/pywps/public:.:/Full file can be found here. I tested used bird to test the wps with this. What does opengis.net/wps to do with my local pywps server? |
Beta Was this translation helpful? Give feedback.
-
|
Just use Another potential problem is that your links are relative, e.g. |
Beta Was this translation helpful? Give feedback.
-
|
Okay. I changed the the config Error message still is: Edit: Is there a maximum length for the links? |
Beta Was this translation helpful? Give feedback.
-
|
I'm not sure about the limit, but I'm quite certain your link would not exceed it. Could you post your input files so I can run a demo on my end ? |
Beta Was this translation helpful? Give feedback.
-
|
In the input keys don't match the inputs definitions, you should have instead Also, remove line |
Beta Was this translation helpful? Give feedback.
-
|
What version of owslib do you have ? |
Beta Was this translation helpful? Give feedback.
-
|
I can reproduce your issue using flask to launch the server instead of wsgi. |
Beta Was this translation helpful? Give feedback.
-
|
Been able to fix it by changing your code to |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for showing be the bugs for the input files. That helped me to find some more (Did ope the files so far). There is a single problem left. result = pywps.lcp(costs=cost_raster,
start=start_features,
end=end_features)
print(result.get(asobj=True)[0]) result.get(asobj=True) throws the error: As alternative I tried metalink.download with: |
Beta Was this translation helpful? Give feedback.
-
|
The pywps-flask repo is inactive, I would not rely on it too much. I don't know what |
Beta Was this translation helpful? Give feedback.
-
|
I can reproduce your problem with your flask app, but it works fine with the wsgi app. Is you flask app able to serve static files ? |
Beta Was this translation helpful? Give feedback.
-
|
What I mean is that your flask app has no route for |
Beta Was this translation helpful? Give feedback.
-
|
My background is more with the processing of geo data. It's the first time I try to create any web service. Three things:
I did not succeed with apache2, because Because I didn't wanna try pywps-flask. I used my own wsgi file. I wanted to use gunicorn with: The documentation here is somewhat old. Do you have better tip. Which wsgi to choose and how to config it?
@app.route('/outputs/'+'<path:filename>')
def outputfile(filename):
target_file = join('outputs', filename)
if isfile(target_file):
file_ext = splitext(target_file)[1]
with open(target_file, mode='rb') as f:
file_bytes = f.read()
mime_type = None
if 'json' in file_ext:
mime_type = 'text/json'
return flask.Response(file_bytes, content_type=mime_type)
else:
flask.abort(404)Which I took from pywps-flask for a missing better example. This does NOT change the error message. The server side locks looks okay:
|
Beta Was this translation helpful? Give feedback.
-
|
I currently try wsgi with gunicon. I had to uninstall the version from the distro and go with the version from conda (and log out and in again). I use this wsgi config: from pywps import Service
from src.wps.processes.least_cost_path import LeastCostPath
application = Service([LeastCostPath()], ['./pywps.cfg', ])and I all gunicorn with: On the client site I get the error with birdy:
when calling The most likely error I did so far is the nginx config: I understood the config description so that I have to create a file /etc/nginx/sites_available/default` to |
Beta Was this translation helpful? Give feedback.
-
|
I'm not a server guy myself, so not sure I can help you. I use the birdhouse cookie-cutter to create new servers. Everything is ready to go. |
Beta Was this translation helpful? Give feedback.
-
|
I have one and a half solutions so far. flask works with metalink download.get. The result is saved under |
Beta Was this translation helpful? Give feedback.
-
|
Okay the following setting works with flask only: I updated (os.path -> pathlib) and fixed the download route: @app.route('/tmp/'+'<path:filename>')
def outputfile(filename: str):
print(filename)
target_file = Path('/tmp') / filename
if target_file.is_file():
file_ext = target_file.suffix
with open(target_file, mode='rb') as f:
file_bytes = f.read()
mime_type = None
if 'json' in file_ext:
mime_type = 'text/json'
return flask.Response(file_bytes, content_type=mime_type)
else:
flask.abort(404)The result is good enough for me, but it would be nice to know, why the same config did not work with gunicorn. The only difference in my setting are the ports. I use 5000 fo flask and 8081 for gunicorn. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I want send some files to a local wps services. I use PyWPS. For me it seams like the first file is interpreted as url.
Environment
Steps to Reproduce
The process is configured in PyWPS with:
I want to use a raster file (Tiff) and two points (gpkg, or geojson) as vector file, to estimate the least cost path.
Additional Information
The traceback is:
Beta Was this translation helpful? Give feedback.
All reactions