[Pywps-dev] Raster Output error
Jonas Eberle
jonas.eberle at gmx.de
Fri Jun 10 01:20:53 PDT 2016
The error "no such file or directory" comes from the following line:
response.outputs['response'].file = 'done'
As response is a LiteralOutput I guess it is not correct to use the file attribute, better use the data attribute:
response.outputs['response'].data = 'done'
Cheers,
Jonas
----- Am 10. Jun 2016 um 10:13 schrieb Jachym Cepicky <jachym.cepicky at gmail.com>:
> Hi Lorenzo,
> There are two bugs as I understand. The first one:
> IOError: [Errno 2] No such file or directory:
> '/tmp/pywps/pypws_process_lQqN_6/done'
> do you have /tmp/pywps/ directory in you system (and is it writeable?)
> The second bug is about attempt to write log to database
> nice report btw, with the process I believe, we can fix it (both) once we find
> out what the problem could be
> Jachym
> st 8. 6. 2016 v 11:50 odesÃlatel Lorenzo Bottaccioli <
> lorenzo.bottaccioli at gmail.com > napsal:
>> Hi List,
>> I'm trying to run a process that recives a GeoTIFF as input and response a
>> GeoTIFF as output. But I'm having an error. The process is this:
>> from pywps import Process, ComplexInput, ComplexOutput,
>> get_format,LiteralOutput, Format
>> class Raster(Process):
>> def __init__(self):
>> inputs = [ComplexInput('raster','Raster input',[Format('GEOTIFF')])]
>> outputs = [ComplexOutput('raster_out', 'Raster
>> output',[Format('GEOJSON')]),LiteralOutput('response', 'Output response',
>> data_type='string')]
>> super(Raster, self).__init__(
>> self._handler,
>> identifier='rast_try',
>> title='Raster try',
>> inputs=inputs,
>> outputs=outputs,
>> store_supported=True,
>> status_supported=True
>> )
>> def _handler(self, request, response):
>> from osgeo import gdal
>> app=request.inputs['raster'][0].file
>> inds = gdal.Open(app)
>> outdriver = gdal.GetDriverByName('GTiff')
>> outds = outdriver.CreateCopy('output.tiff', inds)
>> outds.FlushCache()
>> response.outputs['raster_out'].output_format = Format('GEOTIFF')
>> response.outputs['raster_out'].file = 'output.tiff'
>> response.outputs['response'].file = 'done'
>> return response
>> The error that I recive is this one:
>> Traceback (most recent call last):
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py",
>> line 156, in _run_process
>> wps_response.update_status('PyWPS Process finished', 100)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py",
>> line 41, in update_status
>> self.doc = self._construct_doc()
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py",
>> line 171, in _construct_doc
>> output_elements = [self.outputs[o].execute_xml() for o in self.outputs]
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/outputs.py",
>> line 276, in execute_xml
>> literal_data_doc = WPS.LiteralData(text_type(self.data))
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/basic.py",
>> line 231, in get_data
>> return IOHandler.get_data(self)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/inout/basic.py",
>> line 173, in get_data
>> file_handler = open(self.source, mode='r')
>> IOError: [Errno 2] No such file or directory:
>> '/tmp/pywps/pypws_process_lQqN_6/done'
>> ERROR:root:Service error: near "''": syntax error
>> Traceback (most recent call last):
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Service.py",
>> line 358, in _parse_and_execute
>> wps_response = process.execute(wps_request, uuid)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py",
>> line 145, in execute
>> wps_response = self._run_process(wps_request, wps_response)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/Process.py",
>> line 178, in _run_process
>> wps_response.update_status('Process error: %s.%s Line %i %s' % (fname,
>> method_name, exc_tb.tb_lineno, e), -1)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/app/WPSResponse.py",
>> line 47, in update_status
>> update_response(self.uuid, self)
>> File
>> "/usr/local/lib/python2.7/dist-packages/pywps-4.0-py2.7.egg/pywps/dblog.py",
>> line 67, in update_response
>> cur.execute(update)
>> OperationalError: near "''": syntax error
>> How can I fix this?
>> Best,
>> Lorenzo
>> _______________________________________________
>> pywps-dev mailing list
>> pywps-dev at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/pywps-dev
> _______________________________________________
> pywps-dev mailing list
> pywps-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/pywps-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pywps-dev/attachments/20160610/f5618876/attachment-0001.html>
More information about the pywps-dev
mailing list