source: qesdi/geoplot/trunk/lib/geoplot/layer_drawer_coastline.py @ 5710

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/qesdi/geoplot/trunk/lib/geoplot/layer_drawer_coastline.py@5710
Revision 5710, 1.5 KB checked in by pnorton, 10 years ago (diff)

Cleaned up a the import statements for the geoplot modules, also fixed a couple of the tests.

Line 
1"""
2A layer drawer that instead of drawing the data to an image just draws the
3coastline (and optionally the rivers) at a specified resolution.
4"""
5
6import logging
7
8from geoplot.layer_drawer import LayerDrawerBase
9
10log = logging.getLogger(__name__)
11
12class LayerDrawerCoastlines(LayerDrawerBase):
13    """
14    Creates a layer image of the coastline for a given projection and resolution.
15    """
16   
17    def __init__(self, projection='latlon', resolution='i', transparent=False, drawRivers=False):
18       
19        LayerDrawerBase.__init__(self, transparent=transparent,
20                                 projection=projection,
21                                 resolution=resolution)
22       
23        # must be done after the base constructor or the _mapFactory won't be
24        # created
25        self._mapFactory.drawRivers = drawRivers
26
27    def _drawToAxes(self, axes, xLimits, yLimits):
28        """
29        Draws the coastline form the map onto the axes.
30        """
31       
32        map = self._getMap(xLimits, yLimits)
33       
34        #draw the map onto the axes
35        map.drawMap(axes)
36       
37        #map.basemap.fillcontinents(color='coral',lake_color='aqua', ax=axes)
38        #map.basemap.bluemarble(ax=axes)
39
40    def __set_drawRivers(self, value):
41        self._mapFactory.drawRivers = value
42       
43    def __get_drawRivers(self):
44        return self._mapFactory.drawRivers
45   
46    drawRivers = property(__get_drawRivers, __set_drawRivers)   
47     
48               
49
50   
51       
Note: See TracBrowser for help on using the repository browser.