[Geoserver-users] Returning any kind of file with WPS python script

Grazie Fabrizio,

Your patch is for the WPS plugin itself, or? We’re at DLR only working with the community Python module and one of the things missing would be a documentation which type mapping are done (Python → WPS) internally. The WPS processes provided by Geoserver already output files as results (RawOutput) so we we’re curious if this functionality can be used via the Scripting Extension – in general the functionality of file results in the WPS extension is already there as I observed…

Thomas

···

Von: Fabrizio Tringali [mailto:ftringali@…84…]
Gesendet: Dienstag, 9. Juli 2013 11:02
An: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Returning any kind of file with WPS python script

Thomas, Justin

I developed some changes to an older version of GeoServer/GeoTools (2.2 / 8) in order to enable base64 complex objects management at the WPS level.

I never found enough time to send a patch as required by current policies, but if you drop me a line I will share them with you and maybe that could be useful

Cheers,

Fabrizio

=======From: Justin Deoliveira <jdeolive@…1671…>=====

Hey Thomas,

On Fri, Jul 5, 2013 at 12:25 PM, <Thomas.Wanderer@…1298…> wrote:

We?re planning to return a zip-file. We were hoping that it?s possible
to return a file via the scripting plugin, but of course this cannot be
simply the path as string, so we were thinking it might be possible by
providing a file object.

Right, i got that from the first post but what does the zip file contain is
my questions. Regardless i am thinking your use case is probably not
supported via a wps plugin. You could however use an “app” hook which
basically gives you an http invokable endpoint where you are free to return
any sort of content you choose.


We really hope this is somehow possible but do not know in which way we?d
have to provide results to make Geoserver (WPS) return a RawOutput instead
of a ResultDocument and how to specify a Content-Type or Mime-Type.****

**

Can you open a jira issue for this. Thanks.

**

Thanks,****

Thomas****



Von: Justin Deoliveira [mailto:jdeolive@…1671…]
Gesendet: Freitag, 5. Juli 2013 17:07
An: Herle, Stefan
Cc: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Returning any kind of file with WPS
python script****


Hey Stefan,****


What sort of data are you returning from the process? If you can provide a
bit more info that would be great.****


-Justin****




On Fri, Jul 5, 2013 at 6:38 AM, <Stefan.Herle@…1298…> wrote:****

Hey,****


I am trying to return a file (.zip) in a WPS python script but I have no
clue which type to choose for the output in the python decorator. ****

I know that it is possible to define a raw data output in general but
what are the specific type mappings used in the WPS python script.****


Thanks!****

On Tue, Jul 9, 2013 at 12:24 PM, <Thomas.Wanderer@anonymised.com> wrote:

Grazie Fabrizio,****

** **

Your patch is for the WPS plugin itself, or? We’re at DLR only working
with the community Python module and one of the things missing would be a
documentation which type mapping are done (Python -> WPS) internally. The
WPS processes provided by Geoserver already output files as results
(RawOutput) so we we’re curious if this functionality can be used via the
Scripting Extension – in general the functionality of file results in the
WPS extension is already there as I observed…7

I believe you're hitting a current limitation in the design of the WPS
subsystem, one that would require some work to be sorted
out in a general way.

Basically, the processes we deal with are meant to exist outside of the
WPS, and be usable as library bits or
in desktop tools, as a result they don't have a notion of mime types in
either input or output, but normally
trade java objects instead.
Then the WPS searches the appropriate ProcessParameterIO class to transform
the provided inputs (e.g., geojson)
into the GeoTools feature collection used as an input by the process, and
then searches for another ProcessParameterIO
to turn the output, say a GridCoverage2D, into the requested output type,
for example a GeoTiff.

A process that knows about input and output mime types would be something
WPS specific, while there is interest
in supporting also that use cases (processes exchanging files, and able to
get and generate different types of files),
there has been no funding, or someone interested in working that in their
spare time, to move into that direction.

One year ago I've tried to start up a discussion to get these improvements
going, but unfortunately I only had
a very short time window to work on it (one day, take or leave), and quite
understandably
the community response was not quick enough to allow me to follow up with
development:
http://osgeo-org.1560.x6.nabble.com/Process-annotations-improvements-with-a-WPS-bit-td4979927.html

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------

Bitte Thomas,

yes, my patch is just for the WPS plugin. I have no knowledge on the Python module, I want just alert you that if your use case will deal with WPS complex data type including raw data (base64 encoded), a bit of work is already done.

···

Fabrizio

2013/7/9 <Thomas.Wanderer@anonymised.com>

Grazie Fabrizio,

Your patch is for the WPS plugin itself, or? We’re at DLR only working with the community Python module and one of the things missing would be a documentation which type mapping are done (Python → WPS) internally. The WPS processes provided by Geoserver already output files as results (RawOutput) so we we’re curious if this functionality can be used via the Scripting Extension – in general the functionality of file results in the WPS extension is already there as I observed…

Thomas

Von: Fabrizio Tringali [mailto:ftringali@anonymised.com…]
Gesendet: Dienstag, 9. Juli 2013 11:02
An: geoserver-users@lists.sourceforge.net
Betreff: Re: [Geoserver-users] Returning any kind of file with WPS python script

Thomas, Justin

I developed some changes to an older version of GeoServer/GeoTools (2.2 / 8) in order to enable base64 complex objects management at the WPS level.

I never found enough time to send a patch as required by current policies, but if you drop me a line I will share them with you and maybe that could be useful

Cheers,

Fabrizio

On Tue, Jul 9, 2013 at 2:18 PM, Fabrizio Tringali <ftringali@anonymised.com>wrote:

Bitte Thomas,

yes, my patch is just for the WPS plugin. I have no knowledge on the
Python module, I want just alert you that if your use case will deal with
WPS complex data type including raw data (base64 encoded), a bit of work is
already done.

Can you share the patch, and/or describe what it is about? Did you create a
new PPIO?
The current code should already be able to base64 encode an output when
requesting the response in document mode,
although it's not well tested (normally when the output is a binary one we
prefer to ask for an output in raw mode to avoid
the base64 encoding overhead)

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------

So, the patch would be for base64 encoded data inside a result document? That’s neat but currently we’re only looking at returning 1 file!

We simply want a file download dialog appearing as result!

···

Von: andrea.aime@anonymised.com [mailto:andrea.aime@anonymised.com] Im Auftrag von Andrea Aime
Gesendet: Dienstag, 9. Juli 2013 14:31
An: Fabrizio Tringali
Cc: Wanderer, Thomas; GeoServer Mailing List List
Betreff: Re: [Geoserver-users] Returning any kind of file with WPS python script

On Tue, Jul 9, 2013 at 2:18 PM, Fabrizio Tringali <ftringali@anonymised.com.> wrote:

Bitte Thomas,

yes, my patch is just for the WPS plugin. I have no knowledge on the Python module, I want just alert you that if your use case will deal with WPS complex data type including raw data (base64 encoded), a bit of work is already done.

Can you share the patch, and/or describe what it is about? Did you create a new PPIO?

The current code should already be able to base64 encode an output when requesting the response in document mode,

although it’s not well tested (normally when the output is a binary one we prefer to ask for an output in raw mode to avoid

the base64 encoding overhead)

Cheers

Andrea

==

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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


Sure Andrea!

Briefly speaking: a new PPIO and a couple of changes (ComplexDataTypeBinding, BinaryEncoderDelegate, ExecuteResponseBuilder, SimpleInputProvider, etc. etc.)

It was September 2012, meanwhile I was involved in other activities so, likely, everything could be obsolete now

Could I send a zip directly to you for a fast check?

···

2013/7/9 Andrea Aime <andrea.aime@anonymised.com>

On Tue, Jul 9, 2013 at 2:18 PM, Fabrizio Tringali <ftringali@anonymised.com> wrote:

Bitte Thomas,

yes, my patch is just for the WPS plugin. I have no knowledge on the Python module, I want just alert you that if your use case will deal with WPS complex data type including raw data (base64 encoded), a bit of work is already done.

Can you share the patch, and/or describe what it is about? Did you create a new PPIO?
The current code should already be able to base64 encode an output when requesting the response in document mode,
although it’s not well tested (normally when the output is a binary one we prefer to ask for an output in raw mode to avoid
the base64 encoding overhead)

Cheers

Andrea

==
Our support, Your Success! Visit http://opensdi.geo-solutions.it 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


On Tue, Jul 9, 2013 at 4:31 PM, Fabrizio Tringali <ftringali@anonymised.com>wrote:

Sure Andrea!

Briefly speaking: a new PPIO and a couple of changes
(ComplexDataTypeBinding, BinaryEncoderDelegate, ExecuteResponseBuilder,
SimpleInputProvider, etc. etc.)

It was September 2012, meanwhile I was involved in other activities so,
likely, everything could be obsolete now

Could I send a zip directly to you for a fast check?

Sure, let's have a look

Cheers
Andrea

--

Our support, Your Success! Visit http://opensdi.geo-solutions.it 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

-------------------------------------------------------