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

Index: basemap-1.0.5+dfsg/lib/mpl_toolkits/basemap/pyproj.py
===================================================================
--- basemap-1.0.5+dfsg.orig/lib/mpl_toolkits/basemap/pyproj.py
2012-08-06 19:26:00.000000000 +0200
+++ basemap-1.0.5+dfsg/lib/mpl_toolkits/basemap/pyproj.py
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')
+else:
+    pyproj_datadir = '/usr/share/basemap/data'

 set_datapath(pyproj_datadir)


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).

Cheers,

-- 
Sandro Tosi (aka morph, morpheus, matrixhasu)
My website: http://matrixhasu.altervista.org/
Me at Debian: http://wiki.debian.org/SandroTosi

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to