Change visual tests directory structure.

This commit is contained in:
Hermann Kraus 2012-03-20 21:28:21 +01:00
parent 89877edc67
commit f7a387f8af
91 changed files with 45 additions and 47 deletions

View file

@ -1,3 +1,3 @@
rm -f *-agg.png
rm -f *-out.xml
rm -f images/*-agg.png
rm -f xml_output/*-out.xml

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 533 B

View file

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

View file

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View file

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

View file

Before

Width:  |  Height:  |  Size: 35 KiB

After

Width:  |  Height:  |  Size: 35 KiB

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View file

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.1 KiB

View file

Before

Width:  |  Height:  |  Size: 4 KiB

After

Width:  |  Height:  |  Size: 4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 2 KiB

After

Width:  |  Height:  |  Size: 2 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

View file

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

View file

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

View file

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

View file

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View file

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

View file

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

View file

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

View file

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">lines.osm</Parameter>
<Parameter name="file">../data/lines.osm</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">lines.osm</Parameter>
<Parameter name="file">../data/lines.osm</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">lines.osm</Parameter>
<Parameter name="file">../data/lines.osm</Parameter>
</Datasource>
</Layer>

View file

@ -6,14 +6,14 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">osm</Parameter>
<Parameter name="file">lines.osm</Parameter>
<Parameter name="file">../data/lines.osm</Parameter>
</Datasource>
</Layer>
<Style name="My Style">
<Rule>
<LineSymbolizer stroke-width="1" stroke="blue"/>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="line" file="../data/svg/crosshair16x16.svg" spacing="30">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="line" file="../../data/svg/crosshair16x16.svg" spacing="30">'X'</ShieldSymbolizer>
</Rule>
</Style>

View file

@ -7,9 +7,9 @@
<Datasource>
<!--
<Parameter name="type">osm</Parameter>
<Parameter name="file">points.osm</Parameter>-->
<Parameter name="file">../data/points.osm</Parameter>-->
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -10,7 +10,7 @@
<Parameter name="file">points.osm</Parameter>
-->
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,53 +6,53 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../../data/points.shp</Parameter>
</Datasource>
</Layer>
<Style name="My Style">
<Rule>
<Filter>[nr] = '1'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '2'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg" allow-overlap="true" horizontal-alignment="middle" dx="5">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg" allow-overlap="true" horizontal-alignment="middle" dx="5">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '3'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg" vertical-alignment="middle" dy="5">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg" vertical-alignment="middle" dy="5">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '4'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg" dy="0" vertical-alignment="bottom">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg" dy="0" vertical-alignment="bottom">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '5'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg" allow-overlap="true" vertical-alignment="top">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg" allow-overlap="true" vertical-alignment="top">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '6'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg" allow-overlap="true" horizontal-alignment="left">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg" allow-overlap="true" horizontal-alignment="left">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '7'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg" allow-overlap="true" horizontal-alignment="right">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg" allow-overlap="true" horizontal-alignment="right">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '8'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg">'X&#10;X&#10;X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg">'X&#10;X&#10;X'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '9'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/svg/crosshair16x16.svg">'XXX'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/svg/crosshair16x16.svg">'XXX'</ShieldSymbolizer>
</Rule>
<Rule>
<Filter>[nr] = '10'</Filter>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../data/images/crosshair16x16.png">'X'</ShieldSymbolizer>
<ShieldSymbolizer face-name="DejaVu Sans Book" size="16" placement="point" file="../../data/images/crosshair16x16.png">'X'</ShieldSymbolizer>
</Rule>
<Rule>
<PointSymbolizer allow-overlap="true" file="../data/raster/white-alpha.png"/>
<PointSymbolizer allow-overlap="true" file="../../data/raster/white-alpha.png"/>
</Rule>
</Style>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -6,7 +6,7 @@
<StyleName>My Style</StyleName>
<Datasource>
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -5,12 +5,8 @@
<Layer name="layer" srs="+proj=latlong +datum=WGS84">
<StyleName>My Style</StyleName>
<Datasource>
<!--
<Parameter name="type">osm</Parameter>
<Parameter name="file">points.osm</Parameter>
-->
<Parameter name="type">shape</Parameter>
<Parameter name="file">points.shp</Parameter>
<Parameter name="file">../data/points.shp</Parameter>
</Datasource>
</Layer>

View file

@ -39,10 +39,10 @@ def render(filename, width, height=100):
width = int(width)
height = int(height)
m = mapnik.Map(width, height)
mapnik.load_map(m, os.path.join(dirname, "%s.xml" % filename), False)
mapnik.load_map(m, os.path.join(dirname, "styles", "%s.xml" % filename), False)
bbox = mapnik.Box2d(-0.05, -0.01, 0.95, 0.01)
m.zoom_to_box(bbox)
basefn = os.path.join(dirname,'%s-%d' % (filename, width))
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')
if diff > 0:
@ -63,6 +63,6 @@ for f in files:
m = render(f[0], width[0], width[1])
else:
m = render(f[0], width)
mapnik.save_map(m, os.path.join(dirname,"%s-out.xml" % f[0]))
mapnik.save_map(m, os.path.join(dirname, 'xml_output', "%s-out.xml" % f[0]))
summary()

View file

@ -1,6 +1,8 @@
#!/usr/bin/env python
import mapnik
import sys
import os.path
import compare
class MyText(mapnik.FormattingNode):
def __init__(self):
@ -67,7 +69,7 @@ m.append_style('Style', style)
layer = mapnik.Layer('Layer')
layer.datasource = mapnik.Shapefile(file="points.shp")
layer.datasource = mapnik.Shapefile(file="data/points.shp")
layer.styles.append('Style')
m.layers.append(layer)
@ -95,4 +97,4 @@ format_trees = [
for format_tree in format_trees:
text.placements.defaults.format_tree = format_tree[1]
mapnik.render_to_file(m, 'python-%s.png' % format_tree[0], 'png')
mapnik.render_to_file(m, os.path.join("images", 'python-%s.png' % format_tree[0]), 'png')