Revision: 7938
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=7938&view=rev
Author:   jswhit
Date:     2009-11-04 20:22:35 +0000 (Wed, 04 Nov 2009)

Log Message:
-----------
don't try to create _geoslib Polygon instances if resolution=None

Modified Paths:
--------------
    trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py

Modified: trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py
===================================================================
--- trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-11-04 
17:53:25 UTC (rev 7937)
+++ trunk/toolkits/basemap/lib/mpl_toolkits/basemap/__init__.py 2009-11-04 
20:22:35 UTC (rev 7938)
@@ -805,15 +805,16 @@
         # currently only used in is_land method.
         self.landpolygons=[]
         self.lakepolygons=[]
-        #self.islandinlakepolygons=[]
-        #self.lakeinislandinlakepolygons=[]
-        x, y = zip(*self.coastpolygons)
-        for x,y,type in zip(x,y,self.coastpolygontypes):
-            b = np.asarray([x,y]).T
-            if type == 1: self.landpolygons.append(_geoslib.Polygon(b))
-            if type == 2: self.lakepolygons.append(_geoslib.Polygon(b))
-            #if type == 3: 
self.islandinlakepolygons.append(_geoslib.Polygon(b))
-            #if type == 4: 
self.lakeinislandinlakepolygons.append(_geoslib.Polygon(b))
+        if resolution is not None:
+            #self.islandinlakepolygons=[]
+            #self.lakeinislandinlakepolygons=[]
+            x, y = zip(*self.coastpolygons)
+            for x,y,type in zip(x,y,self.coastpolygontypes):
+                b = np.asarray([x,y]).T
+                if type == 1: self.landpolygons.append(_geoslib.Polygon(b))
+                if type == 2: self.lakepolygons.append(_geoslib.Polygon(b))
+                #if type == 3: 
self.islandinlakepolygons.append(_geoslib.Polygon(b))
+                #if type == 4: 
self.lakeinislandinlakepolygons.append(_geoslib.Polygon(b))
 
     # set __init__'s docstring
     __init__.__doc__ = _Basemap_init_doc
@@ -1558,6 +1559,7 @@
         the GSHHS coastline polygons associated with the class instance.
         Points over lakes inside land regions are not counted as land points.
         """
+        if resolution is None: return None
         landpt = False
         for poly in self.landpolygons:
             landpt = _geoslib.Point((xpt,ypt)).within(poly)


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to