Skip to content

Commit f8d7ba3

Browse files
committed
Allow relocation of pyproj data files just like the rest of basemap's data files (mirrors code in mpl_toolkits/basemap/__init__.py)
1 parent e353bf2 commit f8d7ba3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/mpl_toolkits/basemap/pyproj.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,11 @@
235235
"sphere": {'a':6370997.0,'b':6370997.0,'description':"Normal Sphere"},
236236
}
237237

238-
pyproj_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
238+
if 'BASEMAPDATA' in os.environ:
239+
pyproj_datadir = os.environ['BASEMAPDATA']
240+
else:
241+
pyproj_datadir = os.sep.join([os.path.dirname(__file__), 'data'])
242+
239243
if not os.path.isdir(pyproj_datadir):
240244
msg="proj data directory not found. Expecting it at: %s"%pyproj_datadir
241245
raise IOError(msg)

0 commit comments

Comments
 (0)