Basemap - use BASEMAPDATA also in lib/mpl_toolkits/basemap/

while updating Basemap package in Debian, I noticed that
lib/mpl_toolkits/basemap/ could use the same BASEMAPDATA
variable handling as of lib/mpl_toolkits/basemap/ , so I'm
applying a patch like this:

Index: basemap-1.0.5+dfsg/lib/mpl_toolkits/basemap/


--- basemap-1.0.5+dfsg.orig/lib/mpl_toolkits/basemap/
2012-08-06 19:26:00.000000000 +0200
+++ basemap-1.0.5+dfsg/lib/mpl_toolkits/basemap/
2012-08-10 21:49:42.941275370 +0200
@@ -236,10 +236,14 @@
"sphere": {'a':6370997.0,'b':6370997.0,'description':"Normal Sphere"},

-pyproj_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
-if not os.path.isdir(pyproj_datadir):
- msg="proj data directory not found. Expecting it at: %s"%pyproj_datadir
- raise IOError(msg)
+# check to see if environment variable BASEMAPDATA set to a directory,
+# and if so look for the data there.
+if 'BASEMAPDATA' in os.environ:
+ pyproj_datadir = os.environ['BASEMAPDATA']
+ if not os.path.isdir(pyproj_datadir):
+ raise RuntimeError('Path in environment BASEMAPDATA not a directory')
+ pyproj_datadir = '/usr/share/basemap/data'


Maybe you can consider applying it upstream too (except for the part
of setting it to '/usr/share/basemap/data' in case no variable is
passed, it's a Debian specific change).


Sandro Tosi (aka morph, morpheus, matrixhasu)
My website:
Me at Debian: