[Pywps-devel] grass online
ivan marchesini
ivan.marchesini at gmail.com
Sun Jan 24 21:58:30 CET 2010
Dear Jachym (and pyWPS users/developers),
I'm still at the same point of last e-mail but with one new question.
This is the OpenLayers code of the function calling my test pyWPS
process:
__________________________________________
var calculate = function() {
var wps = new OpenLayers.WPS("http://mywpswrapper",
{
onSucceeded : onSucceeded,
onStatusChanged :
onStatusChanged
});
var output1 = new OpenLayers.WPS.ComplexPut({
identifier: "output",
title: "output_voronoi"
});
var process = new OpenLayers.WPS.Process({
identifier: "voronoi_sanf",
assync: false,
outputs: [output1]
});
wps.addProcess(process);
wps.execute(process.identifier);
}
___________________________________________________
Activating the function (by means of a click on a extjs button) the
process starts and all seems working well.
A code containing this text:
________________
<?xml version="1.0" encoding="utf-8"?>
<wps:ExecuteResponse xmlns:wps="http://www.opengis.net/wps/1.0.0"
xmlns:ows="http://www.opengis.net/ows/1.1" xmln [.....]
_______________
with a lot of points coordinates, arrives into my browser (I can see it
with firebug)
Now I'm trying to load this xml into my openlayer.map (which is called
"mappa"):
______________________________________
var onSucceeded = function() {
wps.parseExecuteOutput(process,output1);
console.log("CIAO");
mappa.addLayer(output.value);
}
______________________________________
It doesn't work... but the main problem is that I can't see, into
firebug, the word "CIAO"!!!!!
It seems that the onSucceeded function is not called at the end of the
process execution...
could be???
Please give me some hints..
many many thanks...
Ivan
>
> This function is inside a larger .js script wich use geoext and
> openlayers...
>
> when I activate the function clicking on the button I can see (by means
> of firebug) that the xml files is correctly called... and it is the same
> which is into the outputUrl folder of my server..
>
> what I need to understand now is:
>
> how can I use the onSucceeded function or other functions to add the
> created map to the existing openlayers.map object??
>
>
> probably is simple but I can't understand it really well...
>
> many many thanks..
>
> Ivan
>
> (hope this e-mail can help someone who has similar problems)
>
>
>
>
>
>
> Il giorno lun, 18/01/2010 alle 07.52 +0100, Jachym Cepicky ha scritto:
> > This you can found in
> >
> > trunk/doc/examples/clients/WPS.js
> >
> > and some example should be in trunk/doc/examples/clients/wps-WPS.html
> >
> > there is some OpenLayers-minimal-wps.js, but you better use full
> > OpenLayers.js
> >
> > basicaly, there are two ways, how to get it work:
> >
> > a) (semi) automatic
> > b) by hand
> >
> > the seccond approach (by hand) is maybe easier to understand, because it
> > copies the way, you define the process in pywps
> >
> > 1) you have to define the the wps instance
> > 2) you have to define the process, you need to run
> > 3) you have to define inputs and outputs the process needs
> > 4) you have to assign in- and outputs to particular process
> > 5) you have to assing process to particular wps instance
> > 6) you run the execute method
> > 7) you get the result, which is parsed and you can display it in the map
> >
> > which translated to javascript could look like
> >
> > //1) define wps instance
> > var wps = new OpenLayers.WPS(url,{onStatusChanged: some_function, onSucceeded:
> > other_function});
> >
> > //2) define the in and ouputs
> > var input1 = new OpenLayers.WPS.ComplexPut({
> > identifier: "Input",
> > asReference: false,
> > value: gmlData
> > });
> >
> > ...
> >
> > //3) define the process
> > var process = new OpenLayers.WPS.Process({
> > identifier: "process",
> > assync: false,
> > inputs: [input1, ...],
> > outputs: [output1, ... ]
> > });
> >
> > // 4) assign the process to wps instance
> > wps.addProcess(process);
> >
> > // 5) execute
> >
> > wps.execute('process_identifier');
> >
> > function on_succeeded(process) {
> > var outputValue = process.ouputs[0].value;
> >
> >
> > };
> >
> >
> > the second approach works semi-automatic way
> >
> > 1) you have to define the wps instalce
> > 2) you have to call get capabilities
> > 3) you have to call describe process
> > 4) user has to input some data - there must be some auto-generated html form
> > for this and this is not done in this library
> > 5) you have to run execute
> > 6) you can display results
> >
> > // 1) wps
> > var wps = new OpenLayers.WPS(url, {onStatusChagned: status_changed,
> > onSucceeded: on_succedded});
> > wps.getCapabilities(url);
> >
> > // 2) describe process
> > for (var i = 0; i < wps.processes.length; i++) {
> > wps.describeProcess(wps.processes[i].identifier);
> > }
>
> > // 3) for each process, generate the input form
> > for (var i = 0; i < wps.processes.length; i++) {
> > // define the input form and display it to HTML page, you have all the
> > attributes of each processes
> > }
> >
> > // 4) call the execute method just like in the previous example
> >
> > if you need any (mapping) data, to be displayed within OpenLayers, it must
> > be PNG, JPG or GIF (for raster data), GML or any other text or xml-based
> > format. Do not to forget, to add asReference=true to you output request and
> > set propper supported output format, such as
> >
> > self.out = self.addComplexOutput(identifier = "out",
> > title = "Resulting output map",
> > formats = [
> > {"mimeType":"image/tiff"},
> > {"mimeType":"image/png"}
> > ]#,
> > # useMapscript=True // this here is for the
> > // mapscript part, see below
> > )
> >
> > so the client can choose, which output format she preferes
> >
> > than you can define just the OpenLayers.Layer.Image or OpenLayers.Layer.GML or
> > whatever, and OpenLayers will display the result to you.
> >
> >
> > In the trunk, there is basic support for MapServer urls, so the ouput is not a
> > file reference, but complete WMS/WCS/WFS request. Your client can later
> > manipulate with it easier, than with standard files (OpenLayers.Layer.WMS and
> > OpenLayers.Layer.WFS comes to word here).
> >
> > the OpenLayers.WPS is relatively fresh and undocumented. I tested it and for
> > my purposes, it works. But any input from yours side is always accepted.
> >
> > Thanks
> >
> > Jachym
> >
> > Dne Ne 17. ledna 2010 16:03:28 Mohammed Rashad napsal(a):
> > > I know i am wasting your precious time but i have no other choices. I must
> > > get help from author of PyWPS.
> > > My PyWPS installation works fine and i got xml output in the web browser. I
> > > don't know how to handle it in OpenLayers and how to get image as output
> > > after execute function of PyWPS Process.
> > >
> > > I had seen an example in PyWPS gallery ---> http://geo.sazp.sk/.
> > > I also go through the code of the above example and got some idea about how
> > > to handle the request to calculate visibility process.
> > > My question is how to make a general extenstion in OpenLayers to handle any
> > > typw of PyWPS requests.
> > >
> > > Its working fine and I thought I should ask your help. Do i need to write
> > > an extension for openlayers to support PyWPS in openlayers
> > > such as *makeWpsRequest* in *hslayer.js* of the above demo link.
> > >
> > > On Sun, Jan 17, 2010 at 6:39 PM, Jachym Cepicky
> > <jachym.cepicky at gmail.com>wrote:
> > > > hi,
> > > >
> > > > Dne Ne 17. ledna 2010 10:04:09 Mohammed Rashad napsal(a):
> > > > > Hi,
> > > > > I am developing a webGIS application which needs some online analysis
> > > > > of GRASS data.
> > > > > GRASS data is not converted to shapefiles, GML or any other formats.
> > > > > It must be accessed from GRASS database directly and some of grass
> > > >
> > > > modules
> > > >
> > > > > will be applied on the data and output must be displayed on web
> > > > > browser.
> > > > >
> > > > > My actual problem is when i searched for such a web application, I
> > > > > found nothing.
> > > >
> > > > Did you hear about PyWPS ?
> > > >
> > > > > So i decided to develop a new extension for openlayers.
> > > > > If you know any existing application which can solve my problem, I can
> > > > > save my time developing a useless module for openalyers.
> > > >
> > > > OpenLayers is JavaScript - client-side programming language (usually).
> > > > You need some server-script. There is OpenLayers-based client for WPS,
> > > > which is part of PyWPS, so you can interpret results Execute results from
> > > > WPS and handle them in OpenLayers.
> > >
> > > I didn't undestand this section. will you please elaborate if you are not
> > > very busy. please..
> > >
> > > > > I have no trouble with programming in javascript because basically I am
> > > > > a developer.
> > > > >
> > > > > what is your opinion about my problem?. I expect you help and
> > > >
> > > > co-operation.
> > > >
> > > > As long as you will need something for PyWPS, yes, othervice, I have
> > > > enough work to do, thank you.
> > > >
> > > > > Please reply as soon as possilbe for you.
> > > > >
> > > > > Thanks in advance
> > > >
> > > > --
> > > > Jachym Cepicky
> > > > e-mail: jachym.cepicky gmail com
> > > > URL: http://les-ejk.cz
> > > > PGP Public key: http://les-ejk.cz/pgp/JachymCepicky.pgp
> > >
> >
>
>
--
Ti prego di cercare di non inviarmi files .dwg, .doc, .xls, .ppt.
Preferisco formati liberi.
Please try to avoid to send me .dwg, .doc, .xls, .ppt files.
I prefer free formats.
http://it.wikipedia.org/wiki/Formato_aperto
http://en.wikipedia.org/wiki/Open_format
Ivan Marchesini
Perugia (Italy)
Socio fondatore GFOSS "Geospatial Free and Open Source Software" http://www.gfoss.it
e-mail: marchesini at unipg.it
ivan.marchesini at gmail.com
fax (home): +39(0)5782830887
jabber: geoivan73 at jabber.org
skype: geoivan73
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Questa =?ISO-8859-1?Q?=E8?= una parte del messaggio
firmata digitalmente
Url : http://lists.wald.intevation.org/pipermail/pywps-devel/attachments/20100124/ccfec84a/attachment.pgp
More information about the Pywps-devel
mailing list