Data-driven symbol rotation and color

197 views
Skip to first unread message

Nikolai Lebedev

unread,
Jun 14, 2012, 3:48:52 AM6/14/12
to mapnik
Hi group!

My goal is to render wind arrows like that:
http://db.tt/m7sMSOjf
I'm now doing it with SLD, but I'd like to do it in mapnik further
(and use a native carto css parser when it comes up).

So in sld it's a pointsymbolizer with a truetype symbol, that's
rotation is calculated depending on one data field, and color is set
in another. The lenght of the arrow tail (the ttf symbol itself) is
chosen also upon a data field.

From what I've found is https://github.com/mapnik/mapnik/wiki/GlyphSymbolizer
should be the somewhat close.
But it has a broken link:
https://github.com/mapnik/mapnik/blob/master/tests/python_tests/glyph_symbolizer_test.py
And seems to be deprecated.

What is the right way to do this data-driven rendering?

Artem Pavlenko

unread,
Jun 14, 2012, 4:44:36 AM6/14/12
to map...@googlegroups.com
Have you tried 'markers' ? (
https://github.com/mapnik/mapnik/wiki/MarkersSymbolizer )

Artem

Nikolai Lebedev

unread,
Jun 14, 2012, 10:19:37 AM6/14/12
to mapnik
Artem, privet!

Looking at MarkerSymbolizer spec. How is it possible to put in the
field value in "rotation" property of svg transform parameter?

On 14 июн, 12:44, Artem Pavlenko <ar...@mapnik.org> wrote:
> Have you tried 'markers' ?  (https://github.com/mapnik/mapnik/wiki/MarkersSymbolizer)
>
> Artem
>
> On 14 June 2012 08:48, Nikolai Lebedev <nlebe...@gispro.ru> wrote:
>
>
>
>
>
>
>
> > Hi group!
>
> > My goal is to render wind arrows like that:
> >http://db.tt/m7sMSOjf
> > I'm now doing it with SLD, but I'd like to do it in mapnik further
> > (and use a native carto css parser when it comes up).
>
> > So in sld it's a pointsymbolizer with a truetype symbol, that's
> > rotation is calculated depending on one data field, and color is set
> > in another. The lenght of the arrow tail (the ttf symbol itself) is
> > chosen also upon a data field.
>
> > From what I've found ishttps://github.com/mapnik/mapnik/wiki/GlyphSymbolizer
> > should be the somewhat close.
> > But it has a broken link:
> >https://github.com/mapnik/mapnik/blob/master/tests/python_tests/glyph...

Artem Pavlenko

unread,
Jun 14, 2012, 10:29:18 AM6/14/12
to map...@googlegroups.com
Привет!

If you're using latest master, you should be able to :

image-transform="rotate([angle_in_degrees])"

Sven Geggus

unread,
Jun 15, 2012, 9:50:03 AM6/15/12
to map...@googlegroups.com
Artem Pavlenko <ar...@mapnik.org> wrote:

> If you're using latest master, you should be able to :
>
> image-transform="rotate([angle_in_degrees])"

As data driven rendering is IMO the most missing feature of mapnik in comparison
to Mapserver: Will it be possible to have something like this

<LineSymbolizer stroke-linejoin="round" stroke="#8d4346" stroke-width="[width]"/>

for LineSymbolizer in future as well?

Sven

--
Das allgemeine Persönlichkeitsrecht (Art. 2 Abs.1 i.V.m. Art.1 Abs. 1GG)
umfasst das Grundrecht auf Gewährleistung der Vertraulichkeit und Integrität
informationstechnischer Systeme. (BVerfG, 1BvR 370/07)
/me is giggls@ircnet, http://sven.gegg.us/ on the Web

Dane Springmeyer

unread,
Jun 15, 2012, 11:32:12 AM6/15/12
to map...@googlegroups.com, map...@googlegroups.com
On Jun 15, 2012, at 9:50 AM, Sven Geggus <li...@fuchsschwanzdomain.de> wrote:

> Artem Pavlenko <ar...@mapnik.org> wrote:
>
>> If you're using latest master, you should be able to :
>>
>> image-transform="rotate([angle_in_degrees])"
>
> As data driven rendering is IMO the most missing feature of mapnik in comparison
> to Mapserver: Will it be possible to have something like this
>
> <LineSymbolizer stroke-linejoin="round" stroke="#8d4346" stroke-width="[width]"/>
>
> for LineSymbolizer in future as well?

Yes, that will be supported in the future.
Reply all
Reply to author
Forward
0 new messages