Enzo,

Yes you would use the Buffer function in PostGIS but you can create them dynamically in your select statement within your mapnik xml mapfile, so there is no need to pre-calculate in another geometry field unless you need a speed bump. As of r769 in svn trunk, mapnik's PostGIS plugin can support multiple geometry fields.

For more info consider posting to the mapnik-users list and reading: 
http://trac.mapnik.org/wiki/PostGIS

Dane

On Jan 6, 2009, at 6:45 PM, Enzo Losantas wrote:

Just a minor follow up, does this mean that im going to add another column in my database, use postgis to add shapefiles or buffers, then use mapnik and render the circles properly with
the LineSymbolizer and PolygonSymbolizer?

Thanks,
Enzo

On Tue, Jan 6, 2009 at 5:13 PM, Enzo Losantas <[email protected]> wrote:
Anyone knowledgeable on how to go about this?

Dane, i was thinking of maybe going about this with a buffer maybe?
If i have a point, then i could use that point as the center of the buffer, then this buffer can be the circle that i am looking for. there seems to be a
buffer function that postgis offers.. is that correct?

Thanks,
Enzo

----
Date: Sun, 16 Nov 2008 21:15:43 -0800
From: Dane Springmeyer <[email protected]>
Subject: Re: [OSM-dev] help: drawing circles on mapnik
To: Enzo Losantas <[email protected]>
Cc: [email protected]
Message-ID: <[email protected]>
Content-Type: text/plain; charset="us-ascii"

Hi Enzo,

I'd second Andy's recommendation of using PostGIS to render circles
with varying size based on some attribute. That sounds like the right
place to start.

As far as styling the circles once you've created them can find more
about the LineSymbolizer (which you can use to define the outline size
and color of the circle), and the PolygonSymbolizer (to define the
fill color) on the Mapnik wiki:

http://trac.mapnik.org/wiki/LineSymbolizer
http://trac.mapnik.org/wiki/PolygonSymbolizer

Also at the wiki is a page that has started to document some usage
specific to PostGIS:

http://trac.mapnik.org/wiki/PostGIS#Usage

And here is a sample script in python that shows buffering existing
polygon data into a larger polygon using PostGIS:
http://mapnik-utils.googlecode.com/svn/trunk/tutorials/postgis/postgis_geometry.py

You could likely borrow from some of the script ideas to approximate
the same effect with circles.

Where these references are incomplete or unclear I'll try to answer
further.

Dane




On Nov 16, 2008, at 7:40 PM, Enzo Losantas wrote:

> Thanks Andy for replying.. somehow gave me an idea how it works.
>
> although there are still things that im confused about. as for the
> kind of circles, maybe circles that have dynamic
> radius based on a certain parameter. Since these are varying radii,
> I'll probably follow your advice regarding
> drawing polylines in postgis.
>
> As for the item on LineSymbolizer / PolygonSymbolizer, can you help
> me with this? Are there any available
> API or references that can be of help as well? How does this work
> exactly?
>
> thanks,
> Enzo
>
> On Wed, Nov 12, 2008 at 8:16 PM, Andy Allan <[email protected]>
> wrote:
> What kind of circles are you looking for? If you just want small
> circles to mark point locations, then make a .png and use a
> PointSymbolizer with it. But if you're trying to vary the size of the
> circles, like for example "draw me a circle where the radius is
> proportional to the population of the town", then you'd be better off
> creating polylines in postgis (or shapefile) and then just
> LineSymbolizer / PolygonSymbolizer depending on whether you want the
> outline or it filled.
>
> Cheers,
> Andy
>
> On Wed, Nov 12, 2008 at 2:54 AM, Enzo Losantas
> <[email protected]> wrote:
> > hello,
> >
> > im wondering if anyone here is familiar with rendering osm through
> mapnik?
> > Particularly, anyone knows how to render circles? is it through
> node-ways or
> > it can be done through the rules?



--
Check these out:

   http://ohm.ecce.admu.edu.ph/

   http://smart.com.ph/

_______________________________________________
dev mailing list
[email protected]
http://lists.openstreetmap.org/listinfo/dev

Reply via email to