Hi Dominici,

I checked out trunk and everything is ok. I'm checking against ArcGIS Server 
and Mapnik OGCServer. For the later I need to apply patch at 
http://trac.gispython.org/lab/ticket/206

I also checked example from Massimo and it is working perfectly here.

See you!


-----Mensaje original-----
De: Dominic Lowe [mailto:[email protected]]
Enviado el: miƩrcoles, 03 de febrero de 2010 14:24
Para: Clos Crespo, Manel
CC: [email protected]
Asunto: Re: [Community] Get Image using owslib

Hi Manel,

That is great - very much appreciated!

I have submitted your patch to the trunk in revision 1539 - I also made
a couple of modifications on top of your patch:

1) In wms.py: As you suggested, changed WMSCapabilitiesReader to also
use openURL (we should be using it wherever possible).

2) In util.py: Changed the name of 'open' to 'openit' so that there is
no potential conflict with the builtin python function 'open'.

I'd appreciate it if you could check out the trunk and make sure it all
still works as expected with your server.

Regards,

Dominic



On 03/02/10 11:28, [email protected] wrote:
> Hi Dominic,
>
> I've updated the ticket with a patch for your review.
>
> Perhaps WMSCapabilitiesReader could also use openURL instead of building its 
> own opener. "openURL" contains the same auth code now, and we will get 
> Exception parsing for free.
>
>
> -----Mensaje original-----
> De: Dominic Lowe [mailto:[email protected]]
> Enviado el: martes, 02 de febrero de 2010 17:42
> Para: Clos Crespo, Manel
> CC: [email protected]
> Asunto: Re: [Community] Get Image using owslib
>
> Hi Manel,
>
> Yes I opened a ticket:
> http://trac.gispython.org/lab/ticket/190
>
> But haven't got round to fixing it.. partly because I don't have access
> to a server to test it on.
>
> So if you are able to prepare a patch that would be very much appreciated!
>
> I guess there are two approaches you could take:
>
> The quickest/easiest way is probably to modify the wms code to use
> owslib.util.openURL except when accessing a secured WMS with username
> and password.
>
> The other option is to modify owslib.util.openURL to include the
> authorisation code from wms.py (and accept username and password), and
> then modify the wms code to use this, while also stripping out the
> authorisation  code from wms.py. This is probably the better solution
> as it would mean other services could benefit from the authorisation
> code but it would require more work and testing.
>
> Let me know if you run into any issues or have any questions.
>
> Thanks,
>
> Dominic
>
>
>
>
>
>
> On 02/02/10 12:43, [email protected] wrote:
>> Hi Dominic,
>>
>> I've checked out the trunk version of owslib and the error is still 
>> happening. Did you open a ticket on this issue?
>>
>> I can try to make a patch with the solution you suggested.
>>
>>
>>
>> -----Mensaje original-----
>> De: Dominic Lowe [mailto:[email protected]]
>> Enviado el: jueves, 01 de octubre de 2009 17:55
>> Para: [email protected]
>> CC: Clos Crespo, Manel
>> Asunto: Re: [Community] Get Image using owslib
>>
>> Hi Manel,
>>
>> Okay thanks - it is still a problem though as it should use the method from
>> the utils module (which allows with or without a "?")
>>
>> I just looked at the WMS code though and it's not as straightforward as
>> replacing the opening method - I'd forgotten the wms module has some extra
>> code to handle HTTP password authorization when opening urls. So this should
>> probably also be moved into the openURL method in the utils package (which
>> also solves the "?" problem).
>>
>> Thanks for bringing it to our attention - I'll make a ticket for this issue.
>>
>> Cheers
>> Dom
>>
>>
>>
>>
>> On Wednesday 30 September 2009 11:52:02 [email protected] wrote:
>>> Hi Dominic,
>>>
>>> The WMS server is internal. I was getting a 500 error from the server, so I
>>> printed the resulting url in wms.py and it was obvious that the '?' was
>>> missing. That solved the problem.
>>>
>>> I can test any new version or code if needed.
>>>
>>> Thanks!
>>>
>>>
>>> -----Mensaje original-----
>>> De: [email protected]
>>> [mailto:[email protected]] En nombre de Lowe, Dominic
>>> (STFC,RAL,SSTD) Enviado el: miƩrcoles, 30 de septiembre de 2009 12:10
>>> Para: gispython.org community projects; [email protected]
>>> Asunto: Re: [Community] Get Image using owslib
>>>
>>> Hi Manel
>>>
>>> This is probably a bug. There's now a more robust method in the utils
>>> package that should be used instead of self._open. I'll try and update the
>>> wms code when I get a chance (unless anyone else does first).
>>>
>>> Could you send me the WMS url please so I can test against it?
>>>
>>> Thanks,
>>> Dominic
>>>
>>>
>>> -----Original Message-----
>>> From: [email protected] on behalf of
>>> [email protected] Sent: Wed 30/09/2009 10:58
>>> To: [email protected]
>>> Subject: [Community] Get Image using owslib
>>>
>>> Hi,
>>>
>>> I just tried getting an image from a WMS server using owslib. It seems that
>>> line 227 in wms is missing '?' between the base_url and the parameter
>>> string (data) because in the examples found in the owslib website, the
>>> base_url does not contain the '?'.
>>>
>>> /usr/lib/python2.5/site-packages/OWSLib-0.3.1-py2.5.egg/owslib/wms.py
>>> 227:            u = self._open(base_url + data)
>>>
>>> changing to:
>>>               u = self._open(base_url + '?' + data)
>>>
>>> solves the problem. Is this a bug or should I add the '?' to the base_url?
>>>
>>> Thanks in advance!
>>>
>>> --
>>> Manel Clos
>>> _______________________________________________
>>> Community mailing list
>>> [email protected]
>>> http://lists.gispython.org/mailman/listinfo/community
>>>
>>> --
>>> Scanned by iCritical.
>>> _______________________________________________
>>> Community mailing list
>>> [email protected]
>>> http://lists.gispython.org/mailman/listinfo/community
>>> _______________________________________________
>>> Community mailing list
>>> [email protected]
>>> http://lists.gispython.org/mailman/listinfo/community
>>
>>
>

_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community

Reply via email to