24
tests/data/good_maps/style_level_opacity_and_blur.xml
Normal file
|
@ -0,0 +1,24 @@
|
|||
<Map background-color="#fcc" srs="+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 +over">
|
||||
<!-- Asia -->
|
||||
<Style name="style" image-filters="agg-stack-blur(4,4)">
|
||||
<Rule>
|
||||
<Filter>([REGION]=142)</Filter>
|
||||
<PolygonSymbolizer fill="yellow"/>
|
||||
</Rule>
|
||||
</Style>
|
||||
<!-- Not Asia -->
|
||||
<Style name="style2" opacity=".5">
|
||||
<Rule>
|
||||
<Filter>([REGION]!=142)</Filter>
|
||||
<PolygonSymbolizer fill="#fff"/>
|
||||
</Rule>
|
||||
</Style>
|
||||
<Layer name="world" srs="+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 +over">
|
||||
<StyleName>style</StyleName>
|
||||
<StyleName>style2</StyleName>
|
||||
<Datasource>
|
||||
<Parameter name="file">../shp/world_merc</Parameter>
|
||||
<Parameter name="type">shape</Parameter>
|
||||
</Datasource>
|
||||
</Layer>
|
||||
</Map>
|
|
@ -145,6 +145,17 @@ def test_pre_multiply_status_of_map2():
|
|||
mapnik.render(m,im)
|
||||
eq_(validate_pixels_are_not_premultiplied(im),True)
|
||||
|
||||
def test_style_level_opacity():
|
||||
m = mapnik.Map(512,512)
|
||||
mapnik.load_map(m,'../data/good_maps/style_level_opacity_and_blur.xml')
|
||||
m.zoom_all()
|
||||
im = mapnik.Image(512,512)
|
||||
mapnik.render(m,im)
|
||||
actual = '/tmp/mapnik-style-level-opacity.png'
|
||||
expected = 'images/support/mapnik-style-level-opacity.png'
|
||||
im.save(actual)
|
||||
expected_im = mapnik.Image.open(expected)
|
||||
eq_(im.tostring(),expected_im.tostring(), 'failed comparing actual (%s) and expected (%s)' % (actual,'tests/python_tests/'+ expected))
|
||||
|
||||
if __name__ == "__main__":
|
||||
setup()
|
||||
|
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 44 KiB |
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 44 KiB |
BIN
tests/python_tests/images/support/mapnik-style-level-opacity.png
Normal file
After Width: | Height: | Size: 41 KiB |