Hi Goyo, I've modified the code in the owslib trunk now to better handle url encodings and the returned error.
However it is only a quick fix and I need to review it more thoroughly (this aspect needs reviewing throughout owslib). I had some success accessing your server, until the final getcoverage request which returns an error I don't understand: <?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?><!DOCTYPE ServiceExceptionReport SYSTEM "http://www.idee.es/wcs/dtd/exception_1_1_0.dtd"><ServiceExceptionReport version="1.1.0"><ServiceException code="InvalidFormat">Error al parsear la peticion XML: Start of root element expected.</ServiceException></ServiceExceptionReport> The code I used to test it (and the responses) was this: >>> from owslib.wcs import WebCoverageService >>> wcs=WebCoverageService('http://www.idee.es/wcs/IDEE-WCS-UTM30N/wcsServlet', version='1.0.0') >>> wcs.url 'http://www.idee.es/wcs/IDEE-WCS-UTM30N/wcsServlet' >>> wcs.version '1.0.0' >>> wcs.identification.service 'IDEE-WCS-UTM30N' >>> wcs.provider.name 'IAAA Laboratory, University of Zaragoza' >>> wcs.provider.contact.organization 'IAAA Laboratory, University of Zaragoza' >>> wcs.contents.keys() ['MDT25_peninsula_pendientes', 'MDT_peninsula_baleares_aspecto', 'MDT1000_peninsula_baleares', 'MDT500_peninsula_baleares', 'MDT_peninsula_baleares', 'MDT500_peninsula_baleares_pendientes', 'MDT1000_peninsula_baleares_pendientes', 'MDT_peninsula_baleares_pendientes', 'MDT25_peninsula_ZIP', 'MDT25_peninsula_aspecto', 'MDT500_peninsula_baleares_aspecto', 'MDT1000_peninsula_baleares_aspecto'] >>> cvg=wcs['MDT25_peninsula_pendientes'] >>> cvg.title 'MDT25 Pendientes Peninsula' >>> cvg.boundingBoxWGS84 (-8.7527311628, 35.8849011171, 3.6409641687000001, 43.7511638541) >>> cvg.timelimits [] >>> cvg.supportedFormats ['GeoTIFF', 'AsciiGrid', 'FloatGrid_Zip'] >>> cvg.supportedCRS ['EPSG:4326', 'EPSG:4230', 'EPSG:23028', 'EPSG:23029', 'EPSG:23030', 'EPSG:23031', 'EPSG:23030'] >>> output=wcs.getCoverage(identifier='MDT25_peninsula_pendientes',bbox=(-8,37,2,40), crs='EPSG:4326', format='GeoTIFF', resX=1, resY=1) >>> f=open('test.tif', 'wb') >>> f.write(output.read()) >>> f.close() If you look in the test.tif file you see the error. Does it mean anything to you? Regards Dom On Tuesday 19 May 2009 09:32:50 Dominic Lowe wrote: > Hi Goyo, > > I can take a look at this problem. However I'm a bit confused - the url > you sent [1] *does* have a question mark in it. Have I misunderstood > something? > > > Also invalid request urls raise an HTTPError with code=404 which is > > silently catched, resulting in call to log.debug raising a misleading > > AttributeError. > > That's not great - I'll look into raising better errors. > > Thanks > Dom > > On Monday 18 May 2009 19:16:39 Goyo wrote: > > Hi all, > > > > I'm having problems using owslib.wcs module. Some broken services (see > > [1] for an example) don't include question marks in urls and owslib > > builds invalid request urls. > > > > The WCS 1.0.0 specification[2] states that clients should be prepared to > > handle this broken behavoir: > > > > [Quote] > > For HTTP GET, the URL prefix must end in either a '?' (in the > > absence of additional server-specific parameters) or a '&'. In > > practice, however, Clients should be prepared to add a necessary > > trailing '?' or '&' before appending the Operation parameters > > defined in this specification in order to construct a valid > > request URL. > > [End quote] > > > > Also invalid request urls raise an HTTPError with code=404 which is > > silently catched, resulting in call to log.debug raising a misleading > > AttributeError. > > > > Best regards > > > > Goyo > > > > [1] > > http://www.idee.es/wcs/IDEE-WCS-UTM30N/wcsServlet?REQUEST=GetCapabilities > >&S ERVICE=WCS&VERSION=1.0.0&SECTION=/WCS_Capabilities/Capability > > > > [2] Web Coverage Service (WCS), Version 1.0.0 (Corrigendum) > > <http://portal.opengeospatial.org/files/?artifact_id=12582> > > > > _______________________________________________ > > 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
