Ignore:
Timestamp:
25/03/08 17:16:22 (12 years ago)
Author:
spascoe
Message:

Slowly improving gdal"

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

Legend:

Unmodified
Added
Removed
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/service/wms_gdal.py

    r3634 r3677  
    1212from ows_common.service.wms_iface import * 
    1313from ows_common.bbox_util import geoToPixel 
     14from osgeo import osr, gdal 
    1415 
    1516import Image 
     
    3940    def getWKT(self): 
    4041        """ 
    41         Because mapping between CRS codes and WKT format can be flakey in GDAL 
     42        Because mapping between CRS codes and WKT format can be flaky in GDAL 
    4243        this function allows the problem to be solved on a case-by-case basis. 
    4344         
     
    7273 
    7374    @ivar sourceCRS: The CRS of the data source. 
    74     @ivar warpCRS: A mapping of CRS itentifiers to WKT descriptions of 
     75    @ivar warpCRS: A mapping of CRS identifiers to WKT descriptions of 
    7576       CRSs that are supported for this ILayer via warping. 
    7677 
     
    104105        sr_dst = osr.SpatialReference(self.warpCRS[crs]) 
    105106 
    106         ct = osr.CoordinateTransformation(sr_srs, sr_dst) 
     107        ct = osr.CoordinateTransformation(sr_src, sr_dst) 
    107108 
    108         llx, lly = ct.TransformPoint(*src_bb[:2])[:2] 
    109         urx, ury = ct.TransformPoint(*src_bb[2:])[:2] 
     109        llx, lly = ct.TransformPoint(float(src_bb[0]), float(src_bb[1]))[:2] 
     110        urx, ury = ct.TransformPoint(float(src_bb[2]), float(src_bb[3]))[:2] 
    110111        return (llx, lly, urx, ury) 
    111112 
  • TI05-delivery/ows_framework/branches/ows_framework-refactor/ows_common/ows_common/test/test_wms_gdal.py

    r3635 r3677  
    5959        sr = osr.SpatialReference() 
    6060        sr.ImportFromEPSG(27700) 
    61         layer.warpCRS['EPSG:2770'] = sr.ExportToWkt() 
     61        layer.warpCRS['EPSG:27700'] = sr.ExportToWkt() 
    6262 
    6363        return layer 
Note: See TracChangeset for help on using the changeset viewer.