visual tests - stop testing agg v cairo and rather cairo v cairo - add test for #1600

This commit is contained in:
Dane Springmeyer 2013-03-06 11:32:27 -08:00
parent c7139a55a7
commit 4922f76858
88 changed files with 414 additions and 35 deletions

Binary file not shown.

View file

@ -0,0 +1 @@
PROJCS["WGS 84 / Pseudo-Mercator",GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4326"]],UNIT["metre",1,AUTHORITY["EPSG","9001"]],PROJECTION["Mercator_1SP"],PARAMETER["central_meridian",0],PARAMETER["scale_factor",1],PARAMETER["false_easting",0],PARAMETER["false_northing",0],EXTENSION["PROJ4","+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs"],AUTHORITY["EPSG","3857"],AXIS["X",EAST],AXIS["Y",NORTH]]

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,73 @@
{
"keys": [
"",
"1"
],
"data": {},
"grid": [
" !!!! !!!! !!!! !!!! !!!! !!!! ",
" ! ! ! ! ! ! ! ",
" ! ",
" ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ",
" ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ",
" ",
" ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ",
" ! ",
" ! ",
" ! ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ",
" ",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ",
" ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ",
" ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! !!!! !!!! !!!! !!!! !!!! !!!! ",
" ! ! ! ",
" ! ! ! ! ! ! ",
" !!!! !!!! !!!! !!!! !!!! !!!! ! ",
" ! ! ! ! ! ",
" ! ! ! ! ! ",
" ! !!!! !!!! !!!! !!!! !!!! !!!! ",
" ! ! ! ! ! ! ",
" ! ! ! ! ",
" !!!! !!!! !!!! !!!! !!!! !!!! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ",
" ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ",
" ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ",
" ",
" ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ",
" ! ",
" ! ",
" ! ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ",
" ",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ",
" ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ",
" ! ! ",
" ! ! ! ! ! ! ! ! ",
" !!!! !!!! !!!! !!!! !!!! !!!! ! ",
" ! ! ! ",
" ! ! ! ! ! ! ",
" ! !!!! !!!! !!!! !!!! !!!! !!!! ",
" ! ! ! ! ! ",
" ! ! ! ! ! ",
" !!!! !!!! !!!! !!!! !!!! !!!! ! ",
" ! ! ! ! ! ",
" ! ! ! ! "
]
}

View file

@ -0,0 +1,159 @@
{
"keys": [
"",
"1"
],
"data": {},
"grid": [
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ! ! ! ! ",
" !! ! !! ! ! !! ! !! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! ! ! ! ",
" ! ! ! ! ! !! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ",
"! !!!! !!!! ! !!! ! !!!! !!!! !!!! ",
" ! ! ! ! ! ! ! ! ! ",
" ! !! ! ! ! !! ! !! ! ",
" ! ! ! ! ! ! ! ! !",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" !! ! !! ! ! ! !! !! ! !",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
"! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! !",
" ! ! ! ! ! ! ! ! ! ",
" !!!! !!!! ! !!!! ! !!! !!!! !!!! ",
" ! ! ! ! ! ! !! ! !",
" !! ! ! ! ! !! ! !! ",
" ! ! ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ! ",
" !! ! !! ! ! ! !! ! !! ! ",
" ! ! ! !! ! !! ! ",
" ! ! ! ! ! ! ! ! ! !",
" !!!! !!!! ! !!!! ! !!! !!!! !!!! ",
" ! ! ! ! ! ! ! ",
" !! ! ! ! ! !! ! !! ! !",
" ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ! ",
"! !!!! ! !!!! ! !!!! !!!! !!!! !!!! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! ! !",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" !! ! !! ! ! ! !! !! ! !",
" !! ! ! ! ! !! ! ",
" ! ! ! ! ! ! ! ! ! ",
"! !!!! ! !!!! ! !!! ! !!!! !!!! !!!! ",
" ! ! ! ! ! ! ! ! ",
" ! !! ! ! ! ! ! !! ! !! ! ",
" ! ! ! ! ! ! ! !",
" ! ! ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! ! ! ! ! ! !",
" !! ! ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ! ! ! ",
" !! ! !! ! ! ! !! ! !! ! ",
" !! ! ! !! ! !! ! ",
" ! ! ! ! ! ! ! ! !",
" !!!! !!!! ! !!!! ! !!! !!!! !!!! ",
" ! ! ! ! ! ! ! ! ! ",
" !! ! !! ! ! ! !! ! !! ! !",
" ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ! ",
"! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! !",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ! ",
" !! ! !! ! ! ! ! !! !! ! !",
" !! ! ! ! ! !! !! ",
" ! ! ! ! ! ! ! ! ! ! ",
"! !!!! !!!! ! !!! ! !!!! !!!! !!!! ",
" ! ! ! ! ! ! ! ",
" ! !! ! !! ! ! !! ! !! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! ! ! ! ! ",
" !! ! ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
"! ! ! ! ! ! ! ! ! ! ! ",
" !! ! ! ! ! ! !! ! ! ",
" !! ! ! !! ! !! !! ",
" ! ! ! ! ! ! ! ! ! !",
" ! ! !! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" !! ! !! ! ! ! !! ! !! ! !",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
"! !!!!!! !!!!!! !!!!!! !!!!! !!!!!! !!!!!! ",
" ! ! ! ! ! ! ",
" ! ! ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! ! !",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! !! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! !",
" ! ! ! ! ",
" ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
]
}

View file

@ -0,0 +1,109 @@
{
"keys": [
"",
"1"
],
"data": {},
"grid": [
" !!!!!! !!!!!! !!!!! !!!!!! !!!!!! !!!!!! ",
" ! !! !! ! !! ! ! !! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! !! !! ! ! ! ! !! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! !! !! ! ! ! ! !! ",
" ! ! ! !! !! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! !! ! ! ! ",
" ! ! ! ! !! ! ! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! !! ! ! ! ! ! ! ",
" ! ! ! !! !! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" !! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" !!!! !!!! ! !!! ! !!!! !!!! !!!! ",
" ! ! !! ! ! ! ! ! ! ",
" ! ! ! ! !! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! !!!! !!!! !!!! ! !!!! ! !!!! !!!! ",
" ! ! ! !! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! !! !! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! !! !! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! !! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! !! !! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! !! !! ! ! ! ! ",
" ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! !!!!!! ",
" ! ! ! !! ! !! ! ! ! ! ! ! ",
" ! ! ! !! !! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! !! ! ! ! ",
" ! ! ! ! !! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ",
" ! !!!! !!!! !!!! ! !!! ! !!!! !!!! ",
" ! ! ! ! ! !! ! ! ! ! ! ! ",
" ! ! ! ! ! !! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ",
" !!!! !!!! ! !!! ! !!!! !!!! !!!! ",
" ! ! !! !! !! ! ! !! ",
" ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" !! ! ! ! ! ! ! !! ! ! ",
" ! ! ! ! ! ! ! ! ! ",
" ! ! ! ! ! ! ",
" ! ! ! ! ! ",
" ! ! ! ! ! ! "
]
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 486 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

View file

@ -0,0 +1,24 @@
<!DOCTYPE Map>
<Map background-color="white" srs="+init=epsg:4326" minimum-version="0.7.2">
<Style name="1">
<Rule>
<LineSymbolizer stroke-width=".2" stroke="grey"/>
<MarkersSymbolizer
allow-overlap="true"
clip="true"
file="shape://arrow"
transform="scale(.5,.5)"
placement="line"
spacing="50"
/>
</Rule>
</Style>
<Layer name="point" srs="+init=epsg:4326">
<StyleName>1</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">../data/hex.shp</Parameter>
</Datasource>
</Layer>
</Map>

View file

@ -46,6 +46,7 @@ files = [
{'name': "marker_line_placement_on_points"},
{'name': "marker-with-background-image", 'sizes':[(600,400),(400,600),(257,256)]},
{'name': "marker-with-background-image-and-hsla-transform", 'sizes':[(600,400),(400,600),(257,256)]},
{'name': "marker-on-hex-grid", 'sizes':[(600,400),(400,600),(257,256)]},
{'name': "whole-centroid", 'sizes':[(600,400)],
'bbox': mapnik.Box2d(736908, 4390316, 2060771, 5942346)},
{'name': "simple-E", 'bbox':mapnik.Box2d(-0.05, -0.01, 0.95, 0.01)},
@ -93,52 +94,64 @@ def report(diff,quiet=False,threshold=0):
else:
print '\x1b[32m✓\x1b[0m'
def render(filename, width, height, bbox, quiet=False):
def render(config, width, height, bbox, quiet=False):
filename = config['name']
m = mapnik.Map(width, height)
expected = os.path.join(dirname, "images", '%s-%d-reference.png' % (filename, width))
actual = '%s-%d' % (filename, width)
try:
mapnik.load_map(m, os.path.join(dirname, "styles", "%s.xml" % filename), False)
if bbox is not None:
m.zoom_to_box(bbox)
else:
m.zoom_all()
except Exception, e:
sys.stderr.write(e.message + '\n')
fail(actual,expected,str(e.message))
return
actual_agg = os.path.join(visual_output_dir, '%s-agg.png' % actual)
if not quiet:
print "\"%s\" with size %dx%d with agg..." % (filename, width, height),
try:
mapnik.render_to_file(m, actual_agg)
if not os.path.exists(expected):
# generate it on the fly
fail(actual_agg,expected,None)
else:
diff = compare(actual_agg, expected, threshold=1, alpha=True)
report(diff,quiet)
except Exception, e:
sys.stderr.write(e.message + '\n')
fail(actual_agg,expected,str(e.message))
if 'tiff' in actual or 'marker' in actual:
## AGG rendering
if config.get('agg',True):
expected = os.path.join(dirname, "images", '%s-%d-reference.png' % (filename, width))
actual = '%s-%d' % (filename, width)
try:
mapnik.load_map(m, os.path.join(dirname, "styles", "%s.xml" % filename), False)
if bbox is not None:
m.zoom_to_box(bbox)
else:
m.zoom_all()
except Exception, e:
sys.stderr.write(e.message + '\n')
fail(actual,expected,str(e.message))
return
actual_agg = os.path.join(visual_output_dir, '%s-agg.png' % actual)
if not quiet:
print "\"%s\" with size %dx%d with agg..." % (filename, width, height),
try:
mapnik.render_to_file(m, actual_agg)
if not os.path.exists(expected):
# generate it on the fly
fail(actual_agg,expected,None)
else:
diff = compare(actual_agg, expected, threshold=1, alpha=True)
report(diff,quiet)
except Exception, e:
sys.stderr.write(e.message + '\n')
fail(actual_agg,expected,str(e.message))
### TODO - set up tests to compare agg and cairo png output
### Cairo rendering
if config.get('cairo',True):
expected_cairo = os.path.join(dirname, "images", '%s-%d-reference-cairo.png' % (filename, width))
actual_cairo = os.path.join(visual_output_dir, '%s-cairo.png' % actual)
if not quiet:
print "\"%s\" with size %dx%d with cairo..." % (filename, width, height),
try:
mapnik.render_to_file(m, actual_cairo,'ARGB32')
if not os.path.exists(expected):
pass # will have been generated by agg test
if not os.path.exists(expected_cairo):
# generate it on the fly
fail(actual_cairo,expected_cairo,None)
else:
# cairo and agg differ in alpha for reasons unknown, so don't test it for now
diff_threshold = 4
diff = compare(actual_cairo, expected, threshold=diff_threshold, alpha=False)
diff_threshold = 1
diff = compare(actual_cairo, expected_cairo, threshold=diff_threshold, alpha=False)
report(diff,quiet,threshold=diff_threshold)
except Exception, e:
sys.stderr.write(e.message + '\n')
fail(actual_cairo,expected,str(e.message))
if True:
fail(actual_cairo,expected_cairo,str(e.message))
## Grid rendering
if config.get('grid',True):
expected_grid = os.path.join(dirname, "grids", '%s-%d-reference.json' % (filename, width))
actual_grid = os.path.join(visual_output_dir, '%s-grid.json' % actual)
if not quiet:
@ -181,7 +194,7 @@ if __name__ == "__main__":
config = dict(defaults)
config.update(f)
for size in config['sizes']:
m = render(config['name'], size[0], size[1], config.get('bbox'), quiet=quiet)
m = render(config, size[0], size[1], config.get('bbox'), quiet=quiet)
mapnik.save_map(m, os.path.join(dirname, 'xml_output', "%s-out.xml" % config['name']))
summary(generate=True)