This is an automated email from the git hooks/post-receive script. sebastic pushed a commit to branch master in repository mapproxy.
commit 919c901d802f406a95aa00eca33c2c48bc2c97d0 Author: Bas Couwenberg <[email protected]> Date: Fri Jul 7 15:55:11 2017 +0200 New upstream version 1.10.3 --- CHANGES.txt | 9 +++++++++ doc/conf.py | 2 +- mapproxy/image/mask.py | 3 +++ mapproxy/image/transform.py | 6 +++++- mapproxy/test/unit/test_conf_loader.py | 20 ++++++++++++++++++-- mapproxy/util/geom.py | 3 +-- setup.py | 2 +- 7 files changed, 38 insertions(+), 7 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index ca91d31..df94dbe 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,12 @@ +1.10.3 2017-07-07 +~~~~~~~~~~~~~~~~~ + +Fixes: + +- Fix crash during clipping +- Fix bilinear/bicubic resampling from cropped source +- Fix loading empty coverages + 1.10.2 2017-06-21 ~~~~~~~~~~~~~~~~~ diff --git a/doc/conf.py b/doc/conf.py index cb05ca7..6dd6f5d 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -51,7 +51,7 @@ copyright = u'Oliver Tonnhofer, Omniscale' # The short X.Y version. version = '1.10' # The full version, including alpha/beta/rc tags. -release = '1.10.2' +release = '1.10.3' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/mapproxy/image/mask.py b/mapproxy/image/mask.py index a98e1dc..26238e5 100644 --- a/mapproxy/image/mask.py +++ b/mapproxy/image/mask.py @@ -62,6 +62,9 @@ def image_mask_from_geom(size, bbox, polygons): # little bit smaller polygon does not include touched pixels outside coverage buffered = p.buffer(buffer, resolution=1, join_style=2) + if buffered.is_empty: # can be empty after negative buffer + continue + if buffered.type == 'MultiPolygon': # negative buffer can turn polygon into multipolygon for p in buffered: diff --git a/mapproxy/image/transform.py b/mapproxy/image/transform.py index 1a956ad..ba7ec2e 100644 --- a/mapproxy/image/transform.py +++ b/mapproxy/image/transform.py @@ -190,7 +190,11 @@ def img_for_resampling(img, resampling): resampling = image_filter[resampling] if img.mode == 'P' and resampling != Image.NEAREST: img.load() # load to get actual palette mode - img = img.convert(img.palette.mode) + if img.palette is not None: + # palette can still be None for cropped images + img = img.convert(img.palette.mode) + else: + img = img.convert('RGBA') return img def griddify(quad, steps): diff --git a/mapproxy/test/unit/test_conf_loader.py b/mapproxy/test/unit/test_conf_loader.py index af39c9d..b0fdc50 100644 --- a/mapproxy/test/unit/test_conf_loader.py +++ b/mapproxy/test/unit/test_conf_loader.py @@ -30,8 +30,8 @@ from mapproxy.cache.tile import TileManager from mapproxy.seed.spec import validate_seed_conf from mapproxy.test.helper import TempFile from mapproxy.test.unit.test_grid import assert_almost_equal_bbox +from mapproxy.util.geom import EmptyGeometryError from nose.tools import eq_, assert_raises -from nose.plugins.skip import SkipTest class TestLayerConfiguration(object): def _test_conf(self, yaml_part): @@ -925,7 +925,7 @@ class TestImageOptions(object): conf.globals.image_options.image_opts({}, 'image/jpeg') -class TestLoadCoverage(object): +class TestCoverageValidation(object): def test_union(self): conf = { 'coverages': { @@ -942,3 +942,19 @@ class TestLoadCoverage(object): assert informal_only assert len(errors) == 1 eq_(errors[0], "unknown 'unknown' in coverages.covname.union[1]") + + +class TestLoadCoverage(object): + def test_load_empty_geojson(self): + with TempFile() as tf: + with open(tf, 'wb') as f: + f.write('{"type": "FeatureCollection", "features": []}') + conf = {'datasource': tf, 'srs': 'EPSG:4326'} + assert_raises(EmptyGeometryError, load_coverage, conf) + + def test_load_empty_geojson_ogr(self): + with TempFile() as tf: + with open(tf, 'wb') as f: + f.write('{"type": "FeatureCollection", "features": []}') + conf = {'datasource': tf, 'where': '0 != 1', 'srs': 'EPSG:4326'} + assert_raises(EmptyGeometryError, load_coverage, conf) diff --git a/mapproxy/util/geom.py b/mapproxy/util/geom.py index f6e8c8d..21ce047 100644 --- a/mapproxy/util/geom.py +++ b/mapproxy/util/geom.py @@ -171,8 +171,7 @@ def load_polygon_lines(line_iter, source='<string>'): def build_multipolygon(polygons, simplify=False): if not polygons: - p = shapely.geometry.Polygon() - return p.bounds, p + raise EmptyGeometryError('no polygons') if len(polygons) == 1: geom = polygons[0] diff --git a/setup.py b/setup.py index 7ec76d5..5515279 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ def long_description(changelog_releases=10): setup( name='MapProxy', - version="1.10.2", + version="1.10.3", description='An accelerating proxy for web map services', long_description=long_description(7), author='Oliver Tonnhofer', -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/mapproxy.git _______________________________________________ Pkg-grass-devel mailing list [email protected] http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel

