mapnik using postgis

87 views
Skip to first unread message

Surendra Mishra

unread,
Sep 2, 2013, 3:00:07 AM9/2/13
to map...@googlegroups.com
Hi

I am using mapnik 2.0.1 in window. passing data from postgis. How I
can pass angle of symbols in postgis for rendering map thorugh mapnik.

<Layer name="farrow_p" srs="+proj=latlong +ellps=WGS84 +datum=WGS84
+no_defs" status="on">
<StyleName>farrow_p</StyleName>
<Datasource>
<Parameter name="type">postgis</Parameter>
<Parameter name="host">localhost</Parameter>
<Parameter name="user">postgres</Parameter>
<Parameter name="dbname">postgis</Parameter>
<Parameter name="password">Admin@123</Parameter>
<Parameter name="table">(select * from p_farrow) as xxx</Parameter>
<Parameter name="port">5433</Parameter>
</Datasource>
</Layer>

P_farrow is point symbol. In postgis there is one field of rotation of
p_farrow. how I can pass this rotation field, so that I can find
actual rotation of this symbol

--
Thanks & regards

Surendra Misra

Alexandre Bonnasseau

unread,
Sep 2, 2013, 5:15:48 AM9/2/13
to map...@googlegroups.com
Hello Surendra,

if I understand you well, you want to store the orientation of the symbol in your database ?

Unfortunately, using PointSymbolizer, this is not availlable for the moment, also it is planned for version 3 of Mapnik ( https://github.com/mapnik/mapnik/issues/828 ).

However, if you're able to modifify your database schema, you can make use of the MarkerSymbolizer along a linestring by setting placement="line" to display your arrow : https://github.com/mapnik/mapnik/wiki/MarkersSymbolizer.

Alexandre



________________________________________
De : map...@googlegroups.com [map...@googlegroups.com] de la part de Surendra Mishra [luit.s...@gmail.com]
Date d'envoi : lundi 2 septembre 2013 09:00
À : map...@googlegroups.com
Objet : [mapnik] mapnik using postgis
--
You received this message because you are subscribed to the Google Groups "mapnik" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mapnik+un...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Surendra Mishra

unread,
Sep 3, 2013, 5:02:18 AM9/3/13
to map...@googlegroups.com
Hi Alexandre

no, I want to rotate my symbol using postgis database in which there
is rotation field containing rotation angle.

thanks

Alexandre Bonnasseau

unread,
Sep 3, 2013, 9:10:05 AM9/3/13
to map...@googlegroups.com
All right.
Unfortunately, it's not possible to use a rotation field from the database.

The only option is can see is to follow the orientation of a linestring, as you can see with lady : beatle https://github.com/mapnik/mapnik/wiki/MarkersSymbolizer

Has anyone got a better idea ?

Alexandre
________________________________________
De : map...@googlegroups.com [map...@googlegroups.com] de la part de Surendra Mishra [luit.s...@gmail.com]
Date d'envoi : mardi 3 septembre 2013 11:02
À : map...@googlegroups.com
Objet : Re: RE : [mapnik] mapnik using postgis

Surendra Mishra

unread,
Sep 3, 2013, 10:53:48 AM9/3/13
to map...@googlegroups.com
ok

wheather it is possible of rotation of pont symbolizer by taking the
attribute from the shp file.

thanks

Alexandre Bonnasseau

unread,
Sep 3, 2013, 11:51:07 AM9/3/13
to map...@googlegroups.com
Hello,

You are asking if you can use a rotation field from a shp file instead of postgis ?

I'm affraid you can only set a constant rotation in the PointSymbolizer, using the transform attribute :

<PointSymbolizer file="arrow.svg" transform="rotate(45)" />

But you can't use a field neither from a shp file nor a postgis database.

Alexandre

> is rotation field containing rotation angle.
________________________________________
De : map...@googlegroups.com [map...@googlegroups.com] de la part de Surendra Mishra [luit.s...@gmail.com]
Date d'envoi : mardi 3 septembre 2013 16:53
À : map...@googlegroups.com
Objet : Re: RE : RE : [mapnik] mapnik using postgis
Reply all
Reply to author
Forward
0 new messages