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.html > > 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

