From eac133952ce87aad32187aec9fe0ef83f5415209 Mon Sep 17 00:00:00 2001 From: Hermann Kraus Date: Tue, 20 Mar 2012 23:12:39 +0100 Subject: [PATCH] Add line-offset test. --- tests/visual_tests/data/line-offset.osm | 435 ++++++++++++++++++++++ tests/visual_tests/styles/line-offset.xml | 29 ++ tests/visual_tests/test.py | 9 +- 3 files changed, 471 insertions(+), 2 deletions(-) create mode 100644 tests/visual_tests/data/line-offset.osm create mode 100644 tests/visual_tests/styles/line-offset.xml diff --git a/tests/visual_tests/data/line-offset.osm b/tests/visual_tests/data/line-offset.osm new file mode 100644 index 000000000..9a568dc30 --- /dev/null +++ b/tests/visual_tests/data/line-offset.osm @@ -0,0 +1,435 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/visual_tests/styles/line-offset.xml b/tests/visual_tests/styles/line-offset.xml new file mode 100644 index 000000000..ed738555d --- /dev/null +++ b/tests/visual_tests/styles/line-offset.xml @@ -0,0 +1,29 @@ + + + + + My Style + + osm + ../data/line-offset.osm + + + + + \ No newline at end of file diff --git a/tests/visual_tests/test.py b/tests/visual_tests/test.py index 442aad86d..554c1c5c5 100755 --- a/tests/visual_tests/test.py +++ b/tests/visual_tests/test.py @@ -41,7 +41,9 @@ files = [ {'name': "expressionformat"}, {'name': "shieldsymbolizer-1", 'sizes': sizes_many_in_small_range}, {'name': "rtl-point", 'sizes': [(200, 200)]}, - {'name': "jalign-auto", 'sizes': [(200, 200)]} + {'name': "jalign-auto", 'sizes': [(200, 200)]}, + {'name': "line-offset", 'sizes':[(900, 250)], + 'bbox': mapnik.Box2d(-5.192, 50.189, -5.174, 50.195)} ] def render(filename, width, height, bbox): @@ -50,7 +52,10 @@ def render(filename, width, height, bbox): print "-"*80 m = mapnik.Map(width, height) mapnik.load_map(m, os.path.join(dirname, "styles", "%s.xml" % filename), False) - m.zoom_to_box(bbox) + if bbox is not None: + m.zoom_to_box(bbox) + else: + m.zoom_all() basefn = os.path.join(dirname, "images", '%s-%d' % (filename, width)) mapnik.render_to_file(m, basefn+'-agg.png') diff = compare(basefn + '-agg.png', basefn + '-reference.png')