Hi,

Running with mapnik 0.7 in python (generate_image.py). I am attempting to 
have pointsymbolizers use an image and scale it depending on an external 
value. So depending on the external value the image will change in size.

When I attempt this by manually editing a style-rule-filter combo 
everything looks as intended:

<snip>
       <Rule>
             <Filter>(([absaccelvalue]&gt;1500))</Filter>
             <PointSymbolizer 
file="/home/ivom/openstreetmap/mapnik/symbols/bus_stop_small.png" 
type="png" width="8" height="8" allow_overlap="yes"></PointSymbolizer>
       </Rule>
       <Rule>
             <Filter>(([absaccelvalue]&lt;1500) and 
([absaccelvalue]&gt;600))</Filter>
             <PointSymbolizer 
file="/home/ivom/openstreetmap/mapnik/symbols/bus_stop_small.png" 
type="png" width="2" height="2" allow_overlap="yes"></PointSymbolizer>
       </Rule>
</snip>

I want fine-grained control programatically, changing the scale factor 
depending onthe filter result. More elegant and easier to maintain.

So depending on the filter-result I attempt to scale the PointSymbolizer 
image. When I do this, the x- and y-values I think I introduce seemingly 
only offsets the PointSymbolizers image, but not it's scale/size.

<snip>
     s=Style()
     for i in range(300,800,100) :
       sym = PointSymbolizer(
         "/home/ivom/openstreetmap/mapnik/symbols/bus_stop_small.png",
         "png",i,i)
       sym.allow_overlap=True
       sym.opacity=.5
       r=Rule()
       r.symbols.append(sym)
       r.filter = Filter("[absaccelvalue] >"+str(i)+" and [absaccelvalue] < 
" + str(i+100))
       s.rules.append(r)
</snip>

To illustrate the problem, have a look at the following two images

1 (ok) http://dl.dropbox.com/u/307509/shifted-snip.png

and

2 (weird offsets) http://dl.dropbox.com/u/307509/scaled-snip.png

Where I have drawn a set of gps trace dots where the image size should 
vary with a dependent value.

>From the api docu: 
http://svn.mapnik.org/trunk/docs/api_docs/python/mapnik._mapnik.PointSymbolizer-class.html
 
I even get another idea of what the constructor and the accessors are able 
to accept. For what I see the width and height are not there at all as 
parameters.

This puzzles me today. Kind regards,
Ivo

_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to