% Template GRASS newsletter - Article
% Language: Latex
%

\begin{article}

\title{An Image Request Application Using FOSS4G Tools}
\author{Peter Wilkins}

\maketitle

\section{Abstract}
\label{sec:abstractWilkins}

 Bohannan Huston Inc., New Mexico's ``premier civil engineering and spatial data company'', currently manages over eight terabytes of aerial orthophotography of New Mexico and surrounding states.  As the amount of data has increased, so has the overhead required for effectively managing and accessing the data, as well as the demand in the workplace for this imagery.  To meet this challenge, a custom software system was created that allows users to search the aerial data graphically and request subsets of these images.  This software application, BHImage Request, is written using 100\% FOSS4G tools.

\section{Streamlined Workflow, Reduced Overhead}
\label{sec:streamlined}

BHImage Request is intended to give users quick access to imagery with minimal overhead.  Previous to the development of the tool, the desired images were requested from the Bohannan Huston CADD Center via completion of various forms and help tickets.  After the CADD Center receives these forms, someone would manually locate the data, zoom to the requested extent, extract the imagery using various tools such as Arc, and then send the requested files to the user.  The new system vastly reduces the workload required to obtain imagery for both the requestor and the CADD Center, as well as making the large and often disparate collection of data (differing projections, false color/RGB, etc) accessible through a single interface.

The initial web page of the application displays an ESRI shapefile map of New Mexico.  The system displays color-coded shapefiles indicating pixel resolution of available imagery by area, allowing users to see at a glance the imagery that exists for different regions.  A shapefile of GPS roads is also available for overlay.  By zooming, drawing a bounding box, or manually entering the coordinates of an extent, the user is able to locate the region of interest.  When the user zooms or pans, the system uses the center of the new extent as a point to compare against bounding extents of all currently-indexed imagery.  These bounding extents are stored in a PostGIS database, which provides convenient spatial functionality, easing spatial queries.  Any imagery that overlaps the new extent is displayed in a box (Figure \ref{fig:image_req1} (top)).  When the user selects one of these images, it is rendered onto the map ( Figure \ref{fig:image_req2} (middle)).

After the user has found the region of interest, clicking the Request Image button brings up the image request page (Figure \ref{fig:image_req3} (bottom)).  Using this page, the user can specify options including the file format (jpg, ecw, tiff), pixel size, and datum/projection.  Once the user has filled in the requirements of the request, the request is submitted to the system which is processed in the background.  When the system has extracted the selected imagery, it is placed in a directory on the web server and a link is emailed to the user.  The user clicks on the email link, and saves their requested imagery to their working directory.

\begin{figure}[htbp]
   \centering
   \subfigure{
   \includegraphics[width=\textwidth]{case_studies/wilkins/image_req1.png}
   \label{fig:image_req1}}
   \subfigure{
   \includegraphics[width=\textwidth]{case_studies/wilkins/image_req2.png}
   \label{fig:image_req2}}
   \subfigure{
   \includegraphics[width=\textwidth]{case_studies/wilkins/image_req3.png}
   \label{fig:image_req3}}
\caption{BHImage Request application in action}
\end{figure}

\section{Household FOSS4G Names}
\label{sec:household}

Progress is built on the shoulders of giants and BHImage Request is no exception.
\begin{itemize}
\item {As the user visually searches the database, the map and accompanying overlaid raster files are rendered courtesy of MapServer, which runs inside the MapServer 4 Windows package.  }
\item {Processing of requested imagery is done via the GDAL Utilities (\url{http://www.gdal.org/gdal_utilities.html}).}  
\item {\textit{gdalwarp} is used for rendering of the image from the original file and is capable of handling most of the user selected images options such as pixel size.  }
\item {\textit{gdal\_translate} is used to translate the image to other formats if necessary once the image has been originally rendered (as a tiff).}
\item {PHP is used to perform the searching and to gather the data}
\item {PostGIS is used to perform a spatial query against the database}
\item {MapScript is used to dynamically activate any result layers.}
\end{itemize}

\section{Performance}
\label{sec:performance}

So far the system has fulfilled over 800 requests. Some of these requests are for images as large as 1 GB in size which have a processing time of up to an hour.  Thirty eight gigabytes have been served by the system so far, and we anticipate many more to come.  The system has been live for the entire company which consists of approximately 240 users for well over three months.  Usage statistics are already being tracked, including file size and render time.  With each request running in its own process, there exists potential for concurrent processing of multiple jobs. The only crashes that have happened have been due to the form validation of user input: incorrect usernames, project names with special characters, and related problems that have been quickly solved with the addition of a quick javascript here or regular expression there.

\section{Many Uses Now and Into the Future}
\label{sec:uses}

BHImage Request serves many needs for the Bohannan Huston community.  Low resolution imagery is used for artwork and proposals.  Higher resolution imagery can be generated for basic planning. The highest resolution images are used for engineering and design.  

Even though the beta test cycle is almost complete and the application will soon be released company-wide, planning for future versions of the application is already in progress.  Currently we are exploring the possibility of using the WorldWind API, which will allow Bohannan Huston imagery and surface/elevation data to be visualized concurrently.  This will allow the user to make image and surface data requests together or separately.  Project data, models, images, surfaces, and contours can all be viewed and downloaded in real time in 3D, providing a platform for the next generation in civil engineering, CADD, and GIS frameworks.

\address{Peter Wilkins\\
  Bohannan Huston Inc.\\
  \email{pwilkins AT bhinc.com}}

%%% Local Variables: 
%%% mode: latex
%%% TeX-master: main_document.tex
%%% End: 
\end{article}
