Hi Alastair,

I see we missed responding to this question earlier and you have another one 
you just sent (which is just fine). Anyway, I'll respond to both, in order...

See below inline...

On Jul 16, 2011, at 10:38 AM, Alastair Aitchison wrote:

> Hi,
>  
> I have a shapefile containing details of all text labels to appear on the 
> map. Each text element in the shapefile contains attributes including 
> FONTHEIGHT, FONTCOLOUR, and FONTTYPE, which I’d like to map to the “size”, 
> “fill”, and “face_name” properties of the TextSymbolizer applied to this 
> layer, but I seem to be unable to do so.

Right, Mapnik does not currently support reading from features to control 
symbolizers with the exception of Text labels and for constructing paths to 
image symbols.

> In other words, I’d like to use syntax such as this in my styles.xml file:
>  
> <Style name="text">
>     <Rule>
>       <TextSymbolizer
>           name="NAME"
>           face_name="FONTTYPE"
>           size="FONTHEIGHT"
>           fill="FONTCOLOUR"
>           />
>     </Rule>
> </Style>
>  
> However, it seems that the only property from the TextSymbolizer that can be 
> (and indeed *has* to be) mapped to a field from the data layer is the “name” 
> field.

Yes.

> How do I set values for the other properties based on attributes in the data? 
> (The only way I’ve been successful so far is to create a ton of <Rule>s to 
> filter for each combination of type/size/colour, but there’s got to be a 
> better way!)

Not yet, but you are welcome to file a ticket for this at trac.mapnik.org. In 
the meantime it sounds like scripting the <Rules> based on querying your data 
might be easiest.

>  
> Thanks for any advice!
> _______________________________________________
> Mapnik-users mailing list
> [email protected]
> https://lists.berlios.de/mailman/listinfo/mapnik-users

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

Reply via email to