<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Allan CORNET
 * 
 * This file is released into the public domain
 *
 -->
<refentry version="5.0-subset Scilab" xml:id="CreateFlowDirFromBinary" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <pubdate>$LastChangedDate: 2013-10-16 12:00:00 +0100 (Wed., October 16, 2013)
    $</pubdate>
  </info>

  <refnamediv>
    <refname>CreateFlowDirFromBinary</refname>

    <refpurpose>Creates and initializes a flow direction grid from the content of a binary file.</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>

    <synopsis>handle_fdr = CreateFlowDirFromBinary ( binfile , TYPE , DirCodes [, name] )</synopsis>
  </refsynopsisdiv>


  <refsection>
    <title>Arguments</title>
    <variablelist>

	 <varlistentry>     
      <term>binfile</term>
        <listitem>
          <para>
           character string: path of the binary file to be read. The extension can be anything, but a header file with the same root and with the extension ".hdr" must be present in the same directory.
         </para>
        </listitem>
      </varlistentry>
	  
      <varlistentry>
        <term>TYPE</term>
        <listitem>
          <para>
	  Character string : type of the data to be read and converted to single-precision
	   </para>
	    <para>
		'c' : char
	    </para>
	    <para>
        'uc' : unsigned char
	    </para>
	    <para>
		's' : short int
	    </para>
	    <para>
        'us' : unsigned short int
	    </para>
	    <para>
        'i' : int
	    </para>
	    <para>
        'ui' : unsigned int
	    </para>
	    <para>
		'f' : float
	    </para>
	    <para>
        'l' : long int
	    </para>
	    <para>
        'ul' : unsigned long int
	    </para>
	    <para>
        'd' : double
	   </para>
	   
        </listitem>
      </varlistentry>
 
      <varlistentry>
        <term>DirCodes</term>
        <listitem>
          <para>
	  3 x 3 matrix containing the codification of the 8 possible flow directions. ESRI convention is [ 32 , 64 , 128 ; 16 , -9999 , 1 ; 8 , 4 , 2 ]
    	</para>
        </listitem>
	</varlistentry>
      
	  <varlistentry>     
      <term>name</term>
        <listitem>
          <para>
            (optional) character string
         </para>
        </listitem>
      </varlistentry>
	  
	   <varlistentry>
        <term>handle_fdr</term>
        <listitem>
          <para>
	 integer: handle on the newly created flow direction grid.
    	</para>
	  </listitem>
      </varlistentry>

</variablelist>
  </refsection>



  <refsection>
    <title>Description</title>

    <para>Reads a flow direction grid from a binary file (e.g., ESRI Binary Grid .flt). Any numerical type is supported and will be converted to a 1-byte value.</para>
    <para>Returns a handle on the new grid.</para>
	<para>NB : Objects of type "flow direction grid" ("FlowDirGrid" structures) are distinct from those of type "single-precision floating-point raster" ("FloatRaster" structures). Rasters are stored using 4-bytes records, while flow direction grids only require 1 byte per pixel.</para>

  </refsection>

  <refsection>
    <title>Examples</title>
  </refsection>

   <refsection><title>See Also</title><simplelist type='inline'>
    
      <member> 
         <link linkend='DestroyFlowDirGrid'>DestroyFlowDirGrid</link>
      </member>
     
   </simplelist></refsection>


  <refsection>
    <title>Authors</title>

    <simplelist type="vert">
      <member>Nicolas LE MOINE</member>
    </simplelist>
  </refsection>
</refentry>
