Dear list
 
We want to implement ras:Contour WPS to our product.
So we are in struggle with owslib python library. The xml works perfectly, but 
we got problems to implement it into python code.
The problem is how we can put raster layer from geoserver to input parameters???
 
so the original xml is the next
 
<? xml version = "1.0" encoding = "UTF-8" ?>< wps:Execute version = "1.0.0" 
service = "WPS" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"; xmlns = 
"http://www.opengis.net/wps/1.0.0"; xmlns:wfs = "http://www.opengis.net/wfs"; 
xmlns:wps = "http://www.opengis.net/wps/1.0.0"; xmlns:ows = 
"http://www.opengis.net/ows/1.1"; xmlns:gml = "http://www.opengis.net/gml"; 
xmlns:ogc = "http://www.opengis.net/ogc"; xmlns:wcs = 
"http://www.opengis.net/wcs/1.1.1"; xmlns:xlink = "http://www.w3.org/1999/xlink"; 
xsi:schemaLocation = "http://www.opengis.net/wps/1.0.0 
http://schemas.opengis.net/wps/1.0.0/wpsAll.xsd"; >
< ows:Identifier > ras:Contour </ ows:Identifier >
< wps:DataInputs >
< wps:Input >
< ows:Identifier > data </ ows:Identifier >
< wps:Reference mimeType = "image/tiff" xlink:href = "http://geoserver/wcs"; 
method = "POST" >
< wps:Body >
< wcs:GetCoverage service = "WCS" version = "1.1.1" >
< ows:Identifier > global:ndvi265 </ ows:Identifier >
< wcs:DomainSubset >
< ows:BoundingBox crs = "http://www.opengis.net/gml/srs/epsg.xml#3857"; >
< ows:LowerCorner > 7876459.734711582 6696392.636479105 </ ows:LowerCorner >
< ows:UpperCorner > 7881842.349576347 6701537.199580808 </ ows:UpperCorner >
</ ows:BoundingBox >
</ wcs:DomainSubset >
< wcs:Output format = "image/tiff" />
</ wcs:GetCoverage >
</ wps:Body >
</ wps:Reference >
</ wps:Input >
< wps:Input >
< ows:Identifier > levels </ ows:Identifier >
< wps:Data >
< wps:LiteralData > 0 </ wps:LiteralData >
</ wps:Data >
</ wps:Input >
< wps:Input >
< ows:Identifier > levels </ ows:Identifier >
< wps:Data >
< wps:LiteralData > 0.4 </ wps:LiteralData >
</ wps:Data >
</ wps:Input >
</ wps:DataInputs >
< wps:ResponseForm >
< wps:RawDataOutput mimeType = "application/json" >
< ows:Identifier > result </ ows:Identifier >
</ wps:RawDataOutput >
</ wps:ResponseForm >
</ wps:Execute >
 
the python code:
 
wps  = WebProcessingService( 'http://localhost:8080/geoserver/wps' ,  version = 
'1.0.0' ,  skip_caps = True ,  verbose = False )
wps.getcapabilities()
process_identifier = 'ras:Contour'
ComplexData()
input_data = dict ( data = filepath)
input_tupled = [(k,v)  for k,v  in input_data.items()]
print (input_tupled)
exec_obj = wps.execute(process.identifier,input_tupled, output = [( "result" ,  
False ,  'application/json' )])
monitorExecution(exec_obj)
for output  in exec_obj.processOutputs:
print (output.identifier)
print (output.data)
 
 
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to