/[thuban]/branches/WIP-pyshapelib-bramz/Thuban/UI/renderer.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/Thuban/UI/renderer.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2570 by jonathan, Wed Feb 16 21:14:47 2005 UTC revision 2571 by jonathan, Fri Feb 18 14:54:17 2005 UTC
# Line 45  from types import StringType Line 45  from types import StringType
45    
46  from Thuban.version import versions  from Thuban.version import versions
47    
48    if Thuban.Model.resource.has_gdal_support():
49        from gdalwarp import ProjectRasterFile
50    
51    
52  # Map the strings used for the format parameter of the draw_raster_data  # Map the strings used for the format parameter of the draw_raster_data
53  # method to the appropriate wxWindows constants  # method to the appropriate wxWindows constants
# Line 108  class MapRenderer(BaseRenderer): Line 111  class MapRenderer(BaseRenderer):
111          return wxFont(int(round(self.resolution * 10)), wxSWISS, wxNORMAL,          return wxFont(int(round(self.resolution * 10)), wxSWISS, wxNORMAL,
112                        wxNORMAL)                        wxNORMAL)
113    
114        def projected_raster_layer(self, layer, srcProj, dstProj, extents,
115                                   resolution, dimensions, options):
116    
117            ret = None
118    
119            if Thuban.Model.resource.has_gdal_support():
120    
121                if versions['wxPython-tuple'] < (2,5,3):
122                    options = options | 4  # INVERT_MASK_BITS
123                    options = options & ~2 # ALPHA_MASK not supported
124    
125                try:
126                    ret = ProjectRasterFile(layer.GetImageFilename(),
127                                            srcProj, dstProj,
128                                            extents, resolution, dimensions,
129                                            options)
130                except (MemoryError, IOError, AttributeError, ValueError):
131                    # Why does this catch AttributeError and ValueError?
132                    # FIXME: The exception should be communicated to the user
133                    # better.
134                    traceback.print_exc()
135    
136            return ret
137    
138      def draw_raster_data(self, x,y, data, format = 'BMP'):      def draw_raster_data(self, x,y, data, format = 'BMP'):
139    
140          mask = None          mask = None

Legend:
Removed from v.2570  
changed lines
  Added in v.2571

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26