\hypertarget{mapio_8cpp}{\section{mapio.\-cpp File Reference}
\label{mapio_8cpp}\index{mapio.\-cpp@{mapio.\-cpp}}
}
{\ttfamily \#include \char`\"{}mapio.\-h\char`\"{}}\\*
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
int \hyperlink{mapio_8cpp_a2ba6e0bfae542ff5a326135c3cb9b40d}{check\-\_\-error} (int status, struct \hyperlink{structmapsrc}{mapsrc} $\ast$src)
\item 
void \hyperlink{mapio_8cpp_a301c88c9019432d421e18fe081ae5183}{mapsrc\-\_\-fill} (const char $\ast$file, struct \hyperlink{structmapsrc}{mapsrc} $\ast$src)
\begin{DoxyCompactList}\small\item\em Opens a G\-M\-T G\-R\-D file and read coordinate variables. \end{DoxyCompactList}\item 
float \hyperlink{mapio_8cpp_a8230a09f645b102b4fd5f260fb1bad30}{mapsrc\-\_\-find} (struct \hyperlink{structmapsrc}{mapsrc} $\ast$src, double x, double y)
\begin{DoxyCompactList}\small\item\em Find a z value at a given point. \end{DoxyCompactList}\item 
struct \hyperlink{structmapsrc}{mapsrc} $\ast$ \hyperlink{mapio_8cpp_aa6428330fa7a571d20e7234d4d2aba75}{mapsrc\-\_\-init} (void)
\begin{DoxyCompactList}\small\item\em Initializes a mapsrc structure. \end{DoxyCompactList}\item 
void \hyperlink{mapio_8cpp_aabf8bef5fedae2f75ac4c304bcffbe5e}{mapsrc\-\_\-free} (struct \hyperlink{structmapsrc}{mapsrc} $\ast$src)
\begin{DoxyCompactList}\small\item\em Frees the memory used by a mapsrc structure. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{mapio_8cpp_abbc2f0cd2f191e800a3b3e78eb634756}{mapsrc\-\_\-tostring} (struct \hyperlink{structmapsrc}{mapsrc} $\ast$src)
\begin{DoxyCompactList}\small\item\em create a string of a mapsrc structure \end{DoxyCompactList}\item 
int \hyperlink{mapio_8cpp_a5fb205f56749e1213b1869d455b2c1a3}{mapdata\-\_\-fill} (struct \hyperlink{structmapsrc}{mapsrc} $\ast$src, struct \hyperlink{structmapdata}{mapdata} $\ast$data, double x, double y, double xwidth, double ywidth)
\begin{DoxyCompactList}\small\item\em Read a submap from a netcdf U\-T\-M G\-R\-D file into a mapdata structure. \end{DoxyCompactList}\item 
void \hyperlink{mapio_8cpp_aac471113c7492adaefeb0a897be51f1c}{mapdata\-\_\-free} (struct \hyperlink{structmapdata}{mapdata} $\ast$data, int free\-\_\-all)
\begin{DoxyCompactList}\small\item\em Free's the memory held by a mapdata structure. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{mapio_8cpp_a270da9d3b5dcf304b1de7cb39d3a4650}{mapdata\-\_\-tostring} (struct \hyperlink{structmapdata}{mapdata} $\ast$data)
\begin{DoxyCompactList}\small\item\em create a string of a mapdata structure \end{DoxyCompactList}\item 
int \hyperlink{mapio_8cpp_aaacac2d74bfa7f23515981dc04287568}{nearest} (double key, const double $\ast$base, size\-\_\-t nmemb)
\begin{DoxyCompactList}\small\item\em Find the index of the nearest value. \end{DoxyCompactList}\item 
float \hyperlink{mapio_8cpp_ae358ba32806aaa555b155167813395a4}{get\-Z} (const float $\ast$z, int row, int column, int columns)
\item 
void \hyperlink{mapio_8cpp_a26cf79535a8835227a485d46a6f90997}{z\-\_\-print} (const float $\ast$z, int rows, int columns)
\item 
int \hyperlink{mapio_8cpp_a538cbe2c92bc89a4b7c75a83ac6b9cf2}{mapdata\-\_\-check} (struct \hyperlink{structmapdata}{mapdata} $\ast$data, struct \hyperlink{structmapsrc}{mapsrc} $\ast$src, double xcenter, double ycenter, double xwidth, double ywidth)
\begin{DoxyCompactList}\small\item\em Returns a code indicating the status of the mapdata. \end{DoxyCompactList}\item 
struct \hyperlink{structmapbounds}{mapbounds} $\ast$ \hyperlink{mapio_8cpp_a39854617464b3eb7e9ea1c88e93836d1}{mapbounds\-\_\-init} ()
\begin{DoxyCompactList}\small\item\em Create a mapbounds struct. \end{DoxyCompactList}\item 
int \hyperlink{mapio_8cpp_a007467e932d429d0dc03a92cc80123ca}{mapbounds\-\_\-fill1} (struct \hyperlink{structmapsrc}{mapsrc} $\ast$src, struct \hyperlink{structmapbounds}{mapbounds} $\ast$bounds)
\begin{DoxyCompactList}\small\item\em Fills a mapbounds structure from a mapsrc object. \end{DoxyCompactList}\item 
char $\ast$ \hyperlink{mapio_8cpp_a40195a00749cd51a23b292ad6042e14f}{mapbounds\-\_\-tostring} (struct \hyperlink{structmapbounds}{mapbounds} $\ast$bounds)
\begin{DoxyCompactList}\small\item\em Return a string representation of a mapbounds struct. \end{DoxyCompactList}\item 
int \hyperlink{mapio_8cpp_af4e3c627db170771853e304f4f378f13}{mapbounds\-\_\-fill2} (const char $\ast$file, struct \hyperlink{structmapbounds}{mapbounds} $\ast$bounds)
\begin{DoxyCompactList}\small\item\em Fill in a mapbounds structure from a netcdf file. \end{DoxyCompactList}\item 
int \hyperlink{mapio_8cpp_a15ed12b63525a5e9b80e8483d8be9e6d}{mapbounds\-\_\-contains} (struct \hyperlink{structmapbounds}{mapbounds} $\ast$bounds, const double x, const double y)
\item 
int \hyperlink{mapio_8cpp_a87c593c5982d14693c3d23d4d97824a1}{mapdata\-\_\-checksize} (struct \hyperlink{structmapbounds}{mapbounds} $\ast$bounds, struct \hyperlink{structmapdata}{mapdata} $\ast$data, const double xwidth, const double ywidth)
\end{DoxyCompactItemize}


\subsection{Function Documentation}
\hypertarget{mapio_8cpp_a2ba6e0bfae542ff5a326135c3cb9b40d}{\index{mapio.\-cpp@{mapio.\-cpp}!check\-\_\-error@{check\-\_\-error}}
\index{check\-\_\-error@{check\-\_\-error}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{check\-\_\-error}]{\setlength{\rightskip}{0pt plus 5cm}int check\-\_\-error (
\begin{DoxyParamCaption}
\item[{int}]{status, }
\item[{struct {\bf mapsrc} $\ast$}]{src}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a2ba6e0bfae542ff5a326135c3cb9b40d}
\hypertarget{mapio_8cpp_ae358ba32806aaa555b155167813395a4}{\index{mapio.\-cpp@{mapio.\-cpp}!get\-Z@{get\-Z}}
\index{get\-Z@{get\-Z}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{get\-Z}]{\setlength{\rightskip}{0pt plus 5cm}float get\-Z (
\begin{DoxyParamCaption}
\item[{const float $\ast$}]{z, }
\item[{int}]{row, }
\item[{int}]{column, }
\item[{int}]{columns}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_ae358ba32806aaa555b155167813395a4}
\hypertarget{mapio_8cpp_a15ed12b63525a5e9b80e8483d8be9e6d}{\index{mapio.\-cpp@{mapio.\-cpp}!mapbounds\-\_\-contains@{mapbounds\-\_\-contains}}
\index{mapbounds\-\_\-contains@{mapbounds\-\_\-contains}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapbounds\-\_\-contains}]{\setlength{\rightskip}{0pt plus 5cm}int mapbounds\-\_\-contains (
\begin{DoxyParamCaption}
\item[{struct {\bf mapbounds} $\ast$}]{bounds, }
\item[{const double}]{x, }
\item[{const double}]{y}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a15ed12b63525a5e9b80e8483d8be9e6d}
\hypertarget{mapio_8cpp_a007467e932d429d0dc03a92cc80123ca}{\index{mapio.\-cpp@{mapio.\-cpp}!mapbounds\-\_\-fill1@{mapbounds\-\_\-fill1}}
\index{mapbounds\-\_\-fill1@{mapbounds\-\_\-fill1}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapbounds\-\_\-fill1}]{\setlength{\rightskip}{0pt plus 5cm}int mapbounds\-\_\-fill1 (
\begin{DoxyParamCaption}
\item[{struct {\bf mapsrc} $\ast$}]{src, }
\item[{struct {\bf mapbounds} $\ast$}]{bounds}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a007467e932d429d0dc03a92cc80123ca}


Fills a mapbounds structure from a mapsrc object. 

function\-: mapbounds\-\_\-fill1

Fills in a mapbounds structure based on info in the src stucture 
\begin{DoxyParams}{Parameters}
{\em src} & The mapsrc data structure \\
\hline
{\em bounds} & The mapbounds data structure to populate \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
T\-O\-D\-O...return a meaninful error code 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_af4e3c627db170771853e304f4f378f13}{\index{mapio.\-cpp@{mapio.\-cpp}!mapbounds\-\_\-fill2@{mapbounds\-\_\-fill2}}
\index{mapbounds\-\_\-fill2@{mapbounds\-\_\-fill2}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapbounds\-\_\-fill2}]{\setlength{\rightskip}{0pt plus 5cm}int mapbounds\-\_\-fill2 (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{file, }
\item[{struct {\bf mapbounds} $\ast$}]{bounds}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_af4e3c627db170771853e304f4f378f13}


Fill in a mapbounds structure from a netcdf file. 

function\-: mapbounds\-\_\-fill2

Fills in a maounds structure based on data in the netcdf file \hypertarget{mapio_8cpp_a39854617464b3eb7e9ea1c88e93836d1}{\index{mapio.\-cpp@{mapio.\-cpp}!mapbounds\-\_\-init@{mapbounds\-\_\-init}}
\index{mapbounds\-\_\-init@{mapbounds\-\_\-init}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapbounds\-\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf mapbounds}$\ast$ mapbounds\-\_\-init (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a39854617464b3eb7e9ea1c88e93836d1}


Create a mapbounds struct. 

function\-: mapbounds\-\_\-init

Allocates memory for a mapbounds struct as sets all values to 0. The structure's memory will need to be freed when done with the structure. \begin{DoxyReturn}{Returns}
A mapbounds structure 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_a40195a00749cd51a23b292ad6042e14f}{\index{mapio.\-cpp@{mapio.\-cpp}!mapbounds\-\_\-tostring@{mapbounds\-\_\-tostring}}
\index{mapbounds\-\_\-tostring@{mapbounds\-\_\-tostring}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapbounds\-\_\-tostring}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ mapbounds\-\_\-tostring (
\begin{DoxyParamCaption}
\item[{struct {\bf mapbounds} $\ast$}]{bounds}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a40195a00749cd51a23b292ad6042e14f}


Return a string representation of a mapbounds struct. 

function\-: mapbounds\-\_\-tostring

String rep of a mapbounds struct 
\begin{DoxyParams}{Parameters}
{\em bounds} & A mapbounds struct \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A char$\ast$. Don't forget to free it when you're done with it 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_a538cbe2c92bc89a4b7c75a83ac6b9cf2}{\index{mapio.\-cpp@{mapio.\-cpp}!mapdata\-\_\-check@{mapdata\-\_\-check}}
\index{mapdata\-\_\-check@{mapdata\-\_\-check}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapdata\-\_\-check}]{\setlength{\rightskip}{0pt plus 5cm}int mapdata\-\_\-check (
\begin{DoxyParamCaption}
\item[{struct {\bf mapdata} $\ast$}]{data, }
\item[{struct {\bf mapsrc} $\ast$}]{src, }
\item[{double}]{xcenter, }
\item[{double}]{ycenter, }
\item[{double}]{xwidth, }
\item[{double}]{ywidth}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a538cbe2c92bc89a4b7c75a83ac6b9cf2}


Returns a code indicating the status of the mapdata. 

function\-: mapdata\-\_\-check

T\-O\-D\-O 
\begin{DoxyParams}{Parameters}
{\em data} & T\-He mapdata structure \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An integer indicating the status of the data structure 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_a87c593c5982d14693c3d23d4d97824a1}{\index{mapio.\-cpp@{mapio.\-cpp}!mapdata\-\_\-checksize@{mapdata\-\_\-checksize}}
\index{mapdata\-\_\-checksize@{mapdata\-\_\-checksize}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapdata\-\_\-checksize}]{\setlength{\rightskip}{0pt plus 5cm}int mapdata\-\_\-checksize (
\begin{DoxyParamCaption}
\item[{struct {\bf mapbounds} $\ast$}]{bounds, }
\item[{struct {\bf mapdata} $\ast$}]{data, }
\item[{const double}]{xwidth, }
\item[{const double}]{ywidth}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a87c593c5982d14693c3d23d4d97824a1}
\hypertarget{mapio_8cpp_a5fb205f56749e1213b1869d455b2c1a3}{\index{mapio.\-cpp@{mapio.\-cpp}!mapdata\-\_\-fill@{mapdata\-\_\-fill}}
\index{mapdata\-\_\-fill@{mapdata\-\_\-fill}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapdata\-\_\-fill}]{\setlength{\rightskip}{0pt plus 5cm}int mapdata\-\_\-fill (
\begin{DoxyParamCaption}
\item[{struct {\bf mapsrc} $\ast$}]{src, }
\item[{struct {\bf mapdata} $\ast$}]{data, }
\item[{double}]{x, }
\item[{double}]{y, }
\item[{double}]{xwidth, }
\item[{double}]{ywidth}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a5fb205f56749e1213b1869d455b2c1a3}


Read a submap from a netcdf U\-T\-M G\-R\-D file into a mapdata structure. 

function\-: mapdata\-\_\-fill

Reads in a rectangular block of bathymetry data from a file (defined by src). The size of the rectangle is based on the params but will N\-O\-T be exaclty as specified by xwidth and ywidth. 
\begin{DoxyParams}{Parameters}
{\em src} & The mapsrc structure definining where we are reading data from \\
\hline
{\em data} & A mapdata structure for storing the submap \\
\hline
{\em x} & The easting position of the vehicle. In the same U\-T\-M coordinate system as the src map. \\
\hline
{\em y} & The northing position of the vehicle. In the same U\-T\-M coordinate system as the src map. \\
\hline
{\em xwidth} & The width of the submap in meters to retrive. \\
\hline
{\em ywidth} & The width of the submap in meters to retrieve \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
An integer code of M\-A\-P\-B\-O\-U\-N\-D\-S\-\_\-\-O\-K if all is O\-K, M\-A\-P\-B\-O\-U\-N\-D\-S\-\_\-\-O\-U\-T\-\_\-\-O\-F\-\_\-\-B\-O\-U\-N\-D\-S if the x or y coordinate is outside the boundaries fo the map reference by src, or M\-A\-P\-B\-O\-U\-N\-D\-S\-\_\-\-N\-E\-A\-R\-\_\-\-E\-D\-G\-E if you x,y position is near the edge (resulting in a truncated submap) 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_aac471113c7492adaefeb0a897be51f1c}{\index{mapio.\-cpp@{mapio.\-cpp}!mapdata\-\_\-free@{mapdata\-\_\-free}}
\index{mapdata\-\_\-free@{mapdata\-\_\-free}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapdata\-\_\-free}]{\setlength{\rightskip}{0pt plus 5cm}void mapdata\-\_\-free (
\begin{DoxyParamCaption}
\item[{struct {\bf mapdata} $\ast$}]{data, }
\item[{int}]{free\-\_\-all}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_aac471113c7492adaefeb0a897be51f1c}


Free's the memory held by a mapdata structure. 

function\-: mapdata\-\_\-free 
\begin{DoxyParams}{Parameters}
{\em data} & The mapdata structure who's memory we want to free \\
\hline
{\em free\-\_\-all} & If equal to 0 then the structure itself will not be freed, only the internal pointers. All structure values will be set to 0. if not equal to 1 then the data structure's memory will be release. \\
\hline
\end{DoxyParams}
\hypertarget{mapio_8cpp_a270da9d3b5dcf304b1de7cb39d3a4650}{\index{mapio.\-cpp@{mapio.\-cpp}!mapdata\-\_\-tostring@{mapdata\-\_\-tostring}}
\index{mapdata\-\_\-tostring@{mapdata\-\_\-tostring}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapdata\-\_\-tostring}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ mapdata\-\_\-tostring (
\begin{DoxyParamCaption}
\item[{struct {\bf mapdata} $\ast$}]{data}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a270da9d3b5dcf304b1de7cb39d3a4650}


create a string of a mapdata structure 

function\-: mapdata\-\_\-tostring 
\begin{DoxyParams}{Parameters}
{\em data} & The mapdata structure \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A string. Don't forget to free it when you're done. 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_a301c88c9019432d421e18fe081ae5183}{\index{mapio.\-cpp@{mapio.\-cpp}!mapsrc\-\_\-fill@{mapsrc\-\_\-fill}}
\index{mapsrc\-\_\-fill@{mapsrc\-\_\-fill}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapsrc\-\_\-fill}]{\setlength{\rightskip}{0pt plus 5cm}void mapsrc\-\_\-fill (
\begin{DoxyParamCaption}
\item[{const char $\ast$}]{file, }
\item[{struct {\bf mapsrc} $\ast$}]{src}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a301c88c9019432d421e18fe081ae5183}


Opens a G\-M\-T G\-R\-D file and read coordinate variables. 

function\-: mapsrc\-\_\-fill

Opens a G\-M\-T version 2 G\-R\-D file (netcdf). It stores the needed information, such as ids to the netcdf file, variables, and the data for the x and y coordinate variables. Note that 'struct mapsrc' contains references to arrays which must be released. If an error occurs on fill a flag will be set in the \hyperlink{structmapsrc_a4066046c632e3404b45abf37c068c1ff}{mapsrc.\-status} field. 
\begin{DoxyParams}{Parameters}
{\em file} & The path of the file to read. \\
\hline
{\em src} & The mapsrc structure for storing the information about the netcdf data file. \\
\hline
\end{DoxyParams}
\hypertarget{mapio_8cpp_a8230a09f645b102b4fd5f260fb1bad30}{\index{mapio.\-cpp@{mapio.\-cpp}!mapsrc\-\_\-find@{mapsrc\-\_\-find}}
\index{mapsrc\-\_\-find@{mapsrc\-\_\-find}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapsrc\-\_\-find}]{\setlength{\rightskip}{0pt plus 5cm}float mapsrc\-\_\-find (
\begin{DoxyParamCaption}
\item[{struct {\bf mapsrc} $\ast$}]{src, }
\item[{double}]{x, }
\item[{double}]{y}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a8230a09f645b102b4fd5f260fb1bad30}


Find a z value at a given point. 

function\-: mapsrc\-\_\-find

Find a z-\/value in a map at a given x, y location 
\begin{DoxyParams}{Parameters}
{\em src} & The mapsrc structure pointing to the map you want to read \\
\hline
{\em x} & The x coordinate in meters U\-T\-M (use same zone as net\-C\-D\-F file). \\
\hline
{\em y} & The y coordinate in meters U\-T\-M (use same zone as net\-C\-D\-F file). \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The z value in meters of the point nearest to the x, y location N\-A\-N is returned if the x,y coordinate falls outside the boundaries of the map. 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_aabf8bef5fedae2f75ac4c304bcffbe5e}{\index{mapio.\-cpp@{mapio.\-cpp}!mapsrc\-\_\-free@{mapsrc\-\_\-free}}
\index{mapsrc\-\_\-free@{mapsrc\-\_\-free}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapsrc\-\_\-free}]{\setlength{\rightskip}{0pt plus 5cm}void mapsrc\-\_\-free (
\begin{DoxyParamCaption}
\item[{struct {\bf mapsrc} $\ast$}]{src}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_aabf8bef5fedae2f75ac4c304bcffbe5e}


Frees the memory used by a mapsrc structure. 

function\-: mapsrc\-\_\-free

A mapsrc structure references to arrays. This function will free those arrays as well as the parent structure. 
\begin{DoxyParams}{Parameters}
{\em src} & Is the mapsrc structure to be freed \\
\hline
\end{DoxyParams}
\hypertarget{mapio_8cpp_aa6428330fa7a571d20e7234d4d2aba75}{\index{mapio.\-cpp@{mapio.\-cpp}!mapsrc\-\_\-init@{mapsrc\-\_\-init}}
\index{mapsrc\-\_\-init@{mapsrc\-\_\-init}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapsrc\-\_\-init}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf mapsrc}$\ast$ mapsrc\-\_\-init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_aa6428330fa7a571d20e7234d4d2aba75}


Initializes a mapsrc structure. 

function\-: mapsrc\-\_\-init

Allocates memory for a mapsrc structure and sets the status flags. You will need to call 'mapsrc\-\_\-free' on the structure to release it's memory when you are finished with it. \begin{DoxyReturn}{Returns}
A mapsrc structure. 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_abbc2f0cd2f191e800a3b3e78eb634756}{\index{mapio.\-cpp@{mapio.\-cpp}!mapsrc\-\_\-tostring@{mapsrc\-\_\-tostring}}
\index{mapsrc\-\_\-tostring@{mapsrc\-\_\-tostring}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{mapsrc\-\_\-tostring}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ mapsrc\-\_\-tostring (
\begin{DoxyParamCaption}
\item[{struct {\bf mapsrc} $\ast$}]{src}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_abbc2f0cd2f191e800a3b3e78eb634756}


create a string of a mapsrc structure 

function\-: mapsrc\-\_\-tostring 
\begin{DoxyParams}{Parameters}
{\em src} & The mapsrc structure \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
A string. Don't forget to free it when you're done. 
\end{DoxyReturn}
\hypertarget{mapio_8cpp_aaacac2d74bfa7f23515981dc04287568}{\index{mapio.\-cpp@{mapio.\-cpp}!nearest@{nearest}}
\index{nearest@{nearest}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{nearest}]{\setlength{\rightskip}{0pt plus 5cm}int nearest (
\begin{DoxyParamCaption}
\item[{double}]{key, }
\item[{const double $\ast$}]{base, }
\item[{size\-\_\-t}]{nmemb}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_aaacac2d74bfa7f23515981dc04287568}


Find the index of the nearest value. 

function\-: nearest

Finds the index of the nearest value in a double array to a key value. this is a naive implementation but should get us going. 
\begin{DoxyParams}{Parameters}
{\em key} & The key value \\
\hline
{\em base} & The double array that you're searcng to find the nearest value in. This implementation of nearest assumes the arrays are sorted ascending. \\
\hline
{\em nmemb} & The number of elements in the base array \\
\hline
\end{DoxyParams}
\hypertarget{mapio_8cpp_a26cf79535a8835227a485d46a6f90997}{\index{mapio.\-cpp@{mapio.\-cpp}!z\-\_\-print@{z\-\_\-print}}
\index{z\-\_\-print@{z\-\_\-print}!mapio.cpp@{mapio.\-cpp}}
\subsubsection[{z\-\_\-print}]{\setlength{\rightskip}{0pt plus 5cm}void z\-\_\-print (
\begin{DoxyParamCaption}
\item[{const float $\ast$}]{z, }
\item[{int}]{rows, }
\item[{int}]{columns}
\end{DoxyParamCaption}
)}}\label{mapio_8cpp_a26cf79535a8835227a485d46a6f90997}
