Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge branch 'CLIMATE-970'
Browse files Browse the repository at this point in the history
  • Loading branch information
huikyole committed Oct 7, 2019
2 parents 2581d13 + 129bb0b commit d0c9f13
Show file tree
Hide file tree
Showing 5 changed files with 3 additions and 3 deletions.
Binary file modified ocw/shape/countries.dbf
100755 → 100644
Binary file not shown.
2 changes: 1 addition & 1 deletion ocw/shape/countries.prj
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1 +1 @@
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]
GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]]
Binary file modified ocw/shape/countries.shp
100755 → 100644
Binary file not shown.
Binary file modified ocw/shape/countries.shx
100755 → 100644
Binary file not shown.
4 changes: 2 additions & 2 deletions ocw/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def shapefile_boundary(boundary_type, region_names):
regions = []
shapefile_dir = os.sep.join([os.path.dirname(__file__), 'shape'])
map_read.readshapefile(os.path.join(shapefile_dir, boundary_type),
boundary_type, drawbounds=False)
boundary_type, drawbounds=False, default_encoding='latin-1')
# Note: The shapefile may contain countries or states with latin letters.
# Hence, the output of readshapefile can be a mix of ascii and unicode
# strings. Because python 2 and 3 treat them differently, we must
Expand All @@ -524,7 +524,7 @@ def shapefile_boundary(boundary_type, region_names):
for region_name in region_names:
region_name = _force_unicode(region_name)
for iregion, region_info in enumerate(map_read.countries_info):
country = _force_unicode(region_info['COUNTRY'], 'latin-1')
country = _force_unicode(region_info['NAME_EN'], 'latin-1')
if (country.replace(" ", "").lower() ==
region_name.replace(" ", "").lower()):
regions.append(np.array(map_read.countries[iregion]))
Expand Down

0 comments on commit d0c9f13

Please sign in to comment.