/[thuban]/branches/WIP-pyshapelib-bramz/test/test_baserenderer.py
ViewVC logotype

Diff of /branches/WIP-pyshapelib-bramz/test/test_baserenderer.py

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

revision 2619 by jonathan, Fri May 6 14:19:03 2005 UTC revision 2712 by bernhard, Sun Oct 15 23:27:05 2006 UTC
# Line 1  Line 1 
1  # Copyright (C) 2003, 2005 by Intevation GmbH  # Copyright (C) 2003, 2005, 2006 by Intevation GmbH
2  # Authors:  # Authors:
3  # Bernhard Herzog <[email protected]>  # Bernhard Herzog <[email protected]>
4    # Bernhard Reiter <[email protected]>
5  #  #
6  # This program is free software under the GPL (>=v2)  # This program is free software under the GPL (>=v2)
7  # Read the file COPYING coming with the software for details.  # Read the file COPYING coming with the software for details.
# Line 14  __version__ = "$Revision$" Line 15  __version__ = "$Revision$"
15  import os  import os
16  import binascii  import binascii
17  import unittest  import unittest
18    import locale
19    
20    import localessupport
21  from mockgeo import SimpleShapeStore  from mockgeo import SimpleShapeStore
22  import support  import support
23  support.initthuban()  support.initthuban()
# Line 342  class TestBaseRenderer(unittest.TestCase Line 345  class TestBaseRenderer(unittest.TestCase
345                              (-24, 65, -23, 66), [0, 0], (20, 20), opts)                              (-24, 65, -23, 66), [0, 0], (20, 20), opts)
346              self.assertEquals(img_data, data)              self.assertEquals(img_data, data)
347    
348        def test_projected_raster_decimalcommalocale(self):
349            if not Thuban.Model.resource.has_gdal_support():
350                raise support.SkipTest("No gdal support")
351    
352            def _do_project_island():
353                """Project island.tif and return result."""
354                layer = RasterLayer("raster layer",
355                                    os.path.join("..", "Data", "iceland",
356                                                 "island.tif"))
357    
358                dc = MockDC(size = (10, 5))
359                renderer = SimpleRenderer(dc, map, 34, (800, 2250))
360    
361                projection = "+proj=latlong +to_meter=0.017453 +ellps=clrk66"
362                new_projection = "+proj=utm +zone=27 +ellps=clrk66"
363    
364                return renderer.projected_raster_layer(layer, \
365                                projection, new_projection, \
366                                (322003.1320390497, 6964094.1718668584, 876022.1891829354, 7460469.6276894147), [0, 0], (10,5), 1)
367    
368            oldlocale = localessupport.setdecimalcommalocale()
369            img_data2 = _do_project_island()
370            locale.setlocale(locale.LC_NUMERIC, oldlocale)
371    
372            img_data1 = _do_project_island()
373    
374            self.assertEquals(img_data1, img_data2)
375    
376      def test_raster_no_projection(self):      def test_raster_no_projection(self):
377          """Test BaseRenderer with raster layer and no projections          """Test BaseRenderer with raster layer and no projections
378    

Legend:
Removed from v.2619  
changed lines
  Added in v.2712

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26