Skip to content

Commit 84ddf45

Browse files
committed
Added epsg file in basemap's data folder.
TODO: add license file regarding epsg, based on terms of use, which are found here: http://www.epsg.org/TermsOfUse.aspx
1 parent 33b94d1 commit 84ddf45

File tree

2 files changed

+10229
-24
lines changed

2 files changed

+10229
-24
lines changed

lib/mpl_toolkits/basemap/__init__.py

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -149,30 +149,7 @@
149149
}
150150

151151
# create dictionary that maps epsg codes to Basemap kwargs.
152-
if hasattr(pyproj, 'datadir'): # pyproj version 2+
153-
epsgf = os.path.join(pyproj.datadir.get_data_dir(), 'epsg')
154-
if not os.path.isfile(epsgf):
155-
raise_exception = (
156-
FileNotFoundError if sys.version_info[0] == 3 else RuntimeError
157-
)
158-
if os.name == 'posix':
159-
epsgf = os.environ.get('PROJ_LIB', '/usr/share/proj')
160-
elif 'PROJ_LIB' in os.environ:
161-
epsgf = os.environ['PROJ_LIB']
162-
else:
163-
raise raise_exception(
164-
("Cannot find '%s'," % epsgf)
165-
+ " and PROJ_LIB environment variable is not set."
166-
)
167-
epsgf = os.path.join(epsgf, 'epsg')
168-
if not os.path.isfile(epsgf):
169-
raise raise_exception(
170-
("Cannot find '%s'," % epsgf)
171-
+ " nor epsg file under pyproj's internal datadir."
172-
)
173-
else: # older versions of pyproj
174-
epsgf = os.path.join(pyproj.pyproj_datadir, 'epsg')
175-
epsgf = open(epsgf)
152+
epsgf = open(os.path.join(basemap_datadir, 'epsg'))
176153
epsg_dict={}
177154
for line in epsgf:
178155
if line.startswith("#"):

0 commit comments

Comments
 (0)