title: How to load a TIFF image like a graph in C++ BOOST
body: <p>I want do load a tiff image (GEOTIFF with pixels with float values) like graph in boost C++ (i'm a newbie in C++). My goal is use the bidirectional Dijkstra from source A to target B to get more performance.</p>
  
  <pre><code>Boost:GIL load tiif images:
  std::string filename( "raster_clip.tif" );
  rgb8_image_t img;
  read_image( filename, img, tiff_tag() ); 
  </code></pre>
  
  <p>But how convert to Boost graph? I am reading the documentation and looking for examples but I have not yet been able to implement it.</p>
  
  <p>Similar questions and examples that i found:</p>
  
  <p><a href="https://stackoverflow.com/questions/21144105/shortest-path-graph-algorithm-help-boost">Shortest path graph algorithm help Boost</a>;</p>
  
  <p><a href="http://www.geeksforgeeks.org/shortest-path-for-directed-acyclic-graphs/" rel="nofollow noreferrer">http://www.geeksforgeeks.org/shortest-path-for-directed-acyclic-graphs/</a></p>
  
  <p>I am currently using the scikit-image library and use skimage.graph.route_through_array function to load graph with array in python. I use GDAL to get an array by load image as suggested by @ustroetz in this example <a href="https://gis.stackexchange.com/questions/28583/gdal-perform-simple-least-cost-path-analysis">Here</a>:</p>
  
  <pre><code>    raster = gdal.Open("raster.tiff")
      band = raster.GetRasterBand(1)
      array = band.ReadAsArray()
  </code></pre>
  
  <p>Example of TIFF (was converted to PNG after upload) is: 
    <a href="https://i.stack.imgur.com/WSbcK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WSbcK.png" alt="This is a example of image"></a></p>