[Portugal] Referência WFS num pedido WPS
Jorge de Jesus
jorge.mendesdejesus wur.nl
Terça-Feira, 25 de Setembro de 2012 - 01:28:29 PDT
Oi
Podes meter os logs no pasteBin (apache e pywps log) e o pedido feito,
assim pode ter uma melhor ideia do que se passa
Jorge
On 09/25/2012 10:24 AM, Luís de Sousa wrote:
> Olá outra vez,
>
> Acabei de experimentar com o código que puseste no PasteBin, em
> princípio consigo fazer a coisa assim, mas estou a receber o mesmo
> erro que anteriormente.
>
> Luís
>
>> 2012/9/24 Jorge de Jesus <jorge.mendesdejesus wur.nl>:
>>>
>>> Oi
>>>
>>> Estive a ver na pywps wiki e nao ha 1 exemplo de como fazer um pedido de
>>> referencia em XML usando POST.
>>>
>>> Se queres bons exemplos ve na pasta de /tests/requests do codigo do pywps
>>>
>>> Acho que o problema e' que estas a misturar um input de referencia con
>>> um input em XML.
>>>
>>> Um pedido usando uma referencia e' assim:
>>>
>>> http://pastebin.com/qrjxDhSn
>>>
>>> No teu caso basta:
>>> <wps:Reference
>>> xlink:href="http://myServer/cgi-bin/mapserv?map=/path/to/file.map">
>>>
>>> Depois o PyWPS vai buscar o URL e' melhor se codificare o URL
>>> (enquote_plus no http://docs.python.org/library/urllib.html)
>>>
>>> MAS Se tens de passar um pedido WFS tipo:
>>>
>>> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs"
>>> :
>>> <wfs:Query
>>> xmlns:feature="http://myServer/cgi-bin/mapserv?map=/path/to/file.map"
>>> typeName="myLayer">
>>>
>>>
>>> Vais ter de meter o pedido dentro do <ComplexData> ja que isto e' um
>>> conteudo em XML e o conteudo vai estar disponivel dentro do execute(), e
>>> teras de escrever umas linhas de codigo para enviar o pedido para o
>>> servidor WFS.
>>>
>>>
>>> Jorge
>>>
>>>
>>>
>>>
>>> On 09/24/2012 05:31 PM, Luís de Sousa wrote:
>>>> Olá a todos,
>>>>
>>>> Estou a usar o PyWPS e preciso de passar como argumento a alguns
>>>> processos uma referencia para um tema disponível por WFS. Para tal
>>>> estou a construir um pedido POST em xml, como o que segue em baixo.
>>>> Enviando este pedido estou a receber um "internal server error - 500".
>>>> Imagino que seja um problema com o PyWPS mas não estou inteiramente
>>>> certo que pedido estaja correcto, se alguém podes dar uma olhada
>>>> agradecia.
>>>>
>>>> Obrigado,
>>>>
>>>> Luís
>>>>
>>>> ###################################
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <wps:Execute service="WPS"version="1.0.0"language="en-CA"
>>>> xmlns:wps="http://www.opengis.net/wps/1.0.0"
>>>> xmlns:ows="http://www.opengis.net/ows/1.1"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>>> xsi:schemaLocation="http://www.opengis.net/wps/1.0.0/wpsExecute_request.xsd">
>>>>
>>>> <ows:Identifier>bufferProcess</ows:Identifier>
>>>>
>>>> <wps:DataInputs>
>>>>
>>>> <wps:Input>
>>>> <ows:Identifier>data</ows:Identifier>
>>>> <wps:Reference mimeType="text/xml; subtype=wfs-collection/1.0"
>>>> xlink:href="http://myServer/cgi-bin/mapserv?map=/path/to/file.map"
>>>> method="POST">
>>>> <wps:Body>
>>>> <wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs"
>>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WFS"
>>>> version="1.1.0" maxFeatures="1"
>>>> xsi:schemaLocation="http://www.opengis.net/wfs
>>>> http://schemas.opengis.net/wfs/1.1.0/wfs.xsd">
>>>> <wfs:Query
>>>> xmlns:feature="http://myServer/cgi-bin/mapserv?map=/path/to/file.map"
>>>> typeName="myLayer">
>>>> </wfs:Query>
>>>> </wfs:GetFeature>
>>>> </wps:Body>
>>>> </wps:Reference>
>>>> </wps:Input>
>>>>
>>>> <wps:Input>
>>>> <ows:Identifier>size</ows:Identifier>
>>>> <wps:Data>
>>>> <wps:LiteralData>1</wps:LiteralData>
>>>> </wps:Data>
>>>> </wps:Input>
>>>>
>>>> </wps:DataInputs>
>>>>
>>>> <wps:ResponseForm>
>>>> <wps:ResponseDocument lineage="true"
>>>> storeExecuteResponse="true" status="true">
>>>> </wps:ResponseDocument>
>>>> </wps:ResponseForm>
>>>>
>>>> </wps:Execute>
>>>> _______________________________________________
>>>> Portugal mailing list
>>>> Portugal lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/portugal
>>>>
>>>>
>>>
>>>
>>> --
>>> ISRIC - World Soil Information Post: PO box 353, 6700 AJ, Wageningen,
>>> The Netherlands Visiting Address: Droevendaalsesteeg 3, 6708 PB
>>> Wageningen (Bdg. 101), Office: C.013 Office Phone: +31 (0) 317 4 83715
>>> Mobile Phone: +31 (0) 613 9 06950 OpenPGPKey: 0xDEE898AB
>>>
>>>
>>> _______________________________________________
>>> Portugal mailing list
>>> Portugal lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/portugal
> _______________________________________________
> Portugal mailing list
> Portugal lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/portugal
>
>
--
ISRIC - World Soil Information Post: PO box 353, 6700 AJ, Wageningen,
The Netherlands Visiting Address: Droevendaalsesteeg 3, 6708 PB
Wageningen (Bdg. 101), Office: C.013 Office Phone: +31 (0) 317 4 83715
Mobile Phone: +31 (0) 613 9 06950 OpenPGPKey: 0xDEE898AB
More information about the Portugal
mailing list