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
