[Mapserver-users] I have some landsat 7 data that I want to tile : overlap + transparency

Norman Vine nhv at cape.com
Fri Jan 30 21:35:47 EST 2004


Kralidis,Tom [Burlington] writes:
>
> Stephen Clark wrote:
> > 
> > Do you know of a WMS command that will produce an image ad a 
> > particular DPI?
> > 
> 
> No, anyone else got an idea here?

Following works with a UMN WMS

Note the CVS WMS is hardwired to a max of 2048x2048  pixels 

HTH

Norman


====  cut ====
#! /usr/bin/env python
"""
see http://www.sourceforge.net/projects/pyogclib
"""

from ogclib.WMSClient import WMSClient

dpi = 200

class myWMS(WMSClient):
    def __init__(self, url):
        self.online_resource = url
        
wms = myWMS("http://localhost/cgi-bin/mywms?map=mywms.map&")

layer = ("bathy",)
srs=4326
bbox = { 'minx': -180, 'miny': -90,  'maxx': 180, 'maxy': 90 }
width, height = (8*dpi, 4*dpi)

url = wms.online_resource
version = '1.1'
format = 'image/tiff'
filename = 'test.tif'

wms_response = wms.getMap(url, format, width, height, srs, bbox, layer, version=version)

fh = open(filename, 'wb')
fh.write(wms_response)
fh.close()





More information about the mapserver-users mailing list