[OWSLib-devel] [owslib-users] Bug in owslib?

Christopher Eykamp christopher.eykamp at tudor.lu
Tue Sep 10 04:18:55 PDT 2013


Hi Luca,

Yes, of course I can.  My main goal in contacting you was 1) to make 
sure my local modification was correct, and 2) alert you to the issue.

Both of those goals have now been achieved.

Thanks!

Chris

PS Would you please let me know when you do push the updated code, so I 
know when it is safe to delete my local patch file.




On 2013-09-09 23:42, Cinquini, Luca (3980) wrote:
> Hi Chris,
> ok - I think you are right: when parsing the output, the element is 
> called "LiteralOutput" and not "LiteralData".
>
> I can make the change in the Git repo (any objections ?), although I 
> just realized that a few tests are already not working, and it would 
> be good to fix them before I make any changes. Can you work with a 
> modified local copy for the time being ?
>
> thanks for reporting this,
> Luca
>
> On Sep 9, 2013, at 6:56 AM, Christopher Eykamp wrote:
>
>> Hi Luca,
>>
>> Thank you for your reply.  First off, you are right that I meant 
>> DescribeProcess.  My mind is ajumble with WxS soup. It's easy to get 
>> mixed up!
>>
>> I have a test service, implemented in pyWPS.  If I make the following 
>> request:
>>
>> http://wps.iguess.tudor.lu/cgi-bin/pywps.cgi?SERVICE=WPS&VERSION=1.0.0&REQUEST=DescribeProcess&identifier=test_rand_map
>>
>> I get back the following XML (excerpted):
>>
>> <Output>
>> <ows:Identifier>num</ows:Identifier>
>> <ows:Title>A sample literal output.</ows:Title>
>> <LiteralOutput>
>> <ows:DataType 
>> ows:reference="http://www.w3.org/TR/xmlschema-2/#integer">integer</ows:DataType>
>> </LiteralOutput>
>> </Output>
>>
>> A copy of the full output is available here:
>>
>> http://pastebin.com/JFB603TD
>>
>> This would suggest either a problem with pyWPS or owslib.
>>
>> Chris
>>
>>
>> On 2013-09-07 00:32, Cinquini, Luca (3980) wrote:
>>> Hi Chris,
>>> 	it's been a while since I used the WPS client, so I might be totally wrong here, but...
>>>
>>> First of all, are you referring to the output of a WPS DescribeProcess request (not "DescribeCoverage") ? If so, I think the output contains "LiteralData" elements, not "LiteralOutput", for example you can run the following request straight out of the OWSlib package (see below). I don't see any "LiteralOutput" tag... But off course I could be wrong, in which case can you send an example request and response ?
>>>
>>> thanks a lot,
>>> Luca
>>>
>>> ==================================================================================================================
>>>
>>> brelay5:examples cinquini$ python wps-client.py -uhttp://rsg.pml.ac.uk/wps/vector.cgi  -r DescribeProcess -i v.mkgrid -v
>>> ARGV      : ['-u', 'http://rsg.pml.ac.uk/wps/vector.cgi', '-r', 'DescribeProcess', '-i', 'v.mkgrid', '-v']
>>> OPTIONS   : [('-u', 'http://rsg.pml.ac.uk/wps/vector.cgi'), ('-r', 'DescribeProcess'), ('-i', 'v.mkgrid'), ('-v', '')]
>>> http://rsg.pml.ac.uk/wps/vector.cgi?identifier=v.mkgrid&version=1.0.0&request=DescribeProcess&service=WPS
>>> <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
>>> <ns0:ProcessDescriptions xmlns:ns0="http://www.opengis.net/wps/1.0.0"  xmlns:ows="http://www.opengis.net/ows/1.1"  xmlns:xlink="http://www.w3.org/1999/xlink"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  service="WPS" version="1.0.0" xsi:schemaLocation="http://www.opengis.net/wps/1.0.0 http://schemas.opengis.net/wps/1.0.0/wpsDescribeProcess_response.xsd"  xml:lang="en-CA">
>>>      <ProcessDescription statusSupported="true" storeSupported="true" ns0:processVersion="1">
>>>          <ows:Identifier>v.mkgrid</ows:Identifier>
>>>          <ows:Title>Creates a vector map of a user-defined grid.</ows:Title>
>>>          <ows:Abstract>http://grass.osgeo.org/grass70/manuals/html70_user/v.mkgrid.html</ows:Abstract>
>>>          <ows:Metadata xlink:href="http://earthserver.pml.ac.uk/wps/vector.cgi?service=WPS&request=DescribeProcess&version=1.0.0&identifier=v.mkgrid"  xlink:title="vector" />
>>>          <ows:Metadata xlink:href="http://earthserver.pml.ac.uk/wps/vector.cgi?service=WPS&request=DescribeProcess&version=1.0.0&identifier=v.mkgrid"  xlink:title="geometry" />
>>>          <DataInputs>
>>>              <Input maxOccurs="2" minOccurs="0">
>>>                  <ows:Identifier>box</ows:Identifier>
>>>                  <ows:Title>Width and height of boxes in grid</ows:Title>
>>>                  <LiteralData>
>>>                      <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#float">float</ows:DataType>
>>>                      <ows:AnyValue />
>>>                  </LiteralData>
>>>              </Input>
>>>              <Input maxOccurs="2" minOccurs="0">
>>>                  <ows:Identifier>coor</ows:Identifier>
>>>                  <ows:Title>Lower left easting and northing coordinates of map</ows:Title>
>>>                  <LiteralData>
>>>                      <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#float">float</ows:DataType>
>>>                      <ows:AnyValue />
>>>                  </LiteralData>
>>>              </Input>
>>>              <Input maxOccurs="1" minOccurs="0">
>>>                  <ows:Identifier>angle</ows:Identifier>
>>>                  <ows:Title>Angle of rotation (in degrees counter-clockwise)</ows:Title>
>>>                  <LiteralData>
>>>                      <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#float">float</ows:DataType>
>>>                      <ows:AnyValue />
>>>                      <DefaultValue>0.0</DefaultValue>
>>>                  </LiteralData>
>>>              </Input>
>>>              <Input maxOccurs="1" minOccurs="0">
>>>                  <ows:Identifier>breaks</ows:Identifier>
>>>                  <ows:Title>Number of horizontal vertex points per grid cell</ows:Title>
>>>                  <LiteralData>
>>>                      <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#integer">integer</ows:DataType>
>>>                      <ows:AnyValue />
>>>                      <DefaultValue>3</DefaultValue>
>>>                  </LiteralData>
>>>              </Input>
>>>              <Input maxOccurs="2" minOccurs="2">
>>>                  <ows:Identifier>grid</ows:Identifier>
>>>                  <ows:Title>Number of rows and columns in grid</ows:Title>
>>>                  <LiteralData>
>>>                      <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#integer">integer</ows:DataType>
>>>                      <ows:AnyValue />
>>>                  </LiteralData>
>>>              </Input>
>>>              <Input maxOccurs="1" minOccurs="0">
>>>                  <ows:Identifier>-p</ows:Identifier>
>>>                  <ows:Title>Create grid of points instead of areas and centroids</ows:Title>
>>>                  <LiteralData>
>>>                      <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#boolean">boolean</ows:DataType>
>>>                      <ows:AllowedValues>
>>>                              <ows:Value>True</ows:Value>
>>>                              <ows:Value>False</ows:Value>
>>>                      </ows:AllowedValues>
>>>                      <DefaultValue>False</DefaultValue>
>>>                  </LiteralData>
>>>              </Input>
>>>              <Input maxOccurs="1" minOccurs="0">
>>>                  <ows:Identifier>position</ows:Identifier>
>>>                  <ows:Title>Where to place the grid</ows:Title>
>>>                  <LiteralData>
>>>                      <ows:DataType ows:reference="http://www.w3.org/TR/xmlschema-2/#string">string</ows:DataType>
>>>                      <ows:AllowedValues>
>>>                              <ows:Value>region</ows:Value>
>>>                              <ows:Value>coor</ows:Value>
>>>                      </ows:AllowedValues>
>>>                      <DefaultValue>region</DefaultValue>
>>>                  </LiteralData>
>>>              </Input>
>>>          </DataInputs>
>>>          <ProcessOutputs>
>>>              <Output>
>>>                  <ows:Identifier>map</ows:Identifier>
>>>                  <ows:Title>Name for output vector map</ows:Title>
>>>                  <ComplexOutput>
>>>                      <Default>
>>>                          <Format>
>>>                              <MimeType>text/xml</MimeType>
>>>                              <Encoding>UTF-8</Encoding>
>>>                              <Schema>http://schemas.opengis.net/gml/3.1.1/base/gml.xsd</Schema>
>>>                          </Format>
>>>                      </Default>
>>>                      <Supported>
>>>                          <Format>
>>>                              <MimeType>text/xml</MimeType>
>>>                              <Encoding>UTF-8</Encoding>
>>>                              <Schema>http://schemas.opengis.net/gml/3.1.1/base/gml.xsd</Schema>
>>>                          </Format>
>>>                          <Format>
>>>                              <MimeType>application/xml</MimeType>
>>>                              <Encoding>UTF-8</Encoding>
>>>                              <Schema>http://schemas.opengis.net/gml/3.1.1/base/gml.xsd</Schema>
>>>                          </Format>
>>>                          <Format>
>>>                              <MimeType>text/xml</MimeType>
>>>                              <Encoding>UTF-8</Encoding>
>>>                              <Schema>http://schemas.opengis.net/gml/2.1.2/feature.xsd</Schema>
>>>                          </Format>
>>>                          <Format>
>>>                              <MimeType>application/xml</MimeType>
>>>                              <Encoding>UTF-8</Encoding>
>>>                              <Schema>http://schemas.opengis.net/gml/2.1.2/feature.xsd</Schema>
>>>                          </Format>
>>>                          <Format>
>>>                              <MimeType>text/xml</MimeType>
>>>                              <Encoding>UTF-8</Encoding>
>>>                              <Schema>http://schemas.opengis.net/kml/2.2.0/ogckml22.xsd</Schema>
>>>                          </Format>
>>>                      </Supported>
>>>                  </ComplexOutput>
>>>              </Output>
>>>          </ProcessOutputs>
>>>      </ProcessDescription>
>>> </ns0:ProcessDescriptions>
>>>   <class 'owslib.wps.Process'> : {'identifier': 'v.mkgrid', 'verbose': True, 'title': 'Creates a vector map of a user-defined grid.', '_root': <Element 'ProcessDescription' at 0x1007b1f10>, 'statusSupported': True, 'storeSupported': True, 'processVersion': None, 'abstract': 'http://grass.osgeo.org/grass70/manuals/html70_user/v.mkgrid.html'}
>>> 	Input:  <class 'owslib.wps.Input'> : {'minOccurs': 0, 'title': 'Width and height of boxes in grid', 'dataType': '//www.w3.org/TR/xmlschema-2/#float', 'defaultValue': None, 'supportedValues': [], 'allowedValues': ['AnyValue'], 'maxOccurs': 2, 'identifier': 'box'}
>>> 	Input:  <class 'owslib.wps.Input'> : {'minOccurs': 0, 'title': 'Lower left easting and northing coordinates of map', 'dataType': '//www.w3.org/TR/xmlschema-2/#float', 'defaultValue': None, 'supportedValues': [], 'allowedValues': ['AnyValue'], 'maxOccurs': 2, 'identifier': 'coor'}
>>> 	Input:  <class 'owslib.wps.Input'> : {'minOccurs': 0, 'title': 'Angle of rotation (in degrees counter-clockwise)', 'dataType': '//www.w3.org/TR/xmlschema-2/#float', 'defaultValue': '0.0', 'supportedValues': [], 'allowedValues': ['AnyValue'], 'maxOccurs': 1, 'identifier': 'angle'}
>>> 	Input:  <class 'owslib.wps.Input'> : {'minOccurs': 0, 'title': 'Number of horizontal vertex points per grid cell', 'dataType': '//www.w3.org/TR/xmlschema-2/#integer', 'defaultValue': '3', 'supportedValues': [], 'allowedValues': ['AnyValue'], 'maxOccurs': 1, 'identifier': 'breaks'}
>>> 	Input:  <class 'owslib.wps.Input'> : {'minOccurs': 2, 'title': 'Number of rows and columns in grid', 'dataType': '//www.w3.org/TR/xmlschema-2/#integer', 'defaultValue': None, 'supportedValues': [], 'allowedValues': ['AnyValue'], 'maxOccurs': 2, 'identifier': 'grid'}
>>> 	Input:  <class 'owslib.wps.Input'> : {'minOccurs': 0, 'title': 'Create grid of points instead of areas and centroids', 'dataType': '//www.w3.org/TR/xmlschema-2/#boolean', 'defaultValue': 'False', 'supportedValues': [], 'allowedValues': ['True', 'False'], 'maxOccurs': 1, 'identifier': '-p'}
>>> 	Input:  <class 'owslib.wps.Input'> : {'minOccurs': 0, 'title': 'Where to place the grid', 'dataType': '//www.w3.org/TR/xmlschema-2/#string', 'defaultValue': 'region', 'supportedValues': [], 'allowedValues': ['region', 'coor'], 'maxOccurs': 1, 'identifier': 'position'}
>>> 	Output:  <class 'owslib.wps.Output'> : {'mimeType': None, 'reference': None, 'title': 'Name for output vector map', 'dataType': 'ComplexData', 'defaultValue': <owslib.wps.ComplexData object at 0x1007b96d0>, 'supportedValues': [<owslib.wps.ComplexData object at 0x1007b9450>, <owslib.wps.ComplexData object at 0x1007b9590>, <owslib.wps.ComplexData object at 0x1007b9610>, <owslib.wps.ComplexData object at 0x1007b9690>, <owslib.wps.ComplexData object at 0x1007b9650>], 'allowedValues': [], 'identifier': 'map', 'data': []}
>>> WPS Process: identifier=v.mkgrid
>>> WPS Process: title=Creates a vector map of a user-defined grid.
>>> WPS Process: abstract=http://grass.osgeo.org/grass70/manuals/html70_user/v.mkgrid.html
>>> Process input: identifier=box, data type=//www.w3.org/TR/xmlschema-2/#float, minOccurs=0, maxOccurs=2
>>> Process input: identifier=coor, data type=//www.w3.org/TR/xmlschema-2/#float, minOccurs=0, maxOccurs=2
>>> Process input: identifier=angle, data type=//www.w3.org/TR/xmlschema-2/#float, minOccurs=0, maxOccurs=1
>>> Process input: identifier=breaks, data type=//www.w3.org/TR/xmlschema-2/#integer, minOccurs=0, maxOccurs=1
>>> Process input: identifier=grid, data type=//www.w3.org/TR/xmlschema-2/#integer, minOccurs=2, maxOccurs=2
>>> Process input: identifier=-p, data type=//www.w3.org/TR/xmlschema-2/#boolean, minOccurs=0, maxOccurs=1
>>> Process input: identifier=position, data type=//www.w3.org/TR/xmlschema-2/#string, minOccurs=0, maxOccurs=1
>>> Process output: identifier=map, data type=ComplexData
>>>
>>>
>>> On Sep 6, 2013, at 9:15 AM, Tom Kralidis wrote:
>>>
>>>> Hi Chris: FYI looks like this got sent to the old OWSLib sourceforge mailing list (which I should turn off).  I've cc'dowslib-devel at lists.osgeo.org, which is the list we are currently using (more info athttp://lists.osgeo.org/mailman/listinfo/owslib-devel).
>>>>
>>>> I'm guessing Luca may have some comments per below.
>>>>
>>>> ..Tom
>>>>
>>>>
>>>> Date: Fri, 6 Sep 2013 16:17:12 +0200
>>>> From:christopher.eykamp at tudor.lu
>>>> To:owslib-users at lists.sourceforge.net
>>>> Subject: [owslib-users] Bug in owslib?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>     Hello,
>>>>
>>>>
>>>>
>>>>     I sent this query to the owslib-devel list  a few weeks ago, and got
>>>>     no response.  I'm trying again here.  I've fixed this in my local
>>>>     copy of owslib, but want some reaffirmation that it is actually a
>>>>     bug, and that my fix makes sense.
>>>>
>>>>
>>>>
>>>>     Thanks,
>>>>
>>>>
>>>>
>>>>     Chris
>>>>
>>>>
>>>>
>>>>     -------------------
>>>>
>>>>
>>>>
>>>>     I found what might be a bug in owslib, and want to confirm it.
>>>>     Fortunately, if I am correct, it is a trivial fix.
>>>>
>>>>
>>>>
>>>>     So this is the issue:
>>>>
>>>>
>>>>
>>>>     I *think* that when parsing the results
>>>>     of a WPS DescribeCoverage request, literal outputs are included in
>>>>     the LiteralOutput tag. owslib seems to be looking for the
>>>>     LiteralData tag, which is used in the input.
>>>>
>>>>
>>>>
>>>>     So the fix would be to replace
>>>>
>>>>
>>>>
>>>>     self._parseLiteralData(outputElement, 'LiteralData')
>>>>
>>>>
>>>>
>>>>     with
>>>>
>>>>
>>>>
>>>>     self._parseLiteralData(outputElement, 'LiteralOutput')
>>>>
>>>>
>>>>
>>>>     in wps.py, line c. 979.
>>>>
>>>>
>>>>
>>>>     I can be more specific if there is consensus that this is indeed a
>>>>     problem.
>>>>
>>>>
>>>>
>>>>     Thanks!
>>>>
>>>>
>>>>
>>>>     Chris
>>>>
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
>>>> Discover the easy way to master current and previous Microsoft technologies
>>>> and advance your career. Get an incredible 1,500+ hours of step-by-step
>>>> tutorial videos with LearnDevNow. Subscribe today and save!
>>>> http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
>>>> _______________________________________________
>>>> owslib-users mailing list
>>>> owslib-users at lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/owslib-users  		 	   		
>>>> _______________________________________________
>>>> OWSLib-devel mailing list
>>>> OWSLib-devel at lists.osgeo.org
>>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/owslib-devel
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/owslib-devel/attachments/20130910/c56f3fe9/attachment-0001.html>


More information about the OWSLib-devel mailing list