Hi Thomas,
I discovered that you can work around this if you download the
capabilities document and correct all the OnlineResource elements
locally - you can then load the static capabilities doc using the 'xml'
keyword and OWSLib will make the right getMap requests.
e.g.
capdoc=open('/home/dom/Downloads/vmap0', 'r').read()
wms=WebMapService('url', version='1.1.1', xml=capdoc)
img = wms.getmap(layers=['basic'],
styles=[''],
srs='EPSG:4326',
bbox=(0, 45, 45, 90),
size=(256, 256),
format='image/jpeg'
)
f=open('newfile.jpg', 'wb')
f.write(img.read())
f.close()
I still think it's a problem with the server though :)
Cheers,
Dom
On 28/03/11 16:06, [email protected] wrote:
Hi Thomas,
Thanks for the feedback. Much appreciated.
Okay - we'd better fix the NASA example...
In your example, as you point out it's the server OnlineResource which
is wrong - so it may be better to try and get this fixed at source?
Cheers,
Dominic
On 26/03/11 16:26, [email protected] wrote:
Hello list,
I'm doing some test with OWSlib http://gispython.org/owslib/docs/en/trunk/ and
I get some troubles.
In the doc, you can correct
['global_mosaic'].crsOptions with wms['global_mosaic'].crsOptions
The part below doesn't work.
It sends back "This server no longer provides full WMS services! " because
http://onearth.jpl.nasa.gov/ services have changed.
#####################################################################
img = wms.getmap( layers=['global_mosaic'],
styles=['visual_bright'],
srs='EPSG:4326',
bbox=(-112, 36, -106, 41),
size=(300, 250),
format='image/jpeg',
transparent=True
)
out = open('jpl_mosaic_visb.jpg', 'wb')
out.write(img.read())
out.close()
#####################################################################
My own sample doesn't work either e.g.
#####################################################################
wms = WebMapService('http://vmap0.tiles.osgeo.org/wms/vmap0', version='1.1.1')
img = wms.getmap(layers=['basic'],
styles=[''],
srs='EPSG:4326',
bbox=(0, 45, 45, 90),
size=(256, 256),
format='image/jpeg'
)
#####################################################################
It's because in
http://vmap0.tiles.osgeo.org/wms/vmap0?REQUEST=getCapabilities&VERSION=1.1.1&SERVICE=WMS
in OnlineResource, the xlink:href value is http://vmap0.tiles.osgeo.org/wms? when it
has to be http://vmap0.tiles.osgeo.org/wms/vmap0
Some ideas to add an option (already exist ?) that use
http://vmap0.tiles.osgeo.org/wms/vmap0 instead of the wrong url from
OnlineResource
Regards
ThomasG
GIS specialist
PS : I will give you more return about OWSlib docs in the next days.
--
Scanned by iCritical.
_______________________________________________
Community mailing list
[email protected]
http://lists.gispython.org/mailman/listinfo/community