Ignore:
Timestamp:
28/03/08 11:02:54 (12 years ago)
Author:
spascoe
Message:

Test changes to GDAL code.

Location:
TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/test
Files:
2 added
1 edited

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/test/test_wms_gdal.py

    r3677 r3694  
    5353    def setUp(self): 
    5454        filename = resource_filename('ows_common.test', 'data/obs_gdal.png') 
    55         self.ds = StaticDataSource(filename) 
     55        self.globalDS = StaticDataSource(filename) 
     56        fn2 = resource_filename('ows_common.test', 'data/ukcip_rainfall.png') 
     57        self.ukDS = StaticDataSource(fn2) 
    5658 
    5759    def setupWarp(self): 
    58         layer = GDALLayer(self.ds) 
     60        layer = GDALLayer(self.ukDS) 
    5961        sr = osr.SpatialReference() 
    60         sr.ImportFromEPSG(27700) 
    61         layer.warpCRS['EPSG:27700'] = sr.ExportToWkt() 
     62        sr.ImportFromEPSG(4326) 
     63        layer.warpCRS['EPSG:4326'] = sr.ExportToWkt() 
    6264 
    6365        return layer 
    6466 
    6567    def test1(self): 
    66         layer = GDALLayer(self.ds) 
     68        layer = GDALLayer(self.globalDS) 
    6769        assert layer.crss == ['EPSG:4326'] 
    6870 
    6971    def test2(self): 
    70         layer = GDALLayer(self.ds) 
     72        layer = GDALLayer(self.globalDS) 
    7173        slab = layer.getSlab('EPSG:4326') 
    7274        assert slab.bbox == (-180.0, -90.0, 180.0, 90.0) 
    7375 
    7476    def test3(self): 
    75         layer = GDALLayer(self.ds) 
     77        layer = GDALLayer(self.globalDS) 
    7678        slab = layer.getSlab('EPSG:4326') 
    7779        img = slab.getImage((-10.0, 45.0, 5.0, 60.0), 100, 100) 
     
    8082    def test4(self): 
    8183        layer = self.setupWarp() 
    82         assert layer.crss == ['EPSG:4326', 'EPSG:27700'] 
     84        assert layer.crss == ['EPSG:27700', 'EPSG:4326'] 
    8385 
    8486    def test5(self): 
    8587        layer = self.setupWarp() 
    86         slab = layer.getSlab('EPSG:27700') 
    87          
     88        slab = layer.getSlab('EPSG:4326') 
     89        img = slab.getImage((-3.46, 55.08, 3.46, 61.08), 100, 100) 
     90        img.save('out2.png') 
Note: See TracChangeset for help on using the changeset viewer.