Hi Dane

The rendering with nik2img seems to work correctly:
$ nik2img.py test2.xml test2.png
generates this image:
http://img251.imageshack.us/img251/470/test2sz.png

The interesting thing is that with my program I get some of the street names 
in the map so it seems to load the osm file and to read it. And in fact it also 
takes about 2 seconds to render it (256x256 pixels on an dual core pentium 
2Ghz).

So imho the problem is neither the xml file nor the osm file nor the mapnik 
installation. But maybe I did not select the correct envelope?
Currently I am using this:
        map.zoom_all();

When selecting another envelope like this
        Envelope<double> bbox(50.9,-1.45,51.0,-1.35);
        map.zoomToBox(bbox);
it renders only the background.  Btw, the coordinates are taken from the osm 
file:   <bound box='50.9,-1.45,51.0,-1.35' 
origin='http://www.openstreetmap.org/api/0.5' />

Could this be the problem? If it is, how can I select the correct bbox?

Cheers, Tom


Am Montag 28 Juni 2010, um 10:18:34 schrieb Dane Springmeyer:
> Thomas. Hard to say what is wrong. I'm traveling so I cannot currently
> dig up that osm plugin example map.   Can you render the map using
> nik2img and compare the results?
> 
> Dane
> 
> --- \o/ ---
> Sent from my phone
> 
> On Jun 25, 2010, at 12:24 PM, Thomas Walter <[email protected]>
> 
> wrote:
> > Hi there
> > 
> > I am trying to generate map tiles out of an osm-file, but for some
> > reason
> > mapnik has problems with the rendering. Often it generates only the
> > background
> > and if it renders more then it is only some random stuff.
> > 
> > When I try to render the test2.xml from
> > http://trac.mapnik.org/browser/trunk/plugins/input/osm
> > it generates this tile:
> > http://img145.imageshack.us/img145/8569/mapnikerror.png
> > 
> > I am using mapnik 0.7.0 from the ubuntu repositories.
> > 
> > The relevant source code (mainly taken from the examples) is:
> >    datasource_cache::instance()->register_datasources
> >    
> >            ("/usr/lib/mapnik/0.7/input/");
> >    
> >    freetype_engine::register_font
> >    
> >            ("/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf");
> >    
> >    Map map (tdim,tdim);
> >    load_map(map,"/home/tom/Desktop/test2.xml");
> >    map.zoom_all();
> >    
> >    Image32 buf(map.getWidth(), map.getHeight());
> >    agg_renderer<Image32> ren(map,buf);
> >    ren.apply();
> >    
> >    QImage image((uchar*)buf.raw_data(),map.getWidth(),
> >    
> >        map.getHeight(),QImage::Format_ARGB32);
> > 
> > Cheers
> > Tom
> > _______________________________________________
> > 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