Hi,
following up with the raw input/output work I wanted to make it possible for python
scripts to use RawData and specify the mime types and the selected output mime type
arguments.
I’ve implemented it in the simplest possible way, made it so that the dictionary that we added
for the min/max/domain options can contain any other key/value, if they are not well known
ones, the key/value is put in the metadata map of the Param:
https://github.com/aaime/geoserver/commit/674a9e15b23f5c8d3f099755be696b4c1b83360f
For example:
from geoserver.wps import process
from geoscript.geom import Geometry
from org.geoserver.wps.process import RawData
from org.geoserver.wps.process import StreamRawData
@process(
inputs={‘input’: (RawData, ‘The raw data input’, {‘mimeTypes’:‘application/json,text/xml’}),
‘outputMimeType’: (str, ‘The user chosen output mime type’ , {‘min’: 0})},
outputs={‘result’: (RawData, ‘The output’, {‘mimeTypes’:‘application/json,text/xml’, ‘chosenMimeType’:‘outputMimeType’})},
title=‘Raw’,
description=‘Raw process’)
def run(input, outputMimeType):
return StreamRawData(outputMimeType, input.stream);
Cheers
Andrea
–
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/NWWaa2 for more information.
==
Ing. Andrea Aime
@geowolf
Technical Lead
GeoSolutions S.A.S.
Via Poggio alle Viti 1187
55054 Massarosa (LU)
Italy
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549
http://www.geo-solutions.it
http://twitter.com/geosolutions_it