Hi Ric,

AFAIK, there is no way with mapnik (currently) to dynamically add  
points to a map.

I think what you are after is the correct way to read in a point  
datasource of gps points and symbolize them.

I'd use gdal or gpsbabel to convert your data to gpx then shp.

Then I would modify one of the basic mapnik xml tutorial stylesheets  
to use a PointSymbolizer, like:

   <Style name="pnts">
      <Rule>
       <PointSymbolizer file = "symbols/your_graphic.png" type="png"  
width="10" height="10" />
      </Rule>
   </Style>

   <Layer name="points" status="on">
     <StyleName>pnts</StyleName>
     <Datasource>
       <Parameter name="type">shape</Parameter>
       <Parameter name="file">shapefile_of_gps_points</Parameter>
     </Datasource>
   </Layer>

You'll need to create and link to a graphic you want to use for the  
point symbol.

Tutorials using xml can be found here: http://trac.mapnik.org/

But mapnik.org is currently down so you can also fetch them from here:

http://code.google.com/p/mapnik-utils/source/browse/trunk/tutorials/

Hope that helps,

Dane





On Aug 7, 2008, at 2:15 AM, Ric S wrote:

> Hi folks,
>
> I have successfully setup mapnik. Generating a map already works.
> Now I would like to draw gps points into the map, I was searching the
> net for a few hours to get some info, unfortunately
> I still have now clue yet how this can be done with mapnik.
> I assume I have to create a layer and add points to it. I could not  
> find
> an example how to draw points.
>
> I would like to set gps points in my map. Could you please show me  
> how to
> add a single gps point to this map/layer. The code from generate_image
> which I used:
> ...
>    z = 10
>    imgx = 100 * z
>    imgy = 100 * z
>
>    m = Map(imgx,imgy)
>    load_map(m,mapfile)
>    prj = Projection("+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0
> +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m [EMAIL PROTECTED] +no_defs  
> +over")
>    c0 = prj.forward(Coord(ll[0],ll[1]))
>    c1 = prj.forward(Coord(ll[2],ll[3]))
>    bbox = Envelope(c0.x,c0.y,c1.x,c1.y)
>    m.zoom_to_box(bbox)
>    im = Image(imgx,imgy)
>    render(m, im)
>    view = im.view(0,0,imgx,imgy) # x,y,width,height
>    view.save(map_uri,'png')
> ...
>
> Thanks in advance, Richard
>
> _______________________________________________
> 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