当前位置: 首页>>代码示例>>C++>>正文


C++ Map::set_background方法代码示例

本文整理汇总了C++中mapnik::Map::set_background方法的典型用法代码示例。如果您正苦于以下问题:C++ Map::set_background方法的具体用法?C++ Map::set_background怎么用?C++ Map::set_background使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mapnik::Map的用法示例。


在下文中一共展示了Map::set_background方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: main


//.........这里部分代码省略.........
      std::cout << "Generating tiles on rank " << rank << "...... \n" << std::flush;
      g_gProj = GoogleProjection(maxZoom);
      double dummy = 0.0;
   
      #ifdef _DEBUG
      std::string plugin_path = mapnik_dir + "input/debug/";
      std::cout << "..set plugin-path to "<<plugin_path<<"\n"<< std::flush;
      #else
      std::string plugin_path = mapnik_dir + "input/release/";   
      std::cout << "..set plugin-path to "<<plugin_path<<"\n"<< std::flush;
      #endif

      datasource_cache::instance()->register_datasources(plugin_path.c_str()); 
      std::string font_dir = mapnik_dir + "fonts/dejavu-fonts-ttf-2.30/ttf/";
      {
         std::cout << "..looking for DejaVuSans fonts in... " << font_dir << "\n"<< std::flush;
      }
      if (boost::filesystem3::exists( font_dir ) )
      {
         boost::filesystem3::directory_iterator end_itr; // default construction yields past-the-end
         for ( boost::filesystem3::directory_iterator itr( font_dir );
            itr != end_itr;
            ++itr )
         {
            if (!boost::filesystem3::is_directory(itr->status()) )
            {
               freetype_engine::register_font(itr->path().string());
            }
         }
         std::cout << "....Ok!\n" << std::flush;
      } else { std::cout << "....#Error# Font directory not found!\n" << std::flush; }
      //---------------------------------------------------------------------------
      // -- Generate map container
      g_map.set_background(color_factory::from_string("white"));
      std::cout << "..loading map file \"" << map_file << "\".....";
      load_map(g_map,map_file);
      std::cout << "....Ok!\n" << std::flush;

      g_mapnikProj = projection(g_map.srs());
      //---------------------------------------------------------------------------
      // -- Create outputpath
      if(!FileSystem::DirExists(output_path))
         FileSystem::makedir(output_path);
      bool bDone = false;
      //---------------------------------------------------------------------------
      // -- performance measurement
      int tileCount = 0;
      int currentJobQueueSize = 0;
      clock_t t_0, t_1;
      t_0 = clock();
      while (!bDone)
      {
         if (rank == 0)
         {
            std::vector<SJob> vJobs;
            GenerateRenderJobs(totalnodes*queueSize, vJobs);
            currentJobQueueSize = vJobs.size();
            tileCount += currentJobQueueSize;
            if (vJobs.size() == 0) // no more jobs
            {
               bDone = true;
               t_1 = clock();
               double time=(double(t_1-t_0)/double(CLOCKS_PER_SEC));
               double tps = tileCount/time;
               std::cout << ">>> Finished rendering " << tileCount << " tiles at " << tps << " tiles per second! TOTAL TIME: " << time << "<<<\n" << std::flush;
            }
开发者ID:Kasheftin,项目名称:DataProcessing,代码行数:67,代码来源:main_mpi.cpp


注:本文中的mapnik::Map::set_background方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。