This is an automated email from the ASF dual-hosted git repository. huikyole pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/climate.git
The following commit(s) were added to refs/heads/master by this push: new 129bb0b CLIMATE-970 - Fix dataset.Bounds issues with the latest Basemap new d0c9f13 Merge branch 'CLIMATE-970' 129bb0b is described below commit 129bb0b375d5fe9713251190c1f27a44d3f55fa2 Author: huikyole <huikyo....@jpl.nasa.gov> AuthorDate: Thu Oct 3 22:05:53 2019 -0700 CLIMATE-970 - Fix dataset.Bounds issues with the latest Basemap - countries shapefile has been replaced with files from naturalearthdata.com --- ocw/shape/countries.dbf | Bin 208900 -> 599487 bytes ocw/shape/countries.prj | 2 +- ocw/shape/countries.shp | Bin 31413360 -> 8800376 bytes ocw/shape/countries.shx | Bin 2220 -> 2140 bytes ocw/utils.py | 4 ++-- 5 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ocw/shape/countries.dbf b/ocw/shape/countries.dbf old mode 100755 new mode 100644 index 0ecd798..fd81215 Binary files a/ocw/shape/countries.dbf and b/ocw/shape/countries.dbf differ diff --git a/ocw/shape/countries.prj b/ocw/shape/countries.prj old mode 100755 new mode 100644 index f45cbad..b13a717 --- a/ocw/shape/countries.prj +++ b/ocw/shape/countries.prj @@ -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]] \ No newline at end of file +GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.017453292519943295]] \ No newline at end of file diff --git a/ocw/shape/countries.shp b/ocw/shape/countries.shp old mode 100755 new mode 100644 index 7d40398..c7f0020 Binary files a/ocw/shape/countries.shp and b/ocw/shape/countries.shp differ diff --git a/ocw/shape/countries.shx b/ocw/shape/countries.shx old mode 100755 new mode 100644 index a441100..8f9e0c8 Binary files a/ocw/shape/countries.shx and b/ocw/shape/countries.shx differ diff --git a/ocw/utils.py b/ocw/utils.py index 64050fe..df0324f 100755 --- a/ocw/utils.py +++ b/ocw/utils.py @@ -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 @@ -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]))