I got it working. It seems that a library in the standard ubuntu installation (maybe libcairo2) caused the problem. After adding the xorg-edgers ppa and updating the system, it now works as supposed.
Anyway, thanks for the help. Tom Am Sonntag 04 Juli 2010, 08:18:18 schrieben Sie: > nik2img by default zooms to the full extent of the data, not sure what the > viewer does. How are you getting that image out of the viewer? > > Dane > > On Jul 3, 2010, at 10:50 AM, Thomas Walter wrote: > > Hi Dane > > > > Ok after some playing around I could get it working as well - it was > > again the QMAKE_CXXFLAGS +=' -ansi' > > that was missing. Don't know why it did not work on my first attempt. > > > > Anyway - the viewer now shows the same output like my program: > > http://img12.imageshack.us/img12/4949/viewertest.jpg > > > > With nik2img it works perfectly: > > http://img813.imageshack.us/img813/2969/test2.png > > > > nik2img.py test2.xml test2.png -v > > Step: 1 // --> Nik2img starting... > > Step: 2 // --> Format: png > > Step: 3 // --> Loading mapfile... > > Step: 4 // --> Loaded test2.xml... > > ### WARNING: Failed to load image file '/home/nick/images/pub.png': > > cannot open image file /home/nick/images/pub.png > > ### WARNING: Failed to load image file '/home/nick/images/mast.png': > > cannot open image file /home/nick/images/mast.png > > ### WARNING: Failed to load image file '/home/nick/images/carpark.png': > > cannot open image file /home/nick/images/carpark.png > > ### WARNING: Failed to load image file '/home/nick/images/farm.png': > > cannot open image file /home/nick/images/farm.png > > Step: 5 // --> Setting Map view... > > Step: 6 // --> Zoom to extent of all layers: > > "Envelope(-1.5749997,50.7998221333,-1.2170842,51.0384324667)" > > Step: 7 // --> Finished setting extents... > > Loading map took... 0.7305 seconds > > Step: 8 // --> SRS: +proj=latlong +datum=WGS84 > > Step: 9 // --> Map extent: > > Envelope(-1.5749997,50.7998221333,-1.2170842,51.0384324667) > > Step: 10 // --> Map long/lat bbox: > > Envelope(-1.5749997,50.7998221333,-1.2170842,51.0384324667) > > Step: 11 // --> Map center: Coord(-1.39604195,50.9191273) > > Step: 12 // --> Map long/lat center: Coord(-1.39604195,50.9191273) > > Step: 13 // --> Map scale denominator: 237160.542899 > > Step: 14 // --> Extent of all layers: > > Envelope(-1.5749997,50.8159089,-1.2170842,51.0223457) > > Step: 15 // --> Long/lat extent of all layers: > > Envelope(-1.5749997,50.8159089,-1.2170842,51.0223457) > > Step: 16 // --> Long/lat center of all layers: > > Coord(-1.39604195,50.9191273) Step: 17 // --> Layers intersecting map: > > [leisure, waterway, lakes, roads, amenity, roadstext, text] > > Step: 18 // --> At current scale of '0.000596525833333'... > > Step: 19 // --> layer 'leisure' is visible > > Step: 20 // --> layer 'waterway' is visible > > Step: 21 // --> layer 'lakes' is visible > > Step: 22 // --> layer 'roads' is visible > > Step: 23 // --> layer 'amenity' is visible > > Step: 24 // --> layer 'roadstext' is visible > > Step: 25 // --> layer 'text' is visible > > Step: 26 // --> Starting rendering... > > Rendering image took... 1.394 seconds > > Step: 27 // --> Finished rendering map to... test2.png > > Total Nik2img run time: 2.1802 seconds > > > > Cheers, Tom > > > > Am Donnerstag 01 Juli 2010, 23:33:20 schrieben Sie: > >> Thomas, > >> > >> Can you try again with those flags? The only time we've seen this boost > >> assertion so far is when these flags are missing... > >> > >> Another thing to try is a older version of g++. I know that we only saw > >> http://trac.mapnik.org/ticket/436 on more recent linux versions with g++ > >> > >>> = 4. If it works with an earlier version of g++ that might help gives > >> > >> clues. > >> > >> Dane > >> > >> On Jul 1, 2010, at 6:01 AM, Thomas Walter wrote: > >>> Ok after some more testing I'm stuck again. My own project now does not > >>> crash anymore when loading the map and having a parameter object. All I > >>> need in the project file are those lines: > >>> > >>> QMAKE_CXXFLAGS +=' -ansi' > >>> LIBS += -lmapnik > >>> INCLUDEPATH += /usr/include/freetype2/ > >>> > >>> BUT: the rendering problem still exists. > >>> > >>> And even more, the "viewer" test program still keeps on crashing when I > >>> load a map. The debug output looks the same as in my program. I gave it > >>> all the additional CFLAGS with no change. > >>> Here is the compile output: > >>> > >>> g++ -c -pipe -ansi -Wall -ftemplate-depth-100 -DLINUX - > >>> DBOOST_SPIRIT_THREADSAFE -DMAPNIK_THREADSAFE -O2 -finline-functions > >>> -Wno-inline -DNDEBUG -Wno-missing-field-initializers -g -D_REENTRANT > >>> -Wall -W -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED > >>> -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore > >>> -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I/usr/include > >>> -I/usr/include/freetype2 -Idebug -I. -o debug/main.o main.cpp > >>> > >>> It opens the xml file (and even complains for the example file about > >>> some missing pictures) but then issues all the these errors. Any > >>> ideas about this? > >>> > >>> Cheers, Tom > >>> > >>> Am Montag 28 Juni 2010, 22:31:47 schrieben Sie: > >>>> The below error is resulting from missing CFLAGS that you need to pass > >>>> when compiling your own application against mapnik. > >>>> > >>>> See > >>>> http://www.mail-archive.com/[email protected]/msg02197.htm > >>>> l > >>>> > >>>> It would be great if you would test which of these make a different > >>>> and create a wiki page on your findings. > >>>> > >>>> Dane > >>>> > >>>> On Jun 28, 2010, at 3:38 AM, Thomas Walter wrote: > >>>>> Btw - the programm crashes during loading the map as soon as I have > >>>>> declared a parameters object. It does not matter if I use this > >>>>> parameters object or not. > >>>>> > >>>>> 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"); > >>>>> > >>>>> parameters p; > >>>>> > >>>>> for(int count=0; count<map.layerCount(); count++) > >>>>> { > >>>>> > >>>>> qDebug() << "layer name = " << > >>>>> map.getLayer(count).name().c_str(); > >>>>> > >>>>> } > >>>>> > >>>>> The error message: > >>>>> > >>>>> REV_HMI: /usr/include/boost/variant/detail/visitation_impl.hpp:203: > >>>>> typename Visitor::result_type > >>>>> boost::detail::variant::visitation_impl(int, int, Visitor&, VPCV, > >>>>> mpl_::true_, NBF, W*, S*) [with W = > >>>>> boost::detail::variant::visitation_impl(int, int, Visitor&, > >>>>> VoidPtrCV, mpl_::false_, NoBackupFlag, Which*, step0*) [with Which = > >>>>> boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, > >>>>> T13, T14, T15, T16, T17, T18, T19>::internal_apply_visitor_impl(int, > >>>>> int, Visitor&, VoidPtrCV) [with Visitor = > >>>>> boost::detail::variant::copy_into, VoidPtrCV = const void*, T0_ = > >>>>> int, T1 = double, T2 = std::basic_string<char, > >>>>> std::char_traits<char>, std::allocator<char> >, T3 = > >>>>> boost::detail::variant::void_, T4 = boost::detail::variant::void_, > >>>>> T5 = boost::detail::variant::void_, T6 = > >>>>> boost::detail::variant::void_, T7 = boost::detail::variant::void_, > >>>>> T8 = boost::detail::variant::void_, T9 = > >>>>> boost::detail::variant::void_, T10 = boost::detail::variant::void_, > >>>>> T11 = boost::detail::variant::void_, T12 = > >>>>> boost::detail::variant::void_, T13 = > >>>>> boost::detail::variant::void_, T14 = boost::detail::variant::void_, > >>>>> T15 = > >>>>> boost::detail::variant::void_, T16 = boost::detail::variant::void_, > >>>>> T17 = boost::detail::variant::void_, T18 = > >>>>> boost::detail::variant::void_, T19 = > >>>>> boost::detail::variant::void_]::first_which, step0 = > >>>>> boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, > >>>>> T12, T13, T14, T15, T16, T17, T18, > >>>>> T19>::internal_apply_visitor_impl(int, int, Visitor&, VoidPtrCV) > >>>>> [with Visitor = boost::detail::variant::copy_into, VoidPtrCV = const > >>>>> void*, T0_ = int, T1 = double, T2 = std::basic_string<char, > >>>>> std::char_traits<char>, > >>>>> std::allocator<char> >, T3 = boost::detail::variant::void_, T4 = > >>>>> boost::detail::variant::void_, T5 = boost::detail::variant::void_, T6 > >>>>> = boost::detail::variant::void_, T7 = boost::detail::variant::void_, > >>>>> T8 = boost::detail::variant::void_, T9 = > >>>>> boost::detail::variant::void_, T10 = boost::detail::variant::void_, > >>>>> T11 = boost::detail::variant::void_, T12 = > >>>>> boost::detail::variant::void_, T13 = > >>>>> boost::detail::variant::void_, T14 = boost::detail::variant::void_, > >>>>> T15 = boost::detail::variant::void_, T16 = > >>>>> boost::detail::variant::void_, T17 = boost::detail::variant::void_, > >>>>> T18 = boost::detail::variant::void_, T19 = > >>>>> boost::detail::variant::void_]::first_step, Visitor = > >>>>> boost::detail::variant::copy_into, VoidPtrCV = const void*, > >>>>> NoBackupFlag = boost::variant<int, double, std::basic_string<char, > >>>>> std::char_traits<char>, std::allocator<char> >, > >>>>> boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, > >>>>> boost::detail::variant::void_>::has_fallback_type_]::next_which, S = > >>>>> boost::detail::variant::visitation_impl(int, int, Visitor&, > >>>>> VoidPtrCV, mpl_::false_, NoBackupFlag, Which*, step0*) [with Which = > >>>>> boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, > >>>>> T13, T14, T15, T16, T17, T18, T19>::internal_apply_visitor_impl(int, > >>>>> int, Visitor&, VoidPtrCV) [with Visitor = > >>>>> boost::detail::variant::copy_into, VoidPtrCV = const void*, T0_ = > >>>>> int, T1 = double, T2 = std::basic_string<char, > >>>>> std::char_traits<char>, std::allocator<char> >, T3 = > >>>>> boost::detail::variant::void_, T4 = boost::detail::variant::void_, > >>>>> T5 = boost::detail::variant::void_, T6 = > >>>>> boost::detail::variant::void_, T7 = boost::detail::variant::void_, > >>>>> T8 = boost::detail::variant::void_, T9 = > >>>>> boost::detail::variant::void_, T10 = boost::detail::variant::void_, > >>>>> T11 = boost::detail::variant::void_, T12 = > >>>>> boost::detail::variant::void_, T13 = > >>>>> boost::detail::variant::void_, T14 = boost::detail::variant::void_, > >>>>> T15 = > >>>>> boost::detail::variant::void_, T16 = boost::detail::variant::void_, > >>>>> T17 = boost::detail::variant::void_, T18 = > >>>>> boost::detail::variant::void_, T19 = > >>>>> boost::detail::variant::void_]::first_which, step0 = > >>>>> boost::variant<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, > >>>>> T12, T13, T14, T15, T16, T17, T18, > >>>>> T19>::internal_apply_visitor_impl(int, int, Visitor&, VoidPtrCV) > >>>>> [with Visitor = boost::detail::variant::copy_into, VoidPtrCV = const > >>>>> void*, T0_ = int, T1 = double, T2 = std::basic_string<char, > >>>>> std::char_traits<char>, > >>>>> std::allocator<char> >, T3 = boost::detail::variant::void_, T4 = > >>>>> boost::detail::variant::void_, T5 = boost::detail::variant::void_, T6 > >>>>> = boost::detail::variant::void_, T7 = boost::detail::variant::void_, > >>>>> T8 = boost::detail::variant::void_, T9 = > >>>>> boost::detail::variant::void_, T10 = boost::detail::variant::void_, > >>>>> T11 = boost::detail::variant::void_, T12 = > >>>>> boost::detail::variant::void_, T13 = > >>>>> boost::detail::variant::void_, T14 = boost::detail::variant::void_, > >>>>> T15 = boost::detail::variant::void_, T16 = > >>>>> boost::detail::variant::void_, T17 = boost::detail::variant::void_, > >>>>> T18 = boost::detail::variant::void_, T19 = > >>>>> boost::detail::variant::void_]::first_step, Visitor = > >>>>> boost::detail::variant::copy_into, VoidPtrCV = const void*, > >>>>> NoBackupFlag = boost::variant<int, double, std::basic_string<char, > >>>>> std::char_traits<char>, std::allocator<char> >, > >>>>> boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, > >>>>> boost::detail::variant::void_>::has_fallback_type_]::next_step, > >>>>> Visitor = boost::detail::variant::copy_into, VPCV = const void*, NBF > >>>>> = boost::variant<int, double, std::basic_string<char, > >>>>> std::char_traits<char>, std::allocator<char> >, > >>>>> boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, boost::detail::variant::void_, > >>>>> boost::detail::variant::void_, > >>>>> boost::detail::variant::void_>::has_fallback_type_]: Assertion > >>>>> `false' failed. > >>>>> > >>>>> > >>>>> > >>>>> And the debugging points to this: "BOOST_ASSERT(false);" > >>>>> > >>>>> ///////////////////////////////////////////////////////////////////// > >>>>> // // ////// // (detail) function template visitation_impl > >>>>> // > >>>>> // Invokes the given visitor on the type in the given variant > >>>>> storage. // > >>>>> > >>>>> template < > >>>>> > >>>>> typename W, typename S > >>>>> > >>>>> , typename Visitor, typename VPCV > >>>>> , typename NBF > >>>>> > >>>>> inline > >>>>> > >>>>> BOOST_VARIANT_AUX_GENERIC_RESULT_TYPE(typename Visitor::result_type) > >>>>> > >>>>> visitation_impl( > >>>>> > >>>>> int, int, Visitor&, VPCV > >>>>> > >>>>> , mpl::true_ // is_apply_visitor_unrolled > >>>>> , NBF, W* = 0, S* = 0 > >>>>> ) > >>>>> > >>>>> { > >>>>> > >>>>> // should never be here at runtime: > >>>>> BOOST_ASSERT(false); > >>>>> typedef typename Visitor::result_type result_type; > >>>>> return ::boost::detail::variant::forced_return< result_type >(); > >>>>> > >>>>> } > >>>>> > >>>>> > >>>>> Any idea what's happening here? > >>>>> > >>>>> Cheers, Tom > >>>>> > >>>>> Am Montag 28 Juni 2010, um 15:44:05 schrieb Thomas Walter: > >>>>>> 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 > >>> > >>> _______________________________________________ > >>> 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

